summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test')
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test b/storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test
new file mode 100644
index 00000000000..c2720a42edd
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/card_drop_pk.test
@@ -0,0 +1,25 @@
+# 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, 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 a
+alter table tt drop primary key;
+show indexes from tt;
+
+# test that cardinality is persistent
+flush tables;
+show indexes from tt;
+
+drop table tt;