1set default_storage_engine='tokudb';
2drop table if exists tt;
3create table tt (a int, b int, c int, d int, key(a), key(b), key(c));
4insert into tt values (0,0,0,0),(1,0,0,0),(2,0,1,0),(3,0,1,0);
5show indexes from tt;
6Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
7tt	1	a	1	a	A	4	NULL	NULL	YES	BTREE
8tt	1	b	1	b	A	4	NULL	NULL	YES	BTREE
9tt	1	c	1	c	A	4	NULL	NULL	YES	BTREE
10analyze table tt;
11Table	Op	Msg_type	Msg_text
12test.tt	analyze	status	OK
13show indexes from tt;
14Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
15tt	1	a	1	a	A	4	NULL	NULL	YES	BTREE
16tt	1	b	1	b	A	2	NULL	NULL	YES	BTREE
17tt	1	c	1	c	A	4	NULL	NULL	YES	BTREE
18alter table tt drop key b, add key (d);
19show indexes from tt;
20Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
21tt	1	a	1	a	A	4	NULL	NULL	YES	BTREE
22tt	1	c	1	c	A	4	NULL	NULL	YES	BTREE
23tt	1	d	1	d	A	4	NULL	NULL	YES	BTREE
24analyze table tt;
25Table	Op	Msg_type	Msg_text
26test.tt	analyze	status	OK
27show indexes from tt;
28Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
29tt	1	a	1	a	A	4	NULL	NULL	YES	BTREE
30tt	1	c	1	c	A	4	NULL	NULL	YES	BTREE
31tt	1	d	1	d	A	2	NULL	NULL	YES	BTREE
32flush tables;
33show indexes from tt;
34Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
35tt	1	a	1	a	A	4	NULL	NULL	YES	BTREE
36tt	1	c	1	c	A	4	NULL	NULL	YES	BTREE
37tt	1	d	1	d	A	2	NULL	NULL	YES	BTREE
38drop table tt;
39