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

tidb_enable_change_multi_schema needs documented since this message is visible to users #8787

Closed
yahonda opened this issue Jun 3, 2022 · 4 comments · Fixed by pingcap/docs-cn#9952
Assignees
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.

Comments

@yahonda
Copy link
Member

yahonda commented Jun 3, 2022

Change Request

  1. Describe what you find is inappropriate or missing in the existing docs.

tidb_enable_change_multi_schema needs documented since this message is visible to users. There was a similar request #7093 that was closed because this variable is not visible to users at that time.

Now pingcap/tidb#29526 has been merged, Users will get
ERROR 8200 (HY000): can't drop column c3 with tidb_enable_change_multi_schema is disable message.

Steps to reproduce

  • Run tiup playground
tiup playground
  • Drop indexed column
mysql --comments --host 127.0.0.1 --port 4000 -u root test
create table t(id int primary key, c1 int, c2 int, c3 int, index idx1(c1, c2), index idx2(c3));
alter table t drop column c3;
set global tidb_enable_change_multi_schema = on;
alter table t drop column c3;

Actual results

% mysql --comments --host 127.0.0.1 --port 4000 -u root test
... snip ...
mysql> create table t(id int primary key, c1 int, c2 int, c3 int, index idx1(c1, c2), index idx2(c3));
Query OK, 0 rows affected (0.10 sec)

mysql> alter table t drop column c3;
ERROR 8200 (HY000): can't drop column c3 with tidb_enable_change_multi_schema is disable
mysql> set global tidb_enable_change_multi_schema = on;
Query OK, 0 rows affected (0.03 sec)

mysql> alter table t drop column c3;
Query OK, 0 rows affected (0.30 sec)

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.0.0
Edition: Community
Git Commit Hash: 36a9810441ca0e496cbd22064af274b3be771081
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-31 10:27:25
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.01 sec)

mysql>
  1. Describe your suggestion or addition.
    tidb_enable_change_multi_schema needs documented since this message is visible to users and it is difficult for users to understand why this variables needs configured, MySQL can drop indexed column by default.

  2. Provide some reference materials (documents, websites, etc) if you could.

#7093
pingcap/tidb#29526

@shichun-0415
Copy link
Contributor

@yahonda Thanks for your feedback. @AilinKid Could you please take a look?

@shichun-0415 shichun-0415 added the area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. label Jun 6, 2022
@AilinKid
Copy link
Contributor

AilinKid commented Jun 6, 2022

actually tidb_enable_change_multi_schema is not for users, it's an internal switch because change_multi_schema hasn't been GA yet.

It's not recommended to use it in product environment, we will remove the switch once we GA it.

@yahonda
Copy link
Member Author

yahonda commented Jun 6, 2022

Sorry I do not agree with that. If this is not for users, This ERROR 8200 (HY000): can't drop column c3 with tidb_enable_change_multi_schema is disable message also needs reviewed / revised.

@tangenta
Copy link
Contributor

tangenta commented Jun 6, 2022

/assign

OK. Let me add the document of this variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants