summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/card_drop_index.test
blob: b8e7d575dbdff8d892ad5a52224f0d321437b621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# test that add index keeps cardinality for older indexes

source include/have_tokudb.inc;
set default_storage_engine='tokudb';

disable_warnings;
drop table if exists tt;
enable_warnings;

create table tt (a int, b int, c int, key(b), key(c), primary key(a));
insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);

# compute cardinality
show indexes from tt;
analyze table tt;
show indexes from tt;

# drop key b
alter table tt drop key b;
show indexes from tt;

# drop key c
alter table tt drop key c;
show indexes from tt;

# test that cardinality is persistent
flush tables;
show indexes from tt;

drop table tt;