Details
-
Bug
-
Status: Needs Feedback (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11.10, 11.4.4
-
None
Description
After upgrading to v10.11.10 creation of a foreign key failed with no information in engine innodb status. The same keys are allowed in 10.11.9 and below.
reproducer SQL:
CREATE TABLE `a` (
|
`a_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`a_p_id` int(10) unsigned DEFAULT NULL,
|
PRIMARY KEY (`a_id`),
|
FOREIGN KEY (`a_p_id`) REFERENCES `a` (`a_id`)
|
) ENGINE=InnoDBa
|
|
|
CREATE TABLE `b` (
|
`b_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`b_p_id` int(10) unsigned DEFAULT NULL,
|
PRIMARY KEY (`b_id`),
|
FOREIGN KEY (`b_p_id`) REFERENCES `b` (`b_id`)
|
) ENGINE=InnoDB
|
|
|
CREATE TABLE `b_a` (
|
`b_id` int(10) unsigned NOT NULL,
|
`a_p_id` int(10) unsigned NOT NULL,
|
`a_id` int(10) unsigned DEFAULT NULL,
|
PRIMARY KEY (`b_id`,`a_p_id`),
|
FOREIGN KEY (`b_id`) REFERENCES `b` (`b_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
FOREIGN KEY (`a_p_id`, `a_id`) REFERENCES `a` (`a_p_id`, `a_id`) ON UPDATE CASCADE
|
) ENGINE=InnoDB
|
Changing the table b_a latest foreign key to "on delete cascade" does allow the table to be created, but that is not what I want to archieve.