Repository navigation
Commit 3d9a6cf
fix(cypher): reject a non-numeric SKIP/LIMIT operand instead of dropping it
expect() fills p->error and returns NULL when the token after SKIP or LIMIT
is not a number, but both call sites only tested `if (num)` and then fell
through to `*out = r; return 0;`. r->limit kept the -1 "unset" initialiser,
which execution reads as "no LIMIT":
rb_apply_skip_limit(rb, ret->skip, ret->limit >= 0 ? ret->limit : max_rows);
So `RETURN n.name LIMIT $limit` ran unbounded and answered isError:false with
the whole result set. `SKIP $offset LIMIT 10` lost both clauses at once,
because the orphaned operand also blocked the following match(p, TOK_LIMIT).
Propagate the failure the way the ORDER BY branch directly above already
does. This is the failure mode #1334 banned, reached by a different route.
Fixes #1994
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: metehanulusoy <ulusoy.metehan03@gmail.com>1 parent 5fbab7b commit 3d9a6cf
2 files changed
Lines changed: 64 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1817 | 1817 | | |
1818 | 1818 | | |
1819 | 1819 | | |
1820 | | - | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1821 | 1823 | | |
1822 | 1824 | | |
1823 | | - | |
1824 | | - | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1825 | 1828 | | |
| 1829 | + | |
1826 | 1830 | | |
1827 | 1831 | | |
1828 | | - | |
| 1832 | + | |
| 1833 | + | |
1829 | 1834 | | |
1830 | 1835 | | |
1831 | | - | |
1832 | | - | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1833 | 1839 | | |
| 1840 | + | |
1834 | 1841 | | |
1835 | 1842 | | |
1836 | 1843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
423 | 470 | | |
424 | 471 | | |
425 | 472 | | |
| |||
4116 | 4163 | | |
4117 | 4164 | | |
4118 | 4165 | | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
4119 | 4170 | | |
4120 | 4171 | | |
4121 | 4172 | | |
| |||
0 commit comments