Commit aec0ced
committed
fix: LIKE case sensitivity, bigint arithmetic precision, CAST(str AS BIGINT)
Three SQL correctness fixes:
1. decode.ts: compileLikeRegex used "i" flag — LIKE was case-insensitive,
violating SQL standard and disagreeing with the WASM SIMD path (which
does byte-level comparison). Removed "i" flag, kept "s" for dotAll.
2. evaluator.ts: arithmetic ops (add/subtract/multiply) went through
toNumber() which loses precision for bigint values > MAX_SAFE_INTEGER.
Added numericOp() that preserves bigint arithmetic when both operands
are bigint or safe integers. Unary minus also preserves bigint.
3. evaluator.ts: CAST(string AS BIGINT) went through toNumber() → float
before BigInt(), losing precision for large integer strings. Now uses
BigInt(val) directly for string inputs.1 parent 770508a commit aec0ced
2 files changed
+24
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
| 587 | + | |
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
186 | 200 | | |
187 | 201 | | |
188 | 202 | | |
189 | 203 | | |
190 | 204 | | |
191 | 205 | | |
192 | 206 | | |
193 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
194 | 212 | | |
195 | 213 | | |
196 | 214 | | |
| |||
0 commit comments