rpl_stm_until.result 3.07 KB
Newer Older
1 2 3 4 5 6
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
7
[on slave]
8
include/stop_slave.inc
9 10
==== Create some events on master ====
[on master]
11 12 13 14 15 16 17
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
18 19
==== Replicate one event at a time on slave ====
[on slave]
20
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
21 22 23 24 25 26
select * from t1;
n
1
2
3
4
27
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
28 29 30 31 32 33
select * from t1;
n
1
2
3
4
34
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
35 36 37 38 39
select * from t2;
n
1
2
start slave;
40 41
[on master]
[on slave]
42
include/stop_slave.inc
43
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
44
==== Test various error conditions ====
45
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
46
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
47
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS;
48
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
49
start slave until master_log_file='master-bin.000001';
50
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
51
start slave until relay_log_file='slave-relay-bin.000002';
52
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
53
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS;
54
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
55
start slave sql_thread;
56
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
57
Warnings:
unknown's avatar
unknown committed
58
Note	1254	Slave is already running
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
include/stop_slave.inc
drop table if exists t1;
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
drop table if exists t1;
reset master;
create table t1 (a int primary key auto_increment);
start slave;
include/stop_slave.inc
master and slave are in sync now
select 0 as zero;
zero
0
insert into t1 set a=null;
insert into t1 set a=null;
select count(*) as two from t1;
two
2
77
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos= UNTIL_POS;;
78 79 80 81 82 83 84 85 86
slave stopped at the prescribed position
select 0 as zero;
zero
0
select count(*) as one from t1;
one
1
drop table t1;
start slave;
87
stop slave;
Andrei Elkin's avatar
Andrei Elkin committed
88 89 90 91 92
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
93 94 95 96
drop table if exists t1;
Warnings:
Note	1051	Unknown table 't1'
flush logs;
Andrei Elkin's avatar
Andrei Elkin committed
97
stop slave;
98 99 100 101 102 103 104 105 106
reset slave;
start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */;
show tables /* t1 must exist */;
Tables_in_test
t1
drop table t1;
stop slave;
reset slave;
reset master;