1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-26 07:02:12 +03:00
Files
mariadb/mysql-test/suite/rpl/t/rpl_temporary_errors.test
Michael Widenius e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00

86 lines
2.4 KiB
Plaintext

source include/master-slave.inc;
source include/have_innodb.inc;
call mtr.add_suppression("Deadlock found");
call mtr.add_suppression("Can't find record in 't.'");
--echo **** On Master ****
connection master;
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
--echo **** On Slave ****
sync_slave_with_master;
SHOW STATUS LIKE 'Slave_retried_transactions';
# since bug#31552/31609 idempotency is not default any longer. In order
# the following UPDATE t1 to pass the mode is switched temprorarily
set @@global.slave_exec_mode= 'IDEMPOTENT';
UPDATE t1 SET a = 5, b = 47 WHERE a = 1;
SELECT * FROM t1;
--echo **** On Master ****
connection master;
UPDATE t1 SET a = 5, b = 5 WHERE a = 1;
SELECT * FROM t1;
#SHOW BINLOG EVENTS;
--echo **** On Slave ****
sync_slave_with_master;
set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions';
SELECT * FROM t1;
source include/check_slave_is_running.inc;
connection slave;
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
--echo **** On Master ****
connection master;
DROP TABLE t1;
--sync_slave_with_master
--connection master
# BUG#Bug #53259 Unsafe statement binlogged in statement format w/MyIsam temp tables
#
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t_myisam (id INT, PRIMARY KEY (id)) engine= MyIsam;
INSERT INTO t_myisam (id) VALUES(1);
CREATE TABLE t_innodb (id INT) engine= Innodb;
INSERT INTO t_innodb (id) VALUES(1);
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
INSERT INTO t_innodb(id) VALUES(2);
INSERT INTO t_myisam(id) VALUES(3);
CREATE TEMPORARY TABLE x (id INT);
--error 1062
INSERT INTO t_myisam(id) VALUES(4),(1);
INSERT INTO t_innodb(id) VALUES(5);
COMMIT;
SELECT * FROM t_innodb;
SELECT * FROM t_myisam;
--sync_slave_with_master
SELECT * FROM t_innodb;
SELECT * FROM t_myisam;
--connection master
BEGIN;
CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb;
INSERT INTO t_innodb(id) VALUES(1);
INSERT INTO t_innodb(id) VALUES(1);
ROLLBACK;
source include/show_binlog_events.inc;
DROP TABLE t_myisam, t_innodb;
# We must wait for the slave to stop.
# Otherwise the warnings in the error log about deadlock may be written to
# the error log only during shutdown, and currently the suppression of
# "Deadlock found" set in this test case is not effective during server
# shutdown.
--sync_slave_with_master
--source include/rpl_end.inc