Repository navigation
fix(plan): preserve source defaults in view metadata - #26729
Merged
Merged
Conversation
# Conflicts: # pkg/sql/plan/build_ddl_test.go
XuPeng-SH
approved these changes
Aug 8, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
Reviewed at head dad9696 against main@629cbbe2fe51d6d457a31f450c7e5c1bc4628213. No actionable correctness, compatibility, lifecycle, or performance issues found. GitHub CI is green; focused planner and frontend YEAR tests passed.
1 task done
1 of 4 tasks
This branch was previously 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.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26232
What this PR does / why we need it:
genViewTableDefalready receives the authoritativeOutputColumnProvenanceintroduced for #26226, but it only consumed that provenance for ENUM/SET types and discarded source column defaults. As a result, a direct source column such asqty INT NOT NULL DEFAULT 7lost its persisted default in View metadata.This change:
plan.Default, including its typedExpr, in the existing planner-local provenance;7and instead uses an executable integer target default0where the MySQL behavior is independently covered;Validation:
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=15m ./pkg/sql/plan.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=15m -run 'TestIssue262(26|32)' ./pkg/tests/issues-racego buildandgo vetfor the affected packages with the repository CGo include contractThe embedded SQL regression independently checks View
DESC,information_schema.columns, andSHOW CREATE VIEW, then checks CTASDESC,information_schema.columns,SHOW CREATE TABLE, and an INSERT that omits the NOT NULL target column.