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

set tidb_enable_ddl=false, but still can create table #41277

Closed
seiya-annie opened this issue Feb 10, 2023 · 0 comments · Fixed by #41298
Closed

set tidb_enable_ddl=false, but still can create table #41277

seiya-annie opened this issue Feb 10, 2023 · 0 comments · Fixed by #41298
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@seiya-annie
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> show config where name like '%ddl%';
+------+-------------------+-----------------------------+-------+
| Type | Instance          | Name                        | Value |
+------+-------------------+-----------------------------+-------+
| tidb | 172.16.5.101:4000 | instance.ddl_slow_threshold | 300   |
| tidb | 172.16.5.101:4000 | instance.tidb_enable_ddl    | true  |
+------+-------------------+-----------------------------+-------+
2 rows in set (0.02 sec)

mysql> set tidb_enable_ddl=false;
ERROR 8246 (HY000): Error happened when enable/disable DDL: can not disable ddl when there is only one instance
mysql> set tidb_enable_ddl=false;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------+
| Level   | Code | Message                                                                       |
+---------+------+-------------------------------------------------------------------------------+
| Warning | 8142 | modifying tidb_enable_ddl will require SET GLOBAL in a future version of TiDB |
+---------+------+-------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show config where name like '%ddl%';
+------+-------------------+-----------------------------+-------+
| Type | Instance          | Name                        | Value |
+------+-------------------+-----------------------------+-------+
| tidb | 172.16.5.101:4000 | instance.ddl_slow_threshold | 300   |
| tidb | 172.16.5.101:4000 | instance.tidb_enable_ddl    | false |
+------+-------------------+-----------------------------+-------+
2 rows in set (0.02 sec)

mysql> use test;
Database changed
mysql> create table t1(a int);
Query OK, 0 rows affected (1.09 sec)

2. What did you expect to see? (Required)

create table fail

3. What did you see instead (Required)

create table success

4. What is your TiDB version? (Required)

[tidb@101 ~]$ /home/tidb/deploy/tidb-4000/bin/tidb-server -V
Release Version: v6.5.0
Edition: Community
Git Commit Hash: 706c3fa
Git Branch: heads/refs/tags/v6.5.0
UTC Build Time: 2022-12-27 03:50:44
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
[tidb@101 ~]$

@seiya-annie seiya-annie added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra labels Feb 10, 2023
@CbcWestwolf CbcWestwolf self-assigned this Feb 10, 2023
blacktear23 pushed a commit to blacktear23/tidb that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants