-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update the multi-schema change DDL limitation #10457
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. |
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
Co-authored-by: Aolin <[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
/remove-status LGT1 |
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.
rest LGTM
Co-authored-by: TomShawn <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 10e1fab
|
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.
add some comments, others LGTM
@@ -105,7 +105,7 @@ MySQL 系统变量 `optimizer_switch` 在 TiDB 中是只读的,对查询计划 | |||
|
|||
TiDB 中,所有支持的 DDL 变更操作都是在线执行的。与 MySQL 相比,TiDB 中的 DDL 存在以下限制: | |||
|
|||
* 不能在单条 `ALTER TABLE` 语句中完成多个操作。例如,不能在单个语句中添加多个列或索引,否则,可能会输出 `Unsupported multi schema change` 的错误。 | |||
* 使用 `ALTER TABLE` 语句修改一个表的多个模式对象(如列、索引)时,不允许在多个更改中指定同一个模式对象。例如,`ALTER TABLE t1 MODIFY COLUMN c1 INT, DROP COLUMN c1` 在两个更改中都指定了 `c1` 列,执行该语句会输出 `Unsupported operate same column/index` 的错误。 |
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.
- No Support TiDB-specific Multi-Schema Change like ADD TIFLASH REPLICA, ADD PARTITION, ALTER PARTITION, etc.
- the execution order of sub-ddl may be not fully compatible with MySQL.
@@ -154,7 +154,7 @@ Query OK, 0 rows affected, 1 warning (0.25 sec) | |||
|
|||
TiDB 中的 `ALTER TABLE` 语法主要存在以下限制: | |||
|
|||
- 不支持在单个 `ALTER TABLE` 语句中进行多个更改。 | |||
- 使用 `ALTER TABLE` 语句修改一个表的多个模式对象(如列、索引)时,不允许在多个更改中指定同一个模式对象。 |
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.
tidb check consistency with the schema before ddl. if some schema is added in the ddl, can't alter it.eg.
`ALTER TABLE ADD INDEX i(b), DROP INDEX i;
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?