-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: improve compatibility for ALTER TABLE algorithms #19270
Conversation
@ti-srebot /run-unit-test |
/run-unit-test |
A kind remind: please add the name of the submodule in your PR title, more details can be found here: https://github.com/pingcap/community/blob/master/contributors/commit-message-pr-style.md#pull-request-title-style I've changed the title BTW. |
Co-authored-by: bb7133 <[email protected]>
Co-authored-by: djshow832 <[email protected]>
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
LGTM |
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
/merge |
/run-all-tests |
@xhebox merge failed. |
/run-common-test |
@ti-srebot /run-check_dev_2 |
/run-check_dev_2 |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #19364 |
* cherry pick #19270 to release-4.0 Signed-off-by: ti-srebot <[email protected]> * fix conflict Co-authored-by: xhe <[email protected]> Co-authored-by: bb7133 <[email protected]>
What problem does this PR solve?
Issue Number: close #19162
ALGORITHM=x means "this or better", whereby
INSTANT > INPLACE > COPY
. As long the definition ofsupported
field follows this order, the loop will always choose the best algorithm.The comparison works due to how types are defined in the parser. Its definition follows the order
default < copy < inplace < instant
.So this loop means that if there is an equal or better algorithm, it is chosen. Maybe I should have a
LessOrEqual
method on this type, and not to rely on the enum definition.If the chosen algorithm is not same as the specified one, an error is returned for TiDB to report the warning. So an error may come from the better algorithm choosing strategy, which is actually a successful case.
As a result, the fail case, no matching algorithm is identified by
AlgorithmTypeDefault
and an error.Check List
Tests
Release note