1
DROP TABLE IF EXISTS t1;
2
create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
4
insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
5
create index c on t1(c);
7
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
8
t1 0 PRIMARY 1 a A 3 NULL NULL BTREE
9
t1 1 b 1 b A 3 NULL NULL YES BTREE
10
t1 1 c 1 c A 3 NULL NULL YES BTREE
11
select * from t1 where c = 'two';
14
alter table t1 drop index c;
16
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
17
t1 0 PRIMARY 1 a A 3 NULL NULL BTREE
18
t1 1 b 1 b A 3 NULL NULL YES BTREE
19
select * from t1 where c = 'two';
23
create table t3 (a int primary key) engine=ndbcluster;
25
insert into t3 values (1);
26
alter table t3 rename t4;
29
ERROR 42S02: Table 'test.t3' doesn't exist