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-4.0 should not support invisible index syntax #20486

Closed
marsishandsome opened this issue Oct 16, 2020 · 2 comments
Closed

tidb-4.0 should not support invisible index syntax #20486

marsishandsome opened this issue Oct 16, 2020 · 2 comments
Labels
sig/sql-infra SIG: SQL Infra

Comments

@marsishandsome
Copy link
Contributor

marsishandsome commented Oct 16, 2020

Bug Report

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

@marsishandsome marsishandsome added the type/bug The issue is confirmed as a bug. label Oct 16, 2020
@lhy1024
Copy link

lhy1024 commented Oct 16, 2020

/label sig/execution

@ti-srebot ti-srebot added the sig/execution SIG execution label Oct 16, 2020
@bb7133
Copy link
Member

bb7133 commented Oct 16, 2020

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.

@bb7133 bb7133 added sig/sql-infra SIG: SQL Infra and removed sig/execution SIG execution labels Oct 16, 2020
@wjhuang2016 wjhuang2016 removed the type/bug The issue is confirmed as a bug. label Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra
Projects
None yet
Development

No branches or pull requests

5 participants