mirror of
https://github.com/MariaDB/server.git
synced 2025-01-24 07:44:22 +01:00
33 lines
693 B
Text
33 lines
693 B
Text
# test that add index keeps cardinality for older indexes
|
|
|
|
source include/have_tokudb.inc;
|
|
|
|
disable_warnings;
|
|
drop table if exists tt;
|
|
enable_warnings;
|
|
|
|
create table tt (a int, b int, c int, primary key(a));
|
|
insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
|
|
|
|
# test that analyze computes the correct cardinality for the PK
|
|
show indexes from tt;
|
|
analyze table tt;
|
|
show indexes from tt;
|
|
|
|
# add a key(b)
|
|
alter table tt add key (b);
|
|
show indexes from tt;
|
|
analyze table tt;
|
|
show indexes from tt;
|
|
|
|
# add a key(c)
|
|
alter table tt add key (c);
|
|
show indexes from tt;
|
|
analyze table tt;
|
|
show indexes from tt;
|
|
|
|
# test that cardinality is persistent
|
|
flush tables;
|
|
show indexes from tt;
|
|
|
|
drop table tt;
|