Repository navigation
fix(plan): preserve prepared aggregate parameters - #26042
mergify[bot] merged 6 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
No findings. The latest update consistently applies the offset-aware key to GROUP BY producers and consumers and covers alias/ordinal reuse, resolving the prior review. Focused tests could not start because local CGo artifacts are absent; static review, formatting, and diff checks were clean.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed on the latest head. No blocking issues found.\n\nVerified correctness: parameter identity is opt-in and does not change default SQL rendering; aggregate/GROUP BY producers and consumers use the same identity key; aliases and ordinals still reuse the grouped expression; internal parameter offsets do not leak into display names; prepared-plan discovery/reset now reaches AggList and GroupBy.\n\nVerified performance/risk: the extra formatting is bind-time only and bounded by AST size; no new goroutines, waits, external resources, or unbounded state were introduced. The latest main merge-tree is conflict-free.\n\nLocal validation passed: build and vet for pkg/sql/parsers/tree and pkg/sql/plan; full tests for both packages; focused new regression tests under -race, 10 runs.
Merge Queue Status
This pull request spent 1 hour 26 seconds in the queue, including 1 hour 7 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #26020
issue #25992
What this PR does / why we need it:
Prepared aggregate and GROUP BY parameters were broken at two independent planner seams.
VisitPlanskippedNode.AggListandNode.GroupBy, so parameter discovery and reset/fill rules never reached markers stored there. In addition, binder expression-equivalence maps used normal SQL formatting, where every marker is rendered as?; distinct parser offsets therefore collided and could reuse the wrong bound expression.This change visits aggregate/group expressions and adds an opt-in offset-aware key for planner-internal expression identity. Default SQL formatting remains unchanged, and the internal offsets are stripped before names enter the user-visible plan/EXPLAIN path.
The aggregate result-type propagation in #26019 and dynamic window-frame parameters in #25993 are separate design changes and are not included here.
Test
pkg/sql/parsers/treeandpkg/sql/plantest packages-racerungo build -mod=readonlyandgo vet -mod=readonlyfor both changed packagesgit diff --check