--source include/have_innodb.inc
|
|
drop table if exists t1;
|
create table t1(a int,b int,c int)engine=innodb;
|
drop procedure if exists p1;
|
--delimiter $
|
create procedure p1()
|
begin
|
declare n int default 100;
|
declare continue handler for sqlexception begin end;
|
repeat
|
set n= n-1;
|
if rand()>0.5 then alter ignore table t1 add unique key a(a); end if;
|
if rand()>0.5 then alter ignore table t1 add key b(b); end if;
|
if rand()>0.5 then alter ignore table t1 add unique key ba(b,a); end if;
|
if rand()>0.5 then alter ignore table t1 add key cba(c,b,a); end if;
|
if rand()>0.5 then alter ignore table t1 add key abc(a,b,c); end if;
|
if rand()>0.5 then alter ignore table t1 add key cb(c,b); end if;
|
if rand()>0.5 then alter ignore table t1 drop key a; end if;
|
if rand()>0.5 then alter ignore table t1 drop key b; end if;
|
if rand()>0.5 then alter ignore table t1 drop key ba; end if;
|
if rand()>0.5 then alter ignore table t1 drop key cba; end if;
|
if rand()>0.5 then alter ignore table t1 drop key abc; end if;
|
if rand()>0.5 then alter ignore table t1 drop key cb; end if;
|
if rand()>0.5 then show table status like 't1'; end if;
|
until n=0 end repeat;
|
end $
|
|
--delimiter ;
|
|
--send
|
call p1();
|
|
--connect (con1,localhost,root,,)
|
call p1();
|
--disconnect con1
|
--connection default
|
--reap
|
drop procedure p1;
|
drop table t1;
|