1include/master-slave.inc 2[connection master] 3call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); 4SET GLOBAL max_binlog_cache_size = 4096; 5SET GLOBAL binlog_cache_size = 4096; 6SET GLOBAL max_binlog_stmt_cache_size = 4096; 7SET GLOBAL binlog_stmt_cache_size = 4096; 8disconnect master; 9connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; 10CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; 11CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; 12CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; 13######################################################################################## 14# 1 - SINGLE STATEMENT 15######################################################################################## 16connection master; 17*** Single statement on transactional table *** 18Got one of the listed errors 19*** Single statement on non-transactional table *** 20Got one of the listed errors 21include/wait_for_slave_sql_error_and_skip.inc [errno=1590] 22*** Single statement on both transactional and non-transactional tables. *** 23Got one of the listed errors 24include/wait_for_slave_sql_error_and_skip.inc [errno=1590] 25include/diff_tables.inc [master:t1,slave:t1] 26######################################################################################## 27# 2 - BEGIN - IMPLICIT COMMIT by DDL 28######################################################################################## 29connection master; 30TRUNCATE TABLE t1; 31TRUNCATE TABLE t2; 32TRUNCATE TABLE t3; 33set default_storage_engine=innodb; 34BEGIN; 35Got one of the listed errors 36Got one of the listed errors 37Got one of the listed errors 38INSERT INTO t1 (a, data) VALUES (7, 's');; 39INSERT INTO t2 (a, data) VALUES (8, 's');; 40INSERT INTO t1 (a, data) VALUES (9, 's');; 41ALTER TABLE t3 ADD COLUMN d int; 42BEGIN; 43Got one of the listed errors 44Got one of the listed errors 45INSERT INTO t1 (a, data) VALUES (19, 's');; 46INSERT INTO t2 (a, data) VALUES (20, 's');; 47INSERT INTO t1 (a, data) VALUES (21, 's');; 48CREATE TABLE t4 SELECT * FROM t1; 49BEGIN; 50Got one of the listed errors 51Got one of the listed errors 52INSERT INTO t1 (a, data) VALUES (27, 's');; 53INSERT INTO t2 (a, data) VALUES (28, 's');; 54INSERT INTO t1 (a, data) VALUES (29, 's');; 55CREATE TABLE t5 (a int); 56connection slave; 57include/diff_tables.inc [master:t1,slave:t1] 58######################################################################################## 59# 3 - BEGIN - COMMIT 60######################################################################################## 61connection master; 62TRUNCATE TABLE t1; 63TRUNCATE TABLE t2; 64TRUNCATE TABLE t3; 65BEGIN; 66Got one of the listed errors 67Got one of the listed errors 68Got one of the listed errors 69COMMIT; 70connection slave; 71include/diff_tables.inc [master:t1,slave:t1] 72######################################################################################## 73# 4 - BEGIN - ROLLBACK 74######################################################################################## 75connection master; 76TRUNCATE TABLE t1; 77TRUNCATE TABLE t2; 78TRUNCATE TABLE t3; 79BEGIN; 80Got one of the listed errors 81Got one of the listed errors 82Got one of the listed errors 83ROLLBACK; 84Warnings: 85Warning 1196 Some non-transactional changed tables couldn't be rolled back 86connection slave; 87include/diff_tables.inc [master:t1,slave:t1] 88######################################################################################## 89# 5 - PROCEDURE 90######################################################################################## 91connection master; 92TRUNCATE TABLE t1; 93TRUNCATE TABLE t2; 94TRUNCATE TABLE t3; 95CREATE PROCEDURE p1(pd VARCHAR(30000)) 96BEGIN 97INSERT INTO t1 (a, data) VALUES (1, pd); 98INSERT INTO t1 (a, data) VALUES (2, pd); 99INSERT INTO t1 (a, data) VALUES (3, pd); 100INSERT INTO t1 (a, data) VALUES (4, pd); 101INSERT INTO t1 (a, data) VALUES (5, 's'); 102END// 103TRUNCATE TABLE t1; 104TRUNCATE TABLE t1; 105BEGIN; 106Got one of the listed errors 107COMMIT; 108TRUNCATE TABLE t1; 109BEGIN; 110Got one of the listed errors 111ROLLBACK; 112connection slave; 113include/diff_tables.inc [master:t1,slave:t1] 114######################################################################################## 115# 6 - XID 116######################################################################################## 117connection master; 118TRUNCATE TABLE t1; 119TRUNCATE TABLE t2; 120TRUNCATE TABLE t3; 121BEGIN; 122Got one of the listed errors 123Got one of the listed errors 124Got one of the listed errors 125INSERT INTO t1 (a, data) VALUES (7, 's');; 126INSERT INTO t2 (a, data) VALUES (8, 's');; 127INSERT INTO t1 (a, data) VALUES (9, 's');; 128ROLLBACK TO sv; 129Warnings: 130Warning 1196 Some non-transactional changed tables couldn't be rolled back 131COMMIT; 132connection slave; 133include/diff_tables.inc [master:t1,slave:t1] 134######################################################################################## 135# 7 - NON-TRANS TABLE 136######################################################################################## 137connection master; 138TRUNCATE TABLE t1; 139TRUNCATE TABLE t2; 140TRUNCATE TABLE t3; 141BEGIN; 142Got one of the listed errors 143Got one of the listed errors 144Got one of the listed errors 145INSERT INTO t1 (a, data) VALUES (8, 's');; 146INSERT INTO t1 (a, data) VALUES (9, 's');; 147INSERT INTO t2 (a, data) VALUES (10, 's');; 148INSERT INTO t1 (a, data) VALUES (11, 's');; 149COMMIT; 150BEGIN; 151Got one of the listed errors 152COMMIT; 153connection slave; 154include/diff_tables.inc [master:t1,slave:t1] 155######################################################################## 156# 8 - Bug#55375(Regression Bug) Transaction bigger than 157# max_binlog_cache_size crashes slave 158######################################################################## 159# [ On Slave ] 160SET GLOBAL max_binlog_cache_size = 4096; 161SET GLOBAL binlog_cache_size = 4096; 162SET GLOBAL max_binlog_stmt_cache_size = 4096; 163SET GLOBAL binlog_stmt_cache_size = 4096; 164include/stop_slave.inc 165include/start_slave.inc 166CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); 167CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); 168CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); 169CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log"); 170connection master; 171TRUNCATE t1; 172connection slave; 173connection master; 174SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; 175SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; 176SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; 177SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; 178disconnect master; 179connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; 180BEGIN; 181Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times 182COMMIT; 183connection slave; 184include/wait_for_slave_sql_error.inc [errno=1197] 185SELECT count(*) FROM t1; 186count(*) 1870 188include/show_binlog_events.inc 189SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; 190SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; 191SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; 192SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; 193include/stop_slave.inc 194include/start_slave.inc 195connection master; 196connection slave; 197SELECT count(*) FROM t1; 198count(*) 199128 200######################################################################################## 201# CLEAN 202######################################################################################## 203connection master; 204DROP TABLE t1; 205DROP TABLE t2; 206DROP TABLE t3; 207DROP TABLE IF EXISTS t4; 208DROP TABLE t5; 209DROP PROCEDURE p1; 210include/rpl_end.inc 211