Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
dfa9012a
Commit
dfa9012a
authored
Jun 20, 2016
by
Daniele Sciascia
Committed by
Nirbhay Choubey
Aug 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MW-285 MTR test case for broken foreign key constraints
parent
c9ac48f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
mysql-test/suite/galera/r/MW-285.result
mysql-test/suite/galera/r/MW-285.result
+19
-0
mysql-test/suite/galera/t/MW-285.test
mysql-test/suite/galera/t/MW-285.test
+31
-0
No files found.
mysql-test/suite/galera/r/MW-285.result
0 → 100644
View file @
dfa9012a
CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent1_id INT,
parent2_id INT,
FOREIGN KEY (parent1_id) REFERENCES parent1(id),
FOREIGN KEY (parent1_id) REFERENCES parent2(id)
) ENGINE=InnoDB;
INSERT INTO parent1 VALUES (1);
INSERT INTO parent2 VALUES (1);
INSERT INTO child VALUES (1,1,1);
INSERT INTO child VALUES (2,1,1);
SET foreign_key_checks=OFF;
DROP TABLE parent1;
UPDATE child SET parent1_id=2 WHERE id=1;
DROP TABLE child;
DROP TABLE parent2;
SET foreign_key_checks=ON;
mysql-test/suite/galera/t/MW-285.test
0 → 100644
View file @
dfa9012a
#
# Broken FK constraints cause assertions
#
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
parent1
(
id
INT
PRIMARY
KEY
,
KEY
(
id
)
)
ENGINE
=
InnoDB
;
CREATE
TABLE
parent2
(
id
INT
PRIMARY
KEY
,
KEY
(
id
)
)
ENGINE
=
InnoDB
;
CREATE
TABLE
child
(
id
INT
PRIMARY
KEY
,
parent1_id
INT
,
parent2_id
INT
,
FOREIGN
KEY
(
parent1_id
)
REFERENCES
parent1
(
id
),
FOREIGN
KEY
(
parent1_id
)
REFERENCES
parent2
(
id
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
parent1
VALUES
(
1
);
INSERT
INTO
parent2
VALUES
(
1
);
INSERT
INTO
child
VALUES
(
1
,
1
,
1
);
INSERT
INTO
child
VALUES
(
2
,
1
,
1
);
SET
foreign_key_checks
=
OFF
;
DROP
TABLE
parent1
;
UPDATE
child
SET
parent1_id
=
2
WHERE
id
=
1
;
DROP
TABLE
child
;
DROP
TABLE
parent2
;
SET
foreign_key_checks
=
ON
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment