1
source include/master-slave.inc;
2
source include/have_innodb.inc;
3
source include/have_binlog_format_statement.inc;
6
DROP DATABASE IF EXISTS db1;
13
CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB;
14
CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM;
16
sync_slave_with_master;
17
source include/stop_slave.inc;
22
CREATE PROCEDURE db1.p1 ()
24
INSERT INTO t1 VALUES (1);
25
INSERT INTO t1 VALUES (2);
26
INSERT INTO t1 VALUES (3);
27
INSERT INTO t1 VALUES (4);
28
INSERT INTO t1 VALUES (5);
31
CREATE PROCEDURE db1.p2 ()
33
INSERT INTO t1 VALUES (6);
34
INSERT INTO t1 VALUES (7);
35
INSERT INTO t1 VALUES (8);
36
INSERT INTO t1 VALUES (9);
37
INSERT INTO t1 VALUES (10);
38
INSERT INTO t2 VALUES ('executed db1.p2()');
42
INSERT INTO db1.t2 VALUES ('before call db1.p1()');
44
# Note: the master_log_pos is set to be the position of the BEGIN + 1,
45
# so before fix of BUG#43263 if the BEGIN is ignored, then all the
46
# INSERTS in p1 will be replicated in AUTOCOMMIT=1 mode and the slave
47
# SQL thread will stop right before the first INSERT. After fix of
48
# BUG#43263, BEGIN will not be ignored by the replication db rules,
49
# and then the whole transaction will be executed before slave SQL
51
let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
52
let $master_pos= `SELECT $master_pos + 1`;
59
# The position where the following START SLAVE UNTIL will stop at
60
let $master_end_trans_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
62
INSERT INTO db1.t2 VALUES ('after call db1.p1()');
69
replace_result $master_pos MASTER_POS;
70
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_pos;
71
source include/wait_for_slave_sql_to_stop.inc;
72
let $slave_sql_stop_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
73
let $result= query_get_value(SELECT $slave_sql_stop_pos - $master_end_trans_pos as result, result, 1);
76
--echo # If we got non-zero here, then we're suffering BUG#43263
78
eval SELECT $result as 'Must be 0';
85
INSERT INTO db1.t2 VALUES ('before call db1.p2()');
88
let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
89
let $master_pos= `SELECT $master_pos + 1`;
96
let $master_end_trans_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
98
INSERT INTO db1.t2 VALUES ('after call db1.p2()');
100
SELECT * FROM db1.t2;
105
replace_result $master_pos MASTER_POS;
106
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_pos;
107
source include/wait_for_slave_sql_to_stop.inc;
109
let $slave_sql_stop_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
110
let $result= query_get_value(SELECT $slave_sql_stop_pos - $master_end_trans_pos as result, result, 1);
113
--echo # If we got non-zero here, then we're suffering BUG#43263
115
eval SELECT $result as 'Must be 0';
116
SELECT * from db1.t1;
117
SELECT * from db1.t2;