fix(cypher): ignore unbound OPTIONAL MATCH values in COUNT - #2241
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. |
|
Merged — thank you. This is the correct semantics, and the test is the kind we can rely on.
I checked that your test can fail rather than taking the green suite at face value — with That matters here: this repository has shipped tests that passed with the fix removed, so a passing suite is not by itself evidence. Yours earns it. One thing you may want to look at next, entirely optional. The guard is scoped to If you would like to extend this to the other aggregates, I would happily review it — and if you would rather stop here, that is a complete fix for the bug you set out to fix, and I will open a follow-up myself with credit to you for finding the shape of it. |
What does this PR do?
Fixes
COUNT(variable)so OPTIONAL MATCH fallback rows with an unbound variable are not counted.COUNT(*)remains unchanged.Adds a focused regression test for the bound-terminal query shape from #1404. The historical Cartesian-product path is already fixed on current
main; this patch addresses the remaining incorrect count for unbound fallback rows.Fixes #1404
Checklist
git commit -s) — required, CI rejects unsignedcommits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)