Commit 905eb6c
Dylan Bobby Storey
validate: allow forward-reference variables in CREATE property maps
Per openCypher: variables bound in an earlier path of a CREATE clause
are in scope for later paths in the same clause:
CREATE (a:End {num: 42, id: 0}),
(:End {num: 3}),
(:Begin {num: a.id}) -- valid forward ref to `a`
Previous validation rejected this with 'SyntaxError: UndefinedVariable'
because it collected all pattern names AFTER validating. Now we
interleave: validate each path's property maps using the cumulative
local_bound set, then merge that path's bindings into local_bound
before moving on.
Backward references (path 1 referencing a variable from path 2) are
still rejected — local_bound only grows as we go.
TCK delta: 0 net (the syntactic block was removed, but the executor's
CREATE-with-forward-ref evaluation still produces null for `a.id` —
that's a runtime issue not addressed here). 944/944 unit, functional
clean; no regressions.
Affected (now no longer compile-error):
With2 [1] Forwarding a property to express a join
WithSkipLimit1 [1] Handle dependencies across WITH with SKIP
WithSkipLimit2 [2] Handle dependencies across WITH with LIMIT
(each still fails on result mismatch — separate executor work.)1 parent 506ec0e commit 905eb6c
1 file changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1614 | 1614 | | |
1615 | 1615 | | |
1616 | 1616 | | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1621 | 1623 | | |
1622 | 1624 | | |
1623 | 1625 | | |
1624 | 1626 | | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1625 | 1636 | | |
1626 | 1637 | | |
1627 | 1638 | | |
1628 | 1639 | | |
1629 | 1640 | | |
1630 | | - | |
| 1641 | + | |
1631 | 1642 | | |
1632 | 1643 | | |
1633 | 1644 | | |
| |||
1636 | 1647 | | |
1637 | 1648 | | |
1638 | 1649 | | |
1639 | | - | |
| 1650 | + | |
1640 | 1651 | | |
1641 | 1652 | | |
1642 | | - | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1643 | 1669 | | |
1644 | 1670 | | |
1645 | 1671 | | |
1646 | | - | |
| 1672 | + | |
| 1673 | + | |
1647 | 1674 | | |
1648 | 1675 | | |
1649 | 1676 | | |
| |||
0 commit comments