Skip to content

Commit 09bc99f

Browse files
committed
cleanup: remove extra/rpl_tests/rpl_foreign_key.test
1 parent d831cef commit 09bc99f

File tree

3 files changed

+62
-68
lines changed

3 files changed

+62
-68
lines changed

mysql-test/extra/rpl_tests/rpl_foreign_key.test

Lines changed: 0 additions & 62 deletions
This file was deleted.

mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ SET TIMESTAMP=1000000000;
3232
CREATE TABLE t3 ( a INT UNIQUE );
3333
SET FOREIGN_KEY_CHECKS=0;
3434
INSERT INTO t3 VALUES (1),(1);
35-
Got one of the listed errors
35+
ERROR 23000: Duplicate entry '1' for key 'a'
3636
SET FOREIGN_KEY_CHECKS=0;
3737
DROP TABLE IF EXISTS t1,t2,t3;
3838
SET FOREIGN_KEY_CHECKS=1;
3939
create table t1 (b int primary key) engine = INNODB;
40-
create table t2 (a int primary key, b int, foreign key (b) references t1(b))
41-
engine = INNODB;
40+
create table t2 (a int primary key, b int, foreign key (b) references t1(b)) engine = INNODB;
4241
insert into t1 set b=1;
4342
insert into t2 set a=1, b=1;
4443
set foreign_key_checks=0;
Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,61 @@
1-
-- source include/not_ndb_default.inc
21
-- source include/have_innodb.inc
3-
let $engine_type=INNODB;
4-
-- source extra/rpl_tests/rpl_foreign_key.test
2+
3+
# Check the replication of the FOREIGN_KEY_CHECKS variable.
4+
5+
-- source include/master-slave.inc
6+
7+
CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
8+
CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
9+
10+
SET FOREIGN_KEY_CHECKS=0;
11+
INSERT INTO t1 VALUES (10);
12+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
13+
INSERT INTO t2 VALUES (5,0);
14+
INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
15+
SET FOREIGN_KEY_CHECKS=1;
16+
SELECT * FROM t1 ORDER BY a;
17+
SELECT * FROM t2 ORDER BY b;
18+
sync_slave_with_master;
19+
SELECT * FROM t1 ORDER BY a;
20+
SELECT * FROM t2 ORDER BY b;
21+
22+
connection master;
23+
SET TIMESTAMP=1000000000;
24+
CREATE TABLE t3 ( a INT UNIQUE );
25+
SET FOREIGN_KEY_CHECKS=0;
26+
--error ER_DUP_ENTRY
27+
INSERT INTO t3 VALUES (1),(1);
28+
sync_slave_with_master;
29+
30+
connection master;
31+
SET FOREIGN_KEY_CHECKS=0;
32+
DROP TABLE IF EXISTS t1,t2,t3;
33+
SET FOREIGN_KEY_CHECKS=1;
34+
sync_slave_with_master;
35+
36+
#
37+
# Bug #32468 delete rows event on a table with foreign key constraint fails
38+
#
39+
40+
connection master;
41+
42+
create table t1 (b int primary key) engine = INNODB;
43+
create table t2 (a int primary key, b int, foreign key (b) references t1(b)) engine = INNODB;
44+
45+
insert into t1 set b=1;
46+
insert into t2 set a=1, b=1;
47+
48+
set foreign_key_checks=0;
49+
delete from t1;
50+
51+
--echo must sync w/o a problem (could not with the buggy code)
52+
sync_slave_with_master;
53+
select count(*) from t1 /* must be zero */;
54+
55+
56+
# cleanup for bug#32468
57+
58+
connection master;
59+
drop table t2,t1;
60+
61+
--source include/rpl_end.inc

0 commit comments

Comments
 (0)