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; 49Got one of the listed errors 50BEGIN; 51Got one of the listed errors 52Got one of the listed errors 53INSERT INTO t1 (a, data) VALUES (27, 's');; 54INSERT INTO t2 (a, data) VALUES (28, 's');; 55INSERT INTO t1 (a, data) VALUES (29, 's');; 56CREATE TABLE t5 (a int); 57connection slave; 58include/diff_tables.inc [master:t1,slave:t1] 59######################################################################################## 60# 3 - BEGIN - COMMIT 61######################################################################################## 62connection master; 63TRUNCATE TABLE t1; 64TRUNCATE TABLE t2; 65TRUNCATE TABLE t3; 66BEGIN; 67Got one of the listed errors 68Got one of the listed errors 69Got one of the listed errors 70COMMIT; 71connection slave; 72include/diff_tables.inc [master:t1,slave:t1] 73######################################################################################## 74# 4 - BEGIN - ROLLBACK 75######################################################################################## 76connection master; 77TRUNCATE TABLE t1; 78TRUNCATE TABLE t2; 79TRUNCATE TABLE t3; 80BEGIN; 81Got one of the listed errors 82Got one of the listed errors 83Got one of the listed errors 84ROLLBACK; 85Warnings: 86Warning 1196 Some non-transactional changed tables couldn't be rolled back 87connection slave; 88include/diff_tables.inc [master:t1,slave:t1] 89######################################################################################## 90# 5 - PROCEDURE 91######################################################################################## 92connection master; 93TRUNCATE TABLE t1; 94TRUNCATE TABLE t2; 95TRUNCATE TABLE t3; 96CREATE PROCEDURE p1(pd VARCHAR(30000)) 97BEGIN 98INSERT INTO t1 (a, data) VALUES (1, pd); 99INSERT INTO t1 (a, data) VALUES (2, pd); 100INSERT INTO t1 (a, data) VALUES (3, pd); 101INSERT INTO t1 (a, data) VALUES (4, pd); 102INSERT INTO t1 (a, data) VALUES (5, 's'); 103END// 104TRUNCATE TABLE t1; 105TRUNCATE TABLE t1; 106BEGIN; 107Got one of the listed errors 108COMMIT; 109TRUNCATE TABLE t1; 110BEGIN; 111Got one of the listed errors 112ROLLBACK; 113connection slave; 114include/diff_tables.inc [master:t1,slave:t1] 115######################################################################################## 116# 6 - XID 117######################################################################################## 118connection master; 119TRUNCATE TABLE t1; 120TRUNCATE TABLE t2; 121TRUNCATE TABLE t3; 122BEGIN; 123Got one of the listed errors 124Got one of the listed errors 125Got one of the listed errors 126INSERT INTO t1 (a, data) VALUES (7, 's');; 127INSERT INTO t2 (a, data) VALUES (8, 's');; 128INSERT INTO t1 (a, data) VALUES (9, 's');; 129ROLLBACK TO sv; 130Warnings: 131Warning 1196 Some non-transactional changed tables couldn't be rolled back 132COMMIT; 133connection slave; 134include/diff_tables.inc [master:t1,slave:t1] 135######################################################################################## 136# 7 - NON-TRANS TABLE 137######################################################################################## 138connection master; 139TRUNCATE TABLE t1; 140TRUNCATE TABLE t2; 141TRUNCATE TABLE t3; 142BEGIN; 143Got one of the listed errors 144Got one of the listed errors 145Got one of the listed errors 146INSERT INTO t1 (a, data) VALUES (8, 's');; 147INSERT INTO t1 (a, data) VALUES (9, 's');; 148INSERT INTO t2 (a, data) VALUES (10, 's');; 149INSERT INTO t1 (a, data) VALUES (11, 's');; 150COMMIT; 151BEGIN; 152Got one of the listed errors 153COMMIT; 154connection slave; 155include/diff_tables.inc [master:t1,slave:t1] 156######################################################################## 157# 8 - Bug#55375(Regression Bug) Transaction bigger than 158# max_binlog_cache_size crashes slave 159######################################################################## 160# [ On Slave ] 161SET GLOBAL max_binlog_cache_size = 4096; 162SET GLOBAL binlog_cache_size = 4096; 163SET GLOBAL max_binlog_stmt_cache_size = 4096; 164SET GLOBAL binlog_stmt_cache_size = 4096; 165include/stop_slave.inc 166include/start_slave.inc 167CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); 168CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); 169CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); 170CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log"); 171connection master; 172TRUNCATE t1; 173connection slave; 174connection master; 175SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; 176SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; 177SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; 178SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; 179disconnect master; 180connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; 181BEGIN; 182Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times 183COMMIT; 184connection slave; 185include/wait_for_slave_sql_error.inc [errno=1534] 186SELECT count(*) FROM t1; 187count(*) 1880 189include/show_binlog_events.inc 190SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; 191SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; 192SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; 193SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; 194include/stop_slave.inc 195include/start_slave.inc 196connection master; 197connection slave; 198SELECT count(*) FROM t1; 199count(*) 200128 201######################################################################################## 202# CLEAN 203######################################################################################## 204connection master; 205DROP TABLE t1; 206DROP TABLE t2; 207DROP TABLE t3; 208DROP TABLE IF EXISTS t4; 209DROP TABLE t5; 210DROP PROCEDURE p1; 211include/rpl_end.inc 212