2012-03-16 15:51:59 +00:00
|
|
|
#--source include/have_tokudb.inc
|
2012-10-03 17:32:22 +00:00
|
|
|
set default_storage_engine='tokudb';
|
2012-03-16 15:51:59 +00:00
|
|
|
|
|
|
|
--disable_warnings
|
2012-10-03 17:32:22 +00:00
|
|
|
drop table if exists foo;
|
2012-03-16 15:51:59 +00:00
|
|
|
--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_KEY
|
|
|
|
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;
|