2007-01-19 21:15:59 +01:00
|
|
|
drop table if exists t1, t2;
|
|
|
|
create table t1 (n1 int, n2 int, n3 int,
|
|
|
|
key (n1, n2, n3),
|
|
|
|
key (n2, n3, n1),
|
|
|
|
key (n3, n1, n2));
|
|
|
|
create table t2 (i int);
|
|
|
|
alter table t1 disable keys;
|
2007-05-19 08:49:56 +02:00
|
|
|
insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000);
|
2007-01-19 21:15:59 +01:00
|
|
|
reset master;
|
2007-05-19 08:49:56 +02:00
|
|
|
set session debug="+d,sleep_alter_enable_indexes";
|
2007-01-19 21:15:59 +01:00
|
|
|
alter table t1 enable keys;;
|
|
|
|
insert into t2 values (1);
|
|
|
|
insert into t1 values (1, 1, 1);
|
2007-05-19 08:49:56 +02:00
|
|
|
set session debug="-d,sleep_alter_enable_indexes";
|
|
|
|
show binlog events in 'master-bin.000001' from 106;
|
2007-01-19 21:15:59 +01:00
|
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
|
|
master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
|
|
|
|
master-bin.000001 # Query 1 # use `test`; alter table t1 enable keys
|
|
|
|
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1, 1, 1)
|
|
|
|
drop tables t1, t2;
|
|
|
|
End of 5.0 tests
|
2007-05-19 08:49:56 +02:00
|
|
|
drop table if exists t1, t2, t3;
|
|
|
|
create table t1 (i int);
|
|
|
|
reset master;
|
|
|
|
set session debug="+d,sleep_alter_before_main_binlog";
|
|
|
|
alter table t1 change i c char(10) default 'Test1';;
|
|
|
|
insert into t1 values ();
|
|
|
|
select * from t1;
|
|
|
|
c
|
|
|
|
Test1
|
|
|
|
alter table t1 change c vc varchar(100) default 'Test2';;
|
|
|
|
rename table t1 to t2;
|
|
|
|
drop table t2;
|
|
|
|
create table t1 (i int);
|
|
|
|
alter table t1 change i c char(10) default 'Test3', rename to t2;;
|
|
|
|
insert into t2 values ();
|
|
|
|
select * from t2;
|
|
|
|
c
|
|
|
|
Test3
|
|
|
|
alter table t2 change c vc varchar(100) default 'Test2', rename to t1;;
|
|
|
|
rename table t1 to t3;
|
|
|
|
drop table t3;
|
|
|
|
set session debug="-d,sleep_alter_before_main_binlog";
|
|
|
|
show binlog events in 'master-bin.000001' from 106;
|
|
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
|
|
master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test1'
|
|
|
|
master-bin.000001 # Query 1 # use `test`; insert into t1 values ()
|
|
|
|
master-bin.000001 # Query 1 # use `test`; alter table t1 change c vc varchar(100) default 'Test2'
|
|
|
|
master-bin.000001 # Query 1 # use `test`; rename table t1 to t2
|
|
|
|
master-bin.000001 # Query 1 # use `test`; drop table t2
|
|
|
|
master-bin.000001 # Query 1 # use `test`; create table t1 (i int)
|
|
|
|
master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2
|
|
|
|
master-bin.000001 # Query 1 # use `test`; insert into t2 values ()
|
|
|
|
master-bin.000001 # Query 1 # use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1
|
|
|
|
master-bin.000001 # Query 1 # use `test`; rename table t1 to t3
|
|
|
|
master-bin.000001 # Query 1 # use `test`; drop table t3
|
|
|
|
End of 5.1 tests
|