Skip to content
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

Merged
merged 7 commits into from
Jul 27, 2022

Conversation

tangenta
Copy link
Contributor

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).

  • master (the latest development version)
  • v6.2 (TiDB 6.2 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 11, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Oreoxmt

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 11, 2022
@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 11, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 11, 2022
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Oreoxmt Oreoxmt added translation/doing This PR’s assignee is translating this PR. v6.2 This PR/issue applies to TiDB v6.2. labels Jul 11, 2022
@ti-chi-bot ti-chi-bot removed the missing-translation-status This PR does not have translation status info. label Jul 11, 2022
@Oreoxmt Oreoxmt self-assigned this Jul 11, 2022
@Oreoxmt Oreoxmt added the type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. label Jul 11, 2022
@Oreoxmt Oreoxmt requested review from TomShawn and Oreoxmt and removed request for shichun-0415 July 11, 2022 07:53
mysql-compatibility.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-alter-table.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Oreoxmt Oreoxmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 19, 2022
@Oreoxmt Oreoxmt removed the translation/doing This PR’s assignee is translating this PR. label Jul 20, 2022
@Oreoxmt Oreoxmt added the translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. label Jul 20, 2022
@shichun-0415 shichun-0415 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 20, 2022
@Oreoxmt Oreoxmt removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 21, 2022
@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Jul 21, 2022

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 21, 2022
@Oreoxmt Oreoxmt removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 21, 2022
@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 21, 2022
mysql-compatibility.md Outdated Show resolved Hide resolved
Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Jul 27, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 10e1fab

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 27, 2022
@ti-chi-bot ti-chi-bot merged commit 1397858 into pingcap:master Jul 27, 2022
Copy link

@seiya-annie seiya-annie left a 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` 的错误。
Copy link

@seiya-annie seiya-annie Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. No Support TiDB-specific Multi-Schema Change like ADD TIFLASH REPLICA, ADD PARTITION, ALTER PARTITION, etc.
  2. 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` 语句修改一个表的多个模式对象(如列、索引)时,不允许在多个更改中指定同一个模式对象

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v6.2 This PR/issue applies to TiDB v6.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants