-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 the issue that "rename column" fails when changing column type concurrently #32993
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/6e4dd2ddc05b116739da40e72716c02f13d5d833 |
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
PTAL @tangenta |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 124b0b3
|
/run-unit-test |
/run-unit-test |
2 similar comments
/run-unit-test |
/run-unit-test |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.1 in PR #33034 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.2 in PR #33035 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.3 in PR #33036 |
What problem does this PR solve?
Issue Number: close #31075
Problem Summary:
In session 1:
alter table t change column b b double;
(DDL1)In session 2:
alter table t rename column b to c;
(DDL2)Decode the ModifyColumn's args:
job.DecodeArgs(&jobParam.newCol, &jobParam.oldColName, jobParam.pos, &jobParam.modifyColumnTp, &jobParam.updatedAutoRandomBits, &jobParam.changingCol, &jobParam.changingIdxs)
The rename column uses the ModifyColumn job. But the rename column uses 4 args.
After running DDL1, we do DDL2 need to change column type with data. So we will add
changingCol
andchangingIdxs
to args but notupdatedAutoRandomBits
. So it will return an error.What is changed and how it works?
Add
updatedAutoRandomBits
to the rename column operation.Check List
Tests
Side effects
Documentation
Release note