[release-8.5] ddl: Fix default value filling with finer granularity (#10682)#10914
Conversation
close pingcap#10680 ddl: Fix default value filling with finer granularity - Tightens addDefaultValueToColumnIfPossible - For NOT NULL missing columns, force_decode=false now returns false unless there is an origin default. - This forces a schema sync instead of silently filling 0. - force_decode=true still fills a default value (best-effort). Signed-off-by: JaySon-Huang <tshent@qq.com> (cherry picked from commit 01b12dd)
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds origin-default detection, tightens missing-column decoding in ChangesNOT NULL column default-fill policy
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@dbms/src/Storages/KVStore/tests/gtest_region_block_reader.cpp`:
- Around line 822-846: Fix the typos in the comment above the createColumn call
within the ASSERT_COLUMN_EQ macro. Change "thrid elem" to "third elem" and "wih"
to "with" in the comment that reads "the thrid elem is filled wih
origin_default".
- Around line 802-820: In the comment within the test block for
table_info_c1_not_null_with_origin_default, fix the spelling error where "thrid
elem" should be corrected to "third elem". This typo appears in the comment
above the ASSERT_COLUMN_EQ call that verifies the default value is filled
correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bcd2c5a0-a404-4aa0-83f8-935e798a2e10
📒 Files selected for processing (8)
dbms/src/Storages/KVStore/Decode/RegionBlockReader.cppdbms/src/Storages/KVStore/tests/gtest_region_block_reader.cppdbms/src/TiDB/Decode/RowCodec.cppdbms/src/TiDB/Schema/TiDB.cppdbms/src/TiDB/Schema/TiDB.hdbms/src/TiDB/Schema/tests/gtest_table_info.cppdbms/src/TiDB/tests/RowCodecTestUtils.htests/fullstack-test2/ddl/alter_column_nullable.test
|
/test pull-unit-test |
|
/test pull-unit-test |
|
/test pull-integration-test |
|
@3pointer: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/test pull-unit-test |
What changed
Cherry-pick #10682 to release-8.5-20260622-v8.5.4.
This backports the default value filling fix so missing NOT NULL columns without origin default trigger schema sync instead of silently filling zero, keeping TiFlash results consistent with TiKV after altering a column from NOT NULL to NULL.
Notes
-x -m 1.RowCodec.cppandgtest_table_info.cpp.Checks
Release note
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests