fix(plan): fallback UPDATE generated-column correctness (follow-up #24536)#24600
Open
ck89119 wants to merge 2 commits into
Open
fix(plan): fallback UPDATE generated-column correctness (follow-up #24536)#24600ck89119 wants to merge 2 commits into
ck89119 wants to merge 2 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? |
aunjgr
approved these changes
May 26, 2026
Contributor
aunjgr
left a comment
There was a problem hiding this comment.
No blocking issues found.
The fallback UPDATE planner change keeps generated-column projections contiguous after rewrite and now recomputes them from the rewritten source expressions, so DEFAULT / ON UPDATE / chained generated-column cases stay correct. The new planner tests cover the risky cases.
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #23137
What this PR does / why we need it:
Follow-up correctness fixes for PostgreSQL-style
UPDATE ... SET ... FROM ... WHEREfallback planning, completing #24536 (already merged tomain).These two fixes were added during review of the 4.0-dev backport (#24562) but were missing on
main:892d892b3): generated-column recompute expressions are inserted into the current target table's contiguous update segment instead of being appended after all targets, so later targets in a multi-target fallbackUPDATEno longer read/write wrong projection positions.988c01bbb): the fallback generated-column recompute now runs afterrewriteUpdateQueryLastNode(), soDEFAULT/ON UPDATErewrites are visible before generated expressions are derived; the generated-column lookup is mutable so generated-on-generated chains use freshly recomputed earlier expressions.Added planner coverage for the multi-target fallback + generated-column case, and for fallback generated columns over
DEFAULT,ON UPDATE, and generated-on-generated chains.