Commit a302058
Dylan Bobby Storey
validate: T-0234 — LIMIT/SKIP allow constant expressions (no var refs)
Previous check rejected any non-literal/non-parameter expression in
LIMIT or SKIP, including constant computations like:
WITH n LIMIT toInteger(ceil(1.7)) RETURN count(*)
-- ReturnSkipLimit2 [6]
Per the openCypher spec, LIMIT/SKIP accept any expression that
evaluates to a non-negative integer at compile time. Only expressions
that reference variables from the surrounding scope (`LIMIT n.count`)
are invalid.
Added expr_has_var_reference() — walks the AST looking for
IDENTIFIER / PROPERTY / SUBSCRIPT bases. The SKIP/LIMIT validator
now allows any expression with no var refs (the runtime handles the
actual value check) and rejects expressions with var refs as
NonConstantExpression.
TCK delta: pass=3461 → 3462 (+1), errors=79 → 77 (-2). The other
error scenario flipped to a result fail (executor LIMIT-through-
WITH still has its own bug; that's separate from validation).
944/944 unit, functional clean.1 parent c1ac2f3 commit a302058
1 file changed
Lines changed: 64 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
716 | | - | |
717 | | - | |
718 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
719 | 777 | | |
720 | 778 | | |
721 | 779 | | |
| |||
740 | 798 | | |
741 | 799 | | |
742 | 800 | | |
743 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
744 | 804 | | |
745 | 805 | | |
746 | 806 | | |
| |||
0 commit comments