fix(cypher): scan all unlabeled query candidates - #1323
Conversation
|
These are just how I fixed them in my local build until solved on upstream, and since it worked in tests and were built according to the contributing guidelines, gpt said they could be sent as prs. They can be used as reference/alternative fixes if it can't be merged to hopefully speed up the process. Applies to the subsequent 3 other prs as well. |
|
Reviewed — the root cause is right and this is the correct fix layer. Two things stand between it and a merge, and neither of your failing checks is one of them. The bug is exactly as you diagnosed. Unlabeled Cypher scans fetched at most I also liked that the replacement is simpler than what it removes: the old shallow-copy-and-NULL-out dance became one allocator with a clear caller-frees contract. In an agent-reachable engine that is a memory-safety improvement in its own right, and the new SQL is a constant string with bound parameters. Your test is properly binding — 12 nodes, Neither failing check is yours. What is needed from you: a rebase. Your base predates #1173 and #1176, both merged on 30 July and both touching And one question that is the maintainer's, not yours. An unlabeled I want to be fair about this: the exposure is not new. One small thing: the PR body says the scan goes "through the store visitor", but the implementation is a new materialising store query. Reads like drift from an earlier iteration — worth a one-line correction so the next reviewer is not looking for a visitor. Rebase and I will pick this straight back up. |
Signed-off-by: imi <hoshinoimi@gmail.com>
cb9be33 to
64c5dda
Compare
|
Addressed the follow-up:
#1364 independently confirms this PR's early unlabeled-candidate cap. I documented its later roughly-100k pre- |
What does this PR do?
Fixes #1196.
Unlabeled Cypher queries previously capped candidate enumeration at the requested result limit before applying
WHERE. A valid match beyond that early candidate window could therefore disappear.This change materializes the complete relevant candidate set with an unbounded store query, applies filtering, and only then enforces the final query limit. It includes a reproduce-first regression test with the matching row beyond the result-limit boundary.
Issue #1364 independently exercises the same early unlabeled-scan cap with
RETURN DISTINCT type(r). Its separately observed cap above roughly 100k raw projected rows occurs later, beforeDISTINCT, and is not claimed as part of this fix.Verification
mainpreserves the checkedcross_join_nodesfailure path introduced by the newer bounds work.nix develop --command make -j8 -f Makefile.cbm test-focused TEST_SUITES=cyphercypher_exec_unlabeled_where_beyond_result_limit_issue1196andcypher_cross_join_alloc_rejects_overflow.Checklist
git commit -s) and follows the Contributor License Agreementmake -f Makefile.cbm test) — focused sanitized Cypher suite passedmake -f Makefile.cbm lint-ci) — not rerun for this rebase-only update