mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge
This commit is contained in:
77
mysql-test/suite/rpl/r/rpl_stop_slave.result
Normal file
77
mysql-test/suite/rpl/r/rpl_stop_slave.result
Normal file
@ -0,0 +1,77 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
|
||||
# BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
|
||||
#
|
||||
# If a temporary table is created or dropped, the transaction should be
|
||||
# regarded similarly that a non-transactional table is modified. So
|
||||
# STOP SLAVE should wait until the transaction has finished.
|
||||
CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
include/stop_slave.inc
|
||||
|
||||
# Suspend the INSERT statement in current transaction on SQL thread.
|
||||
# It guarantees that SQL thread is applying the transaction when
|
||||
# STOP SLAVE command launchs.
|
||||
SET GLOBAL debug= 'd,after_mysql_insert';
|
||||
include/start_slave.inc
|
||||
|
||||
# CREATE TEMPORARY TABLE with InnoDB engine
|
||||
# -----------------------------------------
|
||||
|
||||
[ On Master ]
|
||||
BEGIN;
|
||||
DELETE FROM t1;
|
||||
CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE tt1;
|
||||
COMMIT;
|
||||
|
||||
[ On Slave ]
|
||||
STOP SLAVE SQL_THREAD;
|
||||
|
||||
[ On Slave1 ]
|
||||
# To resume slave SQL thread
|
||||
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
[ On Slave ]
|
||||
# Slave should stop after the transaction has committed.
|
||||
# So t1 on master is same to t1 on slave.
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
START SLAVE SQL_THREAD;
|
||||
|
||||
# CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
|
||||
# ----------------------------------------------------
|
||||
|
||||
[ On Master ]
|
||||
BEGIN;
|
||||
DELETE FROM t1;
|
||||
CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
|
||||
SELECT c1 FROM t2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE tt1;
|
||||
COMMIT;
|
||||
|
||||
[ On Slave ]
|
||||
STOP SLAVE SQL_THREAD;
|
||||
|
||||
[ On Slave1 ]
|
||||
# To resume slave SQL thread
|
||||
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
[ On Slave ]
|
||||
# Slave should stop after the transaction has committed.
|
||||
# So t1 on master is same to t1 on slave.
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
START SLAVE SQL_THREAD;
|
||||
|
||||
# Test end
|
||||
SET GLOBAL debug= '$debug_save';
|
||||
DROP TABLE t1, t2;
|
51
mysql-test/suite/rpl/t/rpl_stop_slave.test
Normal file
51
mysql-test/suite/rpl/t/rpl_stop_slave.test
Normal file
@ -0,0 +1,51 @@
|
||||
source include/master-slave.inc;
|
||||
source include/have_innodb.inc;
|
||||
source include/have_debug.inc;
|
||||
source include/have_debug_sync.inc;
|
||||
source include/have_binlog_format_mixed_or_statement.inc;
|
||||
|
||||
--echo
|
||||
--echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
|
||||
--echo #
|
||||
--echo # If a temporary table is created or dropped, the transaction should be
|
||||
--echo # regarded similarly that a non-transactional table is modified. So
|
||||
--echo # STOP SLAVE should wait until the transaction has finished.
|
||||
|
||||
CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
|
||||
|
||||
sync_slave_with_master;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
source include/stop_slave.inc;
|
||||
|
||||
--echo
|
||||
--echo # Suspend the INSERT statement in current transaction on SQL thread.
|
||||
--echo # It guarantees that SQL thread is applying the transaction when
|
||||
--echo # STOP SLAVE command launchs.
|
||||
let $debug_save= `SELECT @@GLOBAL.debug`;
|
||||
SET GLOBAL debug= 'd,after_mysql_insert';
|
||||
source include/start_slave.inc;
|
||||
|
||||
--echo
|
||||
--echo # CREATE TEMPORARY TABLE with InnoDB engine
|
||||
--echo # -----------------------------------------
|
||||
let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
|
||||
source extra/rpl_tests/rpl_stop_slave.test;
|
||||
|
||||
--echo
|
||||
--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
|
||||
--echo # ----------------------------------------------------
|
||||
let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
|
||||
SELECT c1 FROM t2;
|
||||
source extra/rpl_tests/rpl_stop_slave.test;
|
||||
|
||||
# Don't need to verify 'CREATE TEMPORARY TABLE' with MyIASM engine, as it
|
||||
# never is binlogged into a transaction since 5.5.
|
||||
|
||||
--echo
|
||||
--echo # Test end
|
||||
SET GLOBAL debug= '$debug_save';
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1, t2;
|
||||
source include/master-slave-end.inc;
|
Reference in New Issue
Block a user