mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge mysql-test/include/have_multi_ndb.inc: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result: Auto merged mysql-test/suite/rpl_ndb/t/disabled.def: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/log.cc: Auto merged sql/log_event_old.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/rpl_rli.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_binlog.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_string.cc: Auto merged mysql-test/Makefile.am: SCCS merged mysql-test/mysql-test-run.pl: Manual merge. mysql-test/suite/binlog/t/disabled.def: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: Manual merge. sql/log_event.cc: Manual merge. ,
This commit is contained in:
@ -32,3 +32,34 @@ SET FOREIGN_KEY_CHECKS=0;
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug #32468 delete rows event on a table with foreign key constraint fails
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
eval create table t1 (b int primary key) engine = $engine_type;
|
||||
eval create table t2 (a int primary key, b int, foreign key (b) references t1(b))
|
||||
engine = $engine_type;
|
||||
|
||||
insert into t1 set b=1;
|
||||
insert into t2 set a=1, b=1;
|
||||
|
||||
set foreign_key_checks=0;
|
||||
set @@session.binlog_format=row;
|
||||
delete from t1;
|
||||
|
||||
--echo must sync w/o a problem (could not with the buggy code)
|
||||
sync_slave_with_master;
|
||||
select count(*) from t1 /* must be zero */;
|
||||
|
||||
|
||||
# cleanup for bug#32468
|
||||
|
||||
connection master;
|
||||
drop table t2,t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
|
@ -174,11 +174,18 @@ sync_slave_with_master;
|
||||
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the preceeding test INSERT INTO t7 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
connection master;
|
||||
--echo --- on master: new values inserted ---
|
||||
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
sync_slave_with_master;
|
||||
|
||||
set @@global.slave_exec_mode= default;
|
||||
--echo --- on slave: old values should be overwritten by replicated values ---
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
||||
@ -206,12 +213,19 @@ SELECT * FROM t8 ORDER BY a;
|
||||
INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the preceeding test INSERT INTO t8 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
connection master;
|
||||
--echo --- on master ---
|
||||
# We insert a row that will cause conflict on the primary key but not
|
||||
# on the other keys.
|
||||
INSERT INTO t8 VALUES (2,4,8);
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
||||
--echo --- on slave ---
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
|
||||
@ -234,12 +248,17 @@ connection master;
|
||||
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
||||
--echo **** On Master ****
|
||||
sync_slave_with_master;
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the following test DELETE FROM t1 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
DELETE FROM t1 WHERE C1 = 'L';
|
||||
|
||||
connection master;
|
||||
DELETE FROM t1;
|
||||
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
|
@ -69,6 +69,11 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
|
||||
|
||||
# Insert some values for tables on slave side. These should not be
|
||||
# modified when the row from the master is applied.
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the following INSERTs to pass the mode is switched temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
# so the inserts are going to be overriden
|
||||
INSERT INTO t1_int VALUES (2, 4, 4711);
|
||||
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
||||
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
||||
@ -86,6 +91,8 @@ SELECT * FROM t1_bit ORDER BY a;
|
||||
SELECT * FROM t1_char ORDER BY a;
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
||||
SELECT a,b,x FROM t1_int ORDER BY a;
|
||||
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
||||
SELECT a,b,x FROM t1_char ORDER BY a;
|
||||
|
Reference in New Issue
Block a user