mirror of
https://github.com/MariaDB/server.git
synced 2025-05-07 04:01:59 +03:00
Some of the test cases reference to binlog position and these position numbers are written into result explicitly. It is difficult to maintain if log event format changes. There are a couple of cases explicit position number appears, we handle them in different ways A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options Use --replace_result to mask them. B. 'SHOW BINLOG EVENT ...' Replaced by show_binlog_events.inc or wait_for_binlog_event.inc. show_binlog_events.inc file's function is enhanced by given $binlog_file and $binlog_limit. C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc' For the test cases just care a few items in the result of 'SHOW SLAVE STATUS', only the items related to each test case are showed. 'show_slave_status.inc' is rebuild, only the given items in $status_items will be showed. 'check_slave_is_running.inc' and 'check_slave_no_error.inc' and 'check_slave_param.inc' are auxiliary files helping to show running status and error information easily.
58 lines
2.3 KiB
Plaintext
58 lines
2.3 KiB
Plaintext
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;
|
|
insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000);
|
|
reset master;
|
|
set session debug="+d,sleep_alter_enable_indexes";
|
|
alter table t1 enable keys;;
|
|
insert into t2 values (1);
|
|
insert into t1 values (1, 1, 1);
|
|
set session debug="-d,sleep_alter_enable_indexes";
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # use `test`; insert into t2 values (1)
|
|
master-bin.000001 # Query # # use `test`; alter table t1 enable keys
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1)
|
|
drop tables t1, t2;
|
|
End of 5.0 tests
|
|
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 from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # use `test`; alter table t1 change i c char(10) default 'Test1'
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values ()
|
|
master-bin.000001 # Query # # use `test`; alter table t1 change c vc varchar(100) default 'Test2'
|
|
master-bin.000001 # Query # # use `test`; rename table t1 to t2
|
|
master-bin.000001 # Query # # use `test`; drop table t2
|
|
master-bin.000001 # Query # # use `test`; create table t1 (i int)
|
|
master-bin.000001 # Query # # use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2
|
|
master-bin.000001 # Query # # use `test`; insert into t2 values ()
|
|
master-bin.000001 # Query # # use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1
|
|
master-bin.000001 # Query # # use `test`; rename table t1 to t3
|
|
master-bin.000001 # Query # # use `test`; drop table t3
|
|
End of 5.1 tests
|