| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
# |
| 4 |
# Initialize test data |
| 5 |
connection master; |
| 6 |
create table t1 (a int) engine=innodb; |
| 7 |
include/save_master_gtid.inc |
| 8 |
set @@SESSION.debug_dbug= "+d,binlog_force_commit_id"; |
| 9 |
connection slave; |
| 10 |
set SQL_LOG_BIN= 0; |
| 11 |
call mtr.add_suppression('Found invalid event in binary log'); |
| 12 |
call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); |
| 13 |
set SQL_LOG_BIN= 1; |
| 14 |
include/sync_with_master_gtid.inc |
| 15 |
include/stop_slave.inc |
| 16 |
include/start_slave.inc |
| 17 |
# |
| 18 |
# Test FL_PREPARED_XA |
| 19 |
connection master; |
| 20 |
set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid"; |
| 21 |
set @commit_id= 100; |
| 22 |
XA START 'x1'; |
| 23 |
insert into t1 values (1); |
| 24 |
XA END 'x1'; |
| 25 |
XA PREPARE 'x1'; |
| 26 |
set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid"; |
| 27 |
XA COMMIT 'x1'; |
| 28 |
include/save_master_gtid.inc |
| 29 |
# Waiting for slave to find invalid event.. |
| 30 |
connection slave; |
| 31 |
include/wait_for_slave_sql_error.inc [errno=1594] |
| 32 |
STOP SLAVE IO_THREAD; |
| 33 |
# Reset master binlogs (as there is an invalid event) and slave state |
| 34 |
connection master; |
| 35 |
RESET MASTER; |
| 36 |
connection slave; |
| 37 |
RESET MASTER; |
| 38 |
RESET SLAVE; |
| 39 |
set @@global.gtid_slave_pos=""; |
| 40 |
include/start_slave.inc |
| 41 |
# |
| 42 |
# Test FL_COMPLETED_XA |
| 43 |
connection master; |
| 44 |
set @commit_id= 101; |
| 45 |
XA START 'x1'; |
| 46 |
insert into t1 values (2); |
| 47 |
XA END 'x1'; |
| 48 |
XA PREPARE 'x1'; |
| 49 |
set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid"; |
| 50 |
XA COMMIT 'x1'; |
| 51 |
set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid"; |
| 52 |
include/save_master_gtid.inc |
| 53 |
# Waiting for slave to find invalid event.. |
| 54 |
connection slave; |
| 55 |
include/wait_for_slave_sql_error.inc [errno=1594] |
| 56 |
STOP SLAVE IO_THREAD; |
| 57 |
# Cleanup hanging XA PREPARE on slave |
| 58 |
set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; |
| 59 |
# Reset master binlogs (as there is an invalid event) and slave state |
| 60 |
connection master; |
| 61 |
RESET MASTER; |
| 62 |
connection slave; |
| 63 |
RESET MASTER; |
| 64 |
RESET SLAVE; |
| 65 |
set @@global.gtid_slave_pos=""; |
| 66 |
include/start_slave.inc |
| 67 |
# |
| 68 |
# Test Missing xid.data (but has format id and length description parts) |
| 69 |
connection master; |
| 70 |
set @commit_id= 101; |
| 71 |
XA START 'x1'; |
| 72 |
insert into t1 values (1); |
| 73 |
XA END 'x1'; |
| 74 |
XA PREPARE 'x1'; |
| 75 |
set @@SESSION.debug_dbug= "+d,negate_xid_data_from_gtid"; |
| 76 |
XA COMMIT 'x1'; |
| 77 |
set @@SESSION.debug_dbug= "-d,negate_xid_data_from_gtid"; |
| 78 |
include/save_master_gtid.inc |
| 79 |
# Waiting for slave to find invalid event.. |
| 80 |
connection slave; |
| 81 |
include/wait_for_slave_sql_error.inc [errno=1594] |
| 82 |
STOP SLAVE IO_THREAD; |
| 83 |
# Cleanup hanging XA PREPARE on slave |
| 84 |
set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; |
| 85 |
# Reset master binlogs (as there is an invalid event) and slave state |
| 86 |
connection master; |
| 87 |
RESET MASTER; |
| 88 |
connection slave; |
| 89 |
RESET MASTER; |
| 90 |
RESET SLAVE; |
| 91 |
set @@global.gtid_slave_pos=""; |
| 92 |
include/start_slave.inc |
| 93 |
# |
| 94 |
# Test FL_EXTRA_MULTI_ENGINE |
| 95 |
connection master; |
| 96 |
set @old_dbug= @@SESSION.debug_dbug; |
| 97 |
set @@SESSION.debug_dbug= "+d,inject_fl_extra_multi_engine_into_gtid"; |
| 98 |
set @commit_id= 102; |
| 99 |
insert into t1 values (3); |
| 100 |
include/save_master_gtid.inc |
| 101 |
set @@SESSION.debug_dbug=@old_dbug; |
| 102 |
connection slave; |
| 103 |
# Waiting for slave to find invalid event.. |
| 104 |
include/wait_for_slave_sql_error.inc [errno=1594] |
| 105 |
STOP SLAVE IO_THREAD; |
| 106 |
# Reset master binlogs (as there is an invalid event) and slave state |
| 107 |
connection master; |
| 108 |
RESET MASTER; |
| 109 |
connection slave; |
| 110 |
RESET SLAVE; |
| 111 |
RESET MASTER; |
| 112 |
set @@global.gtid_slave_pos=""; |
| 113 |
include/start_slave.inc |
| 114 |
# |
| 115 |
# Test FL_COMMIT_ALTER |
| 116 |
connection master; |
| 117 |
set @old_dbug= @@SESSION.debug_dbug; |
| 118 |
set @@SESSION.debug_dbug= "+d,negate_alter_fl_from_gtid"; |
| 119 |
set @old_alter_tp= @@SESSION.binlog_alter_two_phase; |
| 120 |
set @@SESSION.binlog_alter_two_phase= 1; |
| 121 |
alter table t1 add column (nc int); |
| 122 |
include/save_master_gtid.inc |
| 123 |
set @@SESSION.debug_dbug=@old_dbug; |
| 124 |
set @@SESSION.binlog_alter_two_phase=@old_alter_tp; |
| 125 |
connection slave; |
| 126 |
# Waiting for slave to find invalid event.. |
| 127 |
include/wait_for_slave_sql_error.inc [errno=1594] |
| 128 |
STOP SLAVE IO_THREAD; |
| 129 |
# Reset master binlogs (as there is an invalid event) and slave state |
| 130 |
connection master; |
| 131 |
RESET MASTER; |
| 132 |
connection slave; |
| 133 |
SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int); |
| 134 |
RESET SLAVE; |
| 135 |
RESET MASTER; |
| 136 |
set @@global.gtid_slave_pos=""; |
| 137 |
include/start_slave.inc |
| 138 |
# |
| 139 |
# Cleanup |
| 140 |
connection master; |
| 141 |
drop table t1; |
| 142 |
include/save_master_gtid.inc |
| 143 |
connection slave; |
| 144 |
include/sync_with_master_gtid.inc |
| 145 |
include/rpl_end.inc |
| 146 |
# End of rpl_gtid_header_valid.test |