fix(frontend): preserve params across prepared multi-SET - #26705
Draft
VioletQwQ-0 wants to merge 6 commits into
Draft
fix(frontend): preserve params across prepared multi-SET#26705VioletQwQ-0 wants to merge 6 commits into
VioletQwQ-0 wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Draft dependency: this PR is stacked on #26694 (
16c22842c93e2eca446c2ddab4ec58ba18180ea4). Its diff temporarily includes that PR because the dependency branch belongs to another fork. After #26694 merges, this branch will be rebased onto the latestmainand fully revalidated.What type of PR is this?
Which issue(s) this PR fixes:
issue #26685
What this PR does / why we need it:
Prepared multi-assignment
SETevaluated each RHS through a derivedSELECTin the session's sharedProcess. Cleanup after the first expression freed the outer prepared-parameter vector, so the next global parameter ordinal panicked. The recovered error also left the first session variable updated.Changes:
vector, binary flags, and ownership) while a derived query frees its own resources, then restore the outer owner on every return or panic path.SETbefore applying assignments, so expression and cleanup failures do not partially update variables. Ordinary non-preparedSETretains its sequential behavior.SETcontaining a system variable before any RHS evaluation or mutation; prepared single-system assignment remains supported. This fail-closed boundary prevents apply-time conversion or side-effect failures from leaving partial state.SETfrom one assignment tovar_assignment_list.Non-goals:
Validation:
16c22842c93e2eca446c2ddab4ec58ba18180ea4— the second parameter was unavailable after derived-query cleanup, while the first target variable had already changed.COM_STMT_PREPARE/EXECUTE, rebinding, NULL, RHS failure, mixed-target prevalidation, unchanged terminal state, connection reuse, and single-system compatibility.-race -count=100for Process ownership and Frontend prepared SET coverage.mo-service,test/distributed/cases/prepare/prepare_all.sql(378 success, 1 existing ignore, 0 failed/abnormal).make build, focusedgo vet, andgit diff --check.PASS review=PASS validation=PASSfor exact heade019869e93054c40c84b99bae7799e77f959a7f9.QA Decision