1
-- source include/have_row_based.inc
2
-- source include/have_binlog_format_statement.inc
3
-- source include/master-slave.inc
5
# Test that the slave temporarily switches to ROW when seeing binrow
6
# events when it is in STATEMENT or MIXED mode
8
SET BINLOG_FORMAT=MIXED;
9
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
10
SET GLOBAL BINLOG_FORMAT=MIXED;
11
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
13
--echo **** On Master ****
14
CREATE TABLE t1 (a INT, b LONG);
15
INSERT INTO t1 VALUES (1,1), (2,2);
16
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
17
let $VERSION=`select version()`;
18
--replace_result $VERSION VERSION
19
--replace_column 2 # 5 #
20
--replace_regex /table_id: [0-9]+/table_id: #/
22
sync_slave_with_master;
23
--echo **** On Slave ****
24
--replace_result $MASTER_MYPORT MASTER_PORT
25
--replace_column 1 # 8 # 9 # 23 # 33 #
26
--query_vertical SHOW SLAVE STATUS
27
--replace_result $VERSION VERSION
28
--replace_column 2 # 5 #
29
--replace_regex /table_id: [0-9]+/table_id: #/
32
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
33
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
36
DROP TABLE IF EXISTS t1;
38
# Let's compare. Note: If they match test will pass, if they do not match
39
# the test will show that the diff statement failed and not reject file
40
# will be created. You will need to go to the mysql-test dir and diff
41
# the files your self to see what is not matching
43
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
45
# If all is good, we can remove the files
47
system rm $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql;
48
system rm $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;