diff options
Diffstat (limited to 'storage/tokudb/mysql-test/tokudb_alter_table/t/ai_di.test')
-rw-r--r-- | storage/tokudb/mysql-test/tokudb_alter_table/t/ai_di.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/ai_di.test b/storage/tokudb/mysql-test/tokudb_alter_table/t/ai_di.test new file mode 100644 index 00000000000..532dadd4438 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/ai_di.test @@ -0,0 +1,38 @@ +#--source include/have_tokudb.inc +set default_storage_engine='tokudb'; + +--disable_warnings +drop table if exists foo; +--enable_warnings + +set session tokudb_disable_slow_alter=ON; + +create table foo (a int, b int, c int, key(a))engine=TokuDB; + +insert into foo values (1,10,100),(2,20,200),(3,30,300),(3,30,300); + +select * from foo; +explain select sum(a) from foo; +select sum(a) from foo; + +--error ER_DUP_ENTRY +alter table foo add unique index b(b), drop index a; + +select * from foo; +explain select sum(a) from foo; +select sum(a) from foo; + +--echo #test that we can still add an index named 'b' +alter table foo add index b(b); +explain select sum(b) from foo; +select sum(b) from foo; + +set autocommit=0; +drop index b on foo; +create index b on foo (b); +explain select sum(b) from foo; +select sum(b) from foo; +set autocommit=1; + + +drop table foo; |