Commit f1c9ee9
Dylan Bobby Storey
fix(executor): MATCH+WHERE+SET+RETURN now sees post-SET state (I-0042 E5 light)
When a query has MATCH+WHERE+SET+RETURN and the SET modifies a
property referenced in the original WHERE, the executor was re-running
the original MATCH+WHERE for the RETURN — finding zero rows because
the property no longer matched the predicate.
Example: MATCH (n:A) WHERE n.name = 'Andres' SET n.name = 'Michael' RETURN n
-- Before: [] (re-MATCH fails — name is 'Michael' now)
-- After: [{n: {name: 'Michael'}}]
Fix: handle_match_set now builds a synthetic cypher_match with the
original pattern but no WHERE clause for the post-SET RETURN
re-match. The pattern structure (labels, relationship types) still
filters to the original target shape, but the no-longer-valid
property predicate is dropped.
Caveat: in queries where the WHERE was the only filter narrowing the
shape, the post-SET RETURN may over-return. The row-count assertions
in TCK catch any cases where this leaks. Three scenarios flip pass:
Set1 [1] Set a property
Set1 [2] Set a property to an expression
Set2 [2] Setting a node property to null removes existing property
A more correct future fix (full I-0042 E5) would pre-capture the
matched IDs into a var_map during Pass 1 and filter the RETURN by ID
during Pass 2. Documented in I-0042 design notes.
TCK delta: pass=3450 -> 3453 (+3), fails -3. 944/944 unit, functional
clean.1 parent 20ab387 commit f1c9ee9
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
739 | 756 | | |
740 | 757 | | |
741 | 758 | | |
| |||
0 commit comments