You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tidb-4.0 should not support invisible index syntax
1. Minimal reproduce step (Required)
drop table t_invisible_index;
create table t_invisible_index(a int, index idx_a(a));
alter table t_invisible_index alter index idx_a invisible;
2. What did you expect to see? (Required)
MySQL [test]> drop table if exists t_invisible_index
-> ;
Query OK, 0 rows affected (0.22 sec)
MySQL [test]> drop table if exists t_invisible_index;
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> create table t_invisible_index(a int, index idx_a(a));
Query OK, 0 rows affected (0.07 sec)
MySQL [test]> alter table t_invisible_index alter index idx_a invisible;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 41 near "index idx_a invisible"
3. What did you see instead (Required)
MySQL [test]> drop table t_invisible_index;
Query OK, 0 rows affected (0.19 sec)
MySQL [test]> create table t_invisible_index(a int, index idx_a(a));
Query OK, 0 rows affected (0.08 sec)
MySQL [test]> alter table t_invisible_index alter index idx_a invisible;
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> show create table t_invisible_index;
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| t_invisible_index | CREATE TABLE t_invisible_index ( a int(11) DEFAULT NULL,
KEY idx_a (a)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
Release Version: v4.0.5
Edition: Community
Git Commit Hash: 9c1c212
Git Branch: heads/refs/tags/v4.0.5
UTC Build Time: 2020-08-28 10:07:42
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
Hi @marsishandsome , this is actually expected because, for most syntaxes, we support it in the parser firstly to 'improve the compatibility'. You can see this issue: #11486 for more details.
Bug Report
tidb-4.0 should not support
invisible index
syntax1. Minimal reproduce step (Required)
drop table t_invisible_index;
create table t_invisible_index(a int, index idx_a(a));
alter table t_invisible_index alter index idx_a invisible;
2. What did you expect to see? (Required)
MySQL [test]> drop table if exists t_invisible_index
-> ;
Query OK, 0 rows affected (0.22 sec)
MySQL [test]> drop table if exists t_invisible_index;
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> create table t_invisible_index(a int, index idx_a(a));
Query OK, 0 rows affected (0.07 sec)
MySQL [test]> alter table t_invisible_index alter index idx_a invisible;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 41 near "index idx_a invisible"
3. What did you see instead (Required)
MySQL [test]> drop table t_invisible_index;
Query OK, 0 rows affected (0.19 sec)
MySQL [test]> create table t_invisible_index(a int, index idx_a(a));
Query OK, 0 rows affected (0.08 sec)
MySQL [test]> alter table t_invisible_index alter index idx_a invisible;
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> show create table t_invisible_index;
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| t_invisible_index | CREATE TABLE
t_invisible_index
(a
int(11) DEFAULT NULL,KEY
idx_a
(a
)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
Release Version: v4.0.5
Edition: Community
Git Commit Hash: 9c1c212
Git Branch: heads/refs/tags/v4.0.5
UTC Build Time: 2020-08-28 10:07:42
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: