-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: fix rename index for expression indexes #51984
Conversation
Hi @ywqzzy. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions 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/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #51984 +/- ##
=================================================
- Coverage 70.7350% 57.0297% -13.7054%
=================================================
Files 1462 1687 +225
Lines 435268 666300 +231032
=================================================
+ Hits 307887 379989 +72102
- Misses 108112 261845 +153733
- Partials 19269 24466 +5197
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update this PR's title? This PR like to fix rename index for expression indexes.
[LGTM Timeline notifier]Timeline:
|
@ywqzzy: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions 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/test-infra repository. I understand the commands that are listed here. |
pkg/ddl/index.go
Outdated
func renameHiddenColumns(tblInfo *model.TableInfo, from, to model.CIStr) { | ||
for _, col := range tblInfo.Columns { | ||
if getExpressionIndexOriginName(col) == from.O { | ||
col.Name.L = strings.Replace(col.Name.L, from.L, to.L, 1) | ||
col.Name.O = strings.Replace(col.Name.O, from.O, to.O, 1) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Column.Hidden
to filter hidden columns, otherwise it may cause unexpected behavior if there is a column name contains only one char like _
, V
or $
.
/hold |
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, tangenta, zimulala The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@ywqzzy: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions 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/test-infra repository. |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
/cherry-pick release-6.5 |
@lance6716: new pull request created to branch In response to this:
Instructions 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #51431
Problem Summary:
Rename the virtual generated column when rename idx.
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.