Commit 5116dd2
committed
sql/parser: fix minor issue with recent LTREE additions
We recently added parser support for FIRST_CONTAINS and
FIRST_CONTAINED_BY operators (`?@>` and `?<@` respectively). The AI
review pointed out a minor bug in how we handle these operators in the
scanner - we incorrectly advanced the position unconditionally before
matching the following characters. Instead, we need to use `peekN` to
look a few characters ahead to see whether we have a match, and this
commit does that. Note that the impact of the bug is very minor - we
simply would put the `^` character in the error in the wrong position.
Note that two newly-added tests have slightly different behavior with
regards to the `^` character which seems to be due to peculiarities of
the tokenizing / parsing that I didn't look closely into.
Additionally, this commit adds a newline character in an unrelated
parser test file.
Release note: None1 parent 8b1e1a9 commit 5116dd2
File tree
3 files changed
+21
-7
lines changed- pkg/sql
- parser/testdata
- scanner
3 files changed
+21
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2171 | 2171 | | |
2172 | 2172 | | |
2173 | 2173 | | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2174 | 2182 | | |
2175 | 2183 | | |
2176 | 2184 | | |
2177 | 2185 | | |
2178 | 2186 | | |
2179 | 2187 | | |
2180 | 2188 | | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
| 314 | + | |
316 | 315 | | |
317 | | - | |
| 316 | + | |
318 | 317 | | |
319 | 318 | | |
320 | 319 | | |
321 | 320 | | |
322 | | - | |
323 | | - | |
| 321 | + | |
324 | 322 | | |
325 | | - | |
| 323 | + | |
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
| |||
0 commit comments