Repository navigation
fix(cypher): early WHERE pass waits for function-argument aliases; #2250 regression tests - #2502
Conversation
Signed-off-by: lorenzozanee <wyz0707@proton.me>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for tackling the early WHERE filtering problem and adding regression coverage. Sorry this has waited for a maintainer response. While this PR was waiting, #2253 landed a related three-valued early-filter implementation, distilled from Andrew Hundt's #1245. In current main, unbound aliases produce UNKNOWN during the partial evaluation, NOT preserves UNKNOWN, and the early pass only drops definitively false rows; the full filter still runs after relationship expansion (partial evaluation, execution path). That merge happened after you opened this PR. The next maintainer step is to compare your implementation and regression cases against that change, so we can identify any remaining gaps and preserve useful coverage and credit. We are not treating this as automatically superseded, and have not independently verified the test results reported here. Please hold off on routine rebases until that comparison is done. The review queue is full, but the delay is ours; thank you for contributing and for your patience. |
…rseded The early WHERE pass in execute_single runs on seed rows where only the first alias is bound, so a NOT on the target node or the relationship pruned every row (DeusData#2250). This branch fixed that by skipping the early pass until every alias the WHERE reads was bound. While it waited for review, DeusData#2253 (8ab555e) landed the same fix on main as a three-valued early pass: an unbound alias is UNKNOWN, NOT keeps it UNKNOWN, and only a definite FALSE prunes. This branch's regression tests pass on main's production code unchanged, so restore src/cypher/cypher.c to the branch's base and keep the tests; the merge of main that follows takes main's implementation. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Conflict in tests/test_cypher.c: both sides added WHERE NOT regression tests right after cypher_exec_where_not. Kept both sets, main's four DeusData#2253 tests first, then this branch's four, with their RUN_TEST lines in the same order. src/cypher/cypher.c merged cleanly to main's version. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…eads eval_condition_partial (from DeusData#2253) answers UNKNOWN for a condition whose alias is not bound yet, but it only looked at c->variable. A function condition is filed under its first argument's alias, so in MATCH (a)-[:CALLS]->(b) WHERE coalesce(a.no_such_prop, b.name) = 'x' the seed row saw a bound a, read coalesce(NULL, <unbound b>) as a definite mismatch and pruned every row before CALLS expansion: zero rows, while the same predicate after WITH returned the right ones. Check every function argument's alias as well, the way this branch's original fix did (condition_bindings_available), inside main's three-valued leaf. RED before: cypher_exec_where_func_arg_on_unbound_target, row_count 0, expected 1. GREEN after; cypher suite 237 passed. Co-authored-by: lorenzozanee <wyz0707@proton.me> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, @lorenzozanee, for taking on #2250 and for such a careful set of regression cases. Covering the target node, a relationship property, the source-node control, the count(*) shape and the equivalent As promised in the earlier note, we compared your branch with #2253, which landed a related early-WHERE fix on main after you opened this PR. Here is what we found and what we pushed on top of your commit (your commit is unchanged):
We also retitled the PR to describe what it now contains. Once CI is green on the updated branch, it goes to the final merge review. Thank you for your patience while it waited, and for a contribution that improved the fix on main as well. |
|
Thank you for the Cypher alias-handling fix and the regression tests! The reviewed change passed the required CI checks and merged cleanly with current main in 3457b21. Thanks again for improving query correctness. |
The early WHERE pass evaluated predicates before relationship targets were bound, so NOT could discard rows that should reach the completed MATCH. The query engine now defers that pass until each referenced variable is available; the full WHERE filter still runs after relationship expansion. Regression tests cover target nodes, relationship properties, source-node behavior, aggregation, and equivalent predicate forms.
Cypher suite: 213/213 passed. Full suite: 8,313 passed, 17 unrelated CLI permission tests failed in the shared 0775 workspace, and 9 were skipped. scripts/lint.sh was incomplete because clang-tidy, cppcheck, and clang-format are unavailable on the host. Written with OpenAI Codex assistance on behalf of the submitting account owner.
Fixes #2250