Debian Codegraph @

mysql-test/suite/binlog/include/binlog_ioerr.inc

raw
1 #
2 # This include file is used by more than one test suite
3 # (currently binlog and binlog_encryption).
4 # Please check all dependent tests after modifying it
5 #
6
7 source include/have_debug.inc;
8 source include/have_innodb.inc;
9 source include/have_log_bin.inc;
10 source include/have_binlog_format_mixed_or_statement.inc;
11
12 CALL mtr.add_suppression("Error writing file 'master-bin'");
13
14 RESET MASTER;
15
16 CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
17 INSERT INTO t1 VALUES(0);
18 SET @saved_dbug = @@SESSION.debug_dbug;
19 SET SESSION debug_dbug='+d,fail_binlog_write_1';
20 # The error injection is in the "legacy" code path.
21 SET GLOBAL binlog_legacy_event_pos= 1;
22 --error ER_ERROR_ON_WRITE
23 INSERT INTO t1 VALUES(1);
24 --error ER_ERROR_ON_WRITE
25 INSERT INTO t1 VALUES(2);
26 SET SESSION debug_dbug=@saved_dbug;
27 SET GLOBAL binlog_legacy_event_pos= 0;
28 INSERT INTO t1 VALUES(3);
29 SELECT * FROM t1;
30
31 # Actually the output from this currently shows a bug.
32 # The injected IO error leaves partially written transactions in the binlog in
33 # the form of stray "BEGIN" events.
34 # These should disappear from the output if binlog error handling is improved
35 # (see MySQL Bug#37148 and WL#1790).
36 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
37 --replace_column 1 BINLOG 2 POS 5 ENDPOS
38 SHOW BINLOG EVENTS;
39
40 DROP TABLE t1;