Repository navigation
fix(#9247,#9248,#9249): SQL plan cache parameter numbers, $N on records, $matched in subqueries - #9251
Conversation
…read on records, $matched visible in nested statements - #9247: the printed statement used as plan-cache key now carries the parameter numbers when they are not 0..n-1 (script statements, named parameters bound by position) - #9248: BaseExpression.execute(Identifiable) resolves Postgres $N like the Result overload (CREATE EDGE SET, function arguments on records, MATCH filters after a hop) - #9249: MATCH matchedDependencies walks nested statements; IN subquery runs with the enclosing context as parent
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 14 |
🟢 Coverage 96.43% diff coverage · -5.77% coverage variation
Metric Results Coverage variation ✅ -5.77% coverage variation Diff coverage ✅ 96.43% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (9fbef12) 212641 180988 85.11% Head commit (77d044c) 245272 (+32631) 194604 (+13616) 79.34% (-5.77%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#9251) 28 27 96.43% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (9)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review of #9251 (fixes #9247, #9248, #9249)Overall this is a well-scoped fix. Each issue has its own regression test, and the change reuses existing pieces ( What looks good
Points to check
Minor / style
No blocking issues found. I would address point 3 (a DML-in-script test) and point 4 (confirm the pre-existing failure) before merging. |
…ent key invariant
Review of #9251Well-scoped fix, and each of the three issues has a regression test. I read the diff and the surrounding code but did not run the tests. Findings below, none blocking. What looks good
Points to consider
Security and performanceNo security concerns. The extra walks happen at planning time on plan-cache misses, with no new per-row cost. |
…it and row assertions
ReviewOverall this is a focused set of fixes and each bug has a regression test. I found no blocking issues, only some small points. What looks good
Points to address
Nothing else stood out for security or performance. Once the style nit and the item 2 clarification are addressed, this looks good to merge. |
… note bare $matched
ReviewOverall this is a solid, well-targeted fix. I read the main-source diff in full and skimmed the tests. I did not build or run anything. What looks good
Points to consider
Security and performance
No blockers from my side. Items 1 and 3 are the ones I'd most like to see covered by a test before merge. |
…che-key assertions, drop issue-number comments
Review of #9251Solid, well-scoped fix for three related bugs. The regression tests cover the failing scenarios (the PR notes they fail before and pass after). I found no blocking problems; the notes below are small suggestions and questions. What looks good
Points to consider
Tests
No security concerns: the suffix is built only from integer parameter numbers, never from user-supplied text. 🤖 Generated with Claude Code |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9251 +/- ##
============================================
+ Coverage 76.88% 76.89% +0.01%
Complexity 3914 3914
============================================
Files 2125 2125
Lines 212641 212668 +27
Branches 45156 45164 +8
============================================
+ Hits 163479 163522 +43
+ Misses 31690 31674 -16
Partials 17472 17472 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #9247
Fixes #9248
Fixes #9249
?takes the cached plan of another statement that prints the same and reads that statement's parameter position, so two SELECTs in one script return the first one's rows #9247: plan-cache key (printed statement) now carries the parameter numbers when they differ from 0..n-1, so script statements and named parameters bound by position no longer share a plan. This also covers the DML source key for Since #9218, an UPDATE or DELETE with positional parameters reuses the cached plan of an earlier statement with the same WHERE and reads the WHERE from the wrong parameter: the UPDATE changes another record, the DELETE deletes nothing #9245 where numbering differs.$1parameter is read as null in CREATE EDGE ... SET, in a function argument evaluated on a record, and in a MATCH filter after a hop, so the edge gets a null property and the query returns other rows than with?#9248:BaseExpression.execute(Identifiable, ...)resolves$Nwith the same test as theResultoverload.where:that reads$matchedonly inside a subquery sees it as null, so a second pattern returns no rows, and an IN subquery on a node after a hop never matches #9249:matchedDependenciesalso sees a$matchedinside a nested statement;InConditionsubquery runs with the enclosing context as parent.Tests: Issue9247ScriptPositionalPlanCacheTest, Issue9248DollarParameterTest, Issue9249MatchedInSubqueryTest (fail before, pass after). Ran query.sql packages (3700 tests; only InScalarPropertyNotConvertedTest.subqueryAndReexecutedStatementDoNotLeakTheMemo fails, same on main) and postgresw (507).
Summary by CodeRabbit
$Nparameters in edge creation, filters, projections, and other expressions.MATCHfilters that reference matched values inside subqueries.INsubquery execution when it depends on the surrounding query context.