-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t0(a int auto_increment, unique key (a) invisible);
show create table t0;
CREATE TABLE `t1` ( `a` int(11) NOT NULL AUTO_INCREMENT, UNIQUE KEY `a` (`a`) /*!80000 INVISIBLE */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;2. What did you expect to see? (Required)
mysql> create table t0(a int auto_increment, unique key (a) invisible);
ERROR 3522 (HY000): A primary key index cannot be invisiblethe sql of create table t0 should have same behavior with show create table result.
3. What did you see instead (Required)
MySQL root@127.0.0.1:test> create table t0(a int auto_increment, unique key (a) invisible);
-> show create table t0;
-> CREATE TABLE `t1` ( `a` int(11) NOT NULL AUTO_INCREMENT, UNIQUE KEY `a` (`a`) /*!80000 INVISIBLE */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
Query OK, 0 rows affected
Time: 0.145s
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t0 | CREATE TABLE `t0` (\n `a` int(11) NOT NULL AUTO_INCREMENT,\n UNIQUE KEY `a` (`a`) /*!80000 INVISIBLE */\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set
Time: 0.010s
(3522, 'A primary key index cannot be invisible')4. What is your TiDB version? (Required)
master( 6ebfe8a)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.