Repository navigation
fix(frontend): support prepared SET statements - #26096
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head f154b46. The prepared SET path is functionally closed across parameter discovery/order, nested scalar-subquery metadata, prepared-context propagation through initial and retry planning, AST-only cache bypass, result rebinding, and retained-plan/AST immutability. I also traced cleanup/retry ownership and did not find a blocking correctness or lifecycle issue.
Verified locally on the exact head: full pkg/sql/plan and pkg/frontend tests, focused prepared-SET/planner tests under -race, and git diff --check all pass. The two red CI jobs are not attributable to this diff: Iceberg failed during external module download with HTTP 502, and Ubuntu UT failed only in the unrelated TAE TestCkpLeak checkpoint timeout.
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? |
Merge Queue Status
This pull request spent 2 hours 57 minutes 23 seconds in the queue, including 34 minutes 10 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #25996
What this PR does / why we need it:
Prepared SET was rejected because the DCL carrier did not retain ordered parameter metadata and SET expression evaluation lost prepared context when it synthesized internal SELECT statements.
This change collects parameters and schemas from retained SET expressions plus transient scalar-subquery plans, preserves global parser ordinals across multiple assignments, explicitly propagates prepared mode through initial and retry planning, bypasses invalid empty-SQL plan-cache keys for SET-derived AST inputs, and preserves decimal result binding. Supplemental aggregate/window traversal is idempotent with the generic visitor work in #26042 and #26094.
The saved prepared AST and DCL plan remain immutable during EXECUTE. Text and binary repeated execution, multiple markers, NULL replacement, scalar/nested subqueries, aggregate/window fields, decimal expressions, cache isolation, and retry rebuilding are covered.
Tested with:
./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s ./pkg/sql/plan ./pkg/frontend./.agents/skills/mo-dev/scripts/mo-cgo-test -race -run "TestPreparedSet|TestSetExpression|TestPreparedSetExpression" -count=1 -timeout=240s ./pkg/frontendConfigured
go buildandgo vetpassed for planner/frontend. The distributed SQL fixture is included for CI; localmo-testerwas unavailable.