rpl_rbr_to_sbr.test 1.68 KB
Newer Older
1
-- source include/have_binlog_format_mixed.inc
2
-- source include/not_ndb_default.inc
unknown's avatar
unknown committed
3 4
-- source include/master-slave.inc

5 6
# Test that the slave temporarily switches to ROW when seeing row
# events when it is in MIXED mode
unknown's avatar
unknown committed
7 8 9 10 11

--echo **** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
12 13 14 15
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
unknown's avatar
unknown committed
16 17 18 19
SHOW BINLOG EVENTS;
sync_slave_with_master;
--echo **** On Slave ****
--replace_result $MASTER_MYPORT MASTER_PORT
20
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 34 # 35 # 41 #
unknown's avatar
unknown committed
21
--query_vertical SHOW SLAVE STATUS
22 23 24
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
unknown's avatar
unknown committed
25 26 27 28 29 30 31 32 33 34 35 36 37
SHOW BINLOG EVENTS;

--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql

connection master;
DROP TABLE IF EXISTS t1;

# Let's compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching

38
diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
unknown's avatar
unknown committed
39 40 41

# If all is good, we can remove the files

42 43
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql