Conversation
Signed-off-by: 付典 <fudianchn@gmail.com>
fudianchn
marked this pull request as ready for review
October 2, 2026 07:25
This branch has not been deployed
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.


AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me.
What
Allow comma-separated tuple assignments after existing assignments in the shared SET-list grammar. Preserve scalar, tuple and subquery assignment ASTs and both output paths.
Why
UPDATE t SET a = 1, (b, c) = (2, 3)fails at the comma on upstream master. The same grammar also accepts a tuple following another assignment without a comma. PostgreSQL's UPDATE syntax defines scalar and tuple assignments as alternatives in one comma-separated list.How
Root cause
The repeated scalar alternative includes the comma, but the repeated tuple alternative does not. This rejects a non-first tuple when its separator is present and accepts it when the separator is missing.
Testing
bb55bb9d, 43 fail and 26 normal controls pass; the fix passes all 69. The failures cover 40 non-first tuple cases across eight entrypoints, a correlated subquery with following WHERE/RETURNING, and two invalid missing-comma inputs. Guards cover scalar-only, single/first tuple assignments, trailing commas and duplicate commas.Behavior notes
a = 1, (b, c) = (2, 3)produces two UpdateSet entries.Verification of the original issue
No existing issue is linked. The failure was reproduced on upstream master
bb55bb9de8377de9880b14e4fe3b3cc94bf63498; the locally verified fixed commit isaf426e07110fa252d0ee34c23c54b071362d9eb2.Both now parse and preserve the separate scalar/tuple assignments through both output paths and reparsing.
UPDATE t SET a = 1 (b, c) = (2, 3)is rejected.