include/master-slave.inc
[connection master]
connection master;
CREATE TABLE t1 (
id INTEGER PRIMARY KEY,
f2 INTEGER
);
CREATE TABLE t2 (
id INT PRIMARY KEY,
t1_id INT NOT NULL,
f2 INTEGER NOT NULL,
KEY key_t1_id(t1_id),
CONSTRAINT key_t1_id FOREIGN KEY (t1_id) REFERENCES t1 (id) ON UPDATE CASCADE ON DELETE CASCADE
);
INSERT INTO t1 VALUES (1,0);
INSERT INTO t1 VALUES (2,0);
INSERT INTO t2 VALUES (1,1,1234);
connection slave;
connection slave;
SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug= "+d,sync.rm_table_no_locks";
set global slave_exec_mode='IDEMPOTENT';
connection master;
DROP TABLE t2;
connection slave;
set debug_sync='now WAIT_FOR after_lock_table';
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (3,0);
COMMIT;
connection slave;
SET DEBUG_SYNC= 'RESET';
set debug_sync='now SIGNAL continue';
SET @@GLOBAL.debug_dbug = @saved_dbug;
set global slave_exec_mode='STRICT';
connection slave;
select * from t1;
id	f2
1	0
2	0
3	0
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
connection master;
select * from t1;
id	f2
1	0
2	0
3	0
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
DROP TABLE t1;
connection slave;
connection master;
CREATE TABLE t1 (
id INTEGER PRIMARY KEY,
f2 INTEGER
);
CREATE TABLE t2 (
id INT PRIMARY KEY,
t1_id INT NOT NULL,
f2 INTEGER NOT NULL,
KEY key_t1_id(t1_id),
CONSTRAINT key_t1_id FOREIGN KEY (t1_id) REFERENCES t1 (id) ON UPDATE CASCADE ON DELETE CASCADE
);
INSERT INTO t1 VALUES (1,0);
INSERT INTO t1 VALUES (2,0);
INSERT INTO t2 VALUES (1,1,1234);
connection slave;
connection slave;
SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug= "+d,sync.rm_table_no_locks";
set global slave_exec_mode='STRICT';
connection master;
DROP TABLE t2;
connection slave;
set debug_sync='now WAIT_FOR after_lock_table';
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (3,0);
COMMIT;
connection slave;
SET DEBUG_SYNC= 'RESET';
set debug_sync='now SIGNAL continue';
SET @@GLOBAL.debug_dbug = @saved_dbug;
set global slave_exec_mode='STRICT';
connection slave;
select * from t1;
id	f2
1	0
2	0
3	0
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
connection master;
select * from t1;
id	f2
1	0
2	0
3	0
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
DROP TABLE t1;
connection slave;
include/rpl_end.inc
