ddl: fix alter index visibility suffix collision#70056
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @idle-lab. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesIndex visibility behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
What problem does this PR solve?
Issue Number: close #70049
Problem Summary:
ALTER TABLE ... ALTER INDEX ... VISIBLE/INVISIBLEcould incorrectly change the visibility of other indexes whose names shared the same underscore-delimited prefix. For example, alteringidx_kalso affectedidx_k_copy, because normal indexes were incorrectly treated as temporary indexes created during a column change.What changed and how does it work?
The visibility update now matches an index by its original name only when it is an actual temporary changing index. It checks both
IsChanging()andisTempIndex()before comparing the original index name.Regression tests cover:
INVISIBLE.VISIBLE.idx_k_1andidx_k_copy.These similarly named indexes now retain their original visibility
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit