Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL)
-
10.0.25
Description
The manual specifies that the IGNORE keyword should ignore the error 1452 (ER_NO_REFERENCED_ROW_2 — Cannot add or update a child row: a foreign key constraint fails (%s)). But it does not:
--source include/have_innodb.inc
|
CREATE TABLE parent (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; |
CREATE TABLE child |
(
|
id INT AUTO_INCREMENT, |
parent_id INT, |
INDEX par_ind (parent_id), |
PRIMARY KEY (id), |
FOREIGN KEY (parent_id) REFERENCES parent(id) |
) ENGINE=INNODB;
|
INSERT INTO parent VALUES (1), (2); |
INSERT IGNORE INTO child VALUES (NULL, 3); |
Result:
mysqltest: At line 13: query 'INSERT IGNORE INTO child VALUES (NULL, 3)' failed: 1452: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
|
Attachments
Issue Links
- is part of
-
MDEV-9939 5.5.49 merge
- Closed