# Set up a couple of transactions. The first will be blocked halfway
# through on a lock, and while it is blocked we initiate STOP SLAVE.
# We then test that the halfway-initiated transaction is allowed to
# complete, but no subsequent ones.
# We have to use statement-based mode and set
# binlog_direct_non_transactional_updates=0; otherwise the binlog will
# be split into two event groups, one for the MyISAM part and one for the
# InnoDB part.
SETbinlog_direct_non_transactional_updates=0;
SETsql_log_bin=0;
CALLmtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
SETsql_log_bin=1;
BEGIN;
INSERTINTOt2VALUES(20);
--disable_warnings
INSERTINTOt1VALUES(20);
--enable_warnings
INSERTINTOt2VALUES(21);
INSERTINTOt3VALUES(20,20);
COMMIT;
INSERTINTOt3VALUES(21,21);
INSERTINTOt3VALUES(22,22);
--save_master_pos
# Start a connection that will block the replicated transaction halfway.
--connectioncon_temp1
BEGIN;
INSERTINTOt2VALUES(21);
--connectionserver_2
STARTSLAVE;
# Wait for the MyISAM change to be visible, after which replication will wait
# Set up a couple of transactions. The first will be blocked halfway
# through on a lock, and while it is blocked we initiate STOP SLAVE.
# We then test that the halfway-initiated transaction is allowed to
# complete, but no subsequent ones.
# We have to use statement-based mode and set
# binlog_direct_non_transactional_updates=0; otherwise the binlog will
# be split into two event groups, one for the MyISAM part and one for the
# InnoDB part.
SETbinlog_direct_non_transactional_updates=0;
SETsql_log_bin=0;
CALLmtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
SETsql_log_bin=1;
BEGIN;
INSERTINTOt2VALUES(20);
--disable_warnings
INSERTINTOt1VALUES(20);
--enable_warnings
INSERTINTOt2VALUES(21);
INSERTINTOt3VALUES(20,20);
COMMIT;
INSERTINTOt3VALUES(21,21);
INSERTINTOt3VALUES(22,22);
--save_master_pos
# Start a connection that will block the replicated transaction halfway.
--connectioncon_temp1
BEGIN;
INSERTINTOt2VALUES(21);
--connectionserver_2
STARTSLAVE;
# Wait for the MyISAM change to be visible, after which replication will wait