Bug #62894 | InnoDB Data Dictionary is out of sync (FK constraint for deleted child table) | ||
---|---|---|---|
Submitted: | 23 Oct 2011 15:27 | Modified: | 6 Jun 2013 12:12 |
Reporter: | Анатолий Кирсанов | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
Version: | 5.5.17 | OS: | Windows (Vista SP2 Home Basic Russian) |
Assigned to: | CPU Architecture: | Any | |
Tags: | innodb |
[23 Oct 2011 15:27]
Анатолий Кирсанов
[23 Oct 2011 18:58]
Анатолий Кирсанов
I recovered scenario resulted in child table deletion: 1.) My child table CREATE TABLE `mydb`.`child` ( `ID` int(11) unsigned NOT NULL AUTO_INCREMENT, `PARENT_ID` int(11) unsigned NOT NULL, PRIMARY KEY (`ID`,`PARENT_ID`), UNIQUE KEY `ID` (`ID`), KEY `FK_Parent` (`PARENT_ID`), CONSTRAINT `FK_Parent` FOREIGN KEY (`PARENT_ID`) REFERENCES `parent` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB; 2.) Command executed during synchronization ALTER TABLE `mydb`.`child` DROP INDEX `FK_Parent`; After this command table disappeared too. I have another table with the same structure. But all is ok with it. So the exact reason is unknown. I found a workaround: Just replace column positions in primary key. Then foreign key index does not created and does not deleted during next synchronization. CREATE TABLE `mydb`.`child` ( `PARENT_ID` int(11) unsigned NOT NULL, `ID` int(11) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`PARENT_ID`, `ID`), UNIQUE KEY `ID` (`ID`), CONSTRAINT `FK_Parent` FOREIGN KEY (`PARENT_ID`) REFERENCES `parent` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB;
[25 Oct 2011 11:55]
Valeriy Kravchuk
Please, send the entire error log (usually it is <hostname>.err file in the datadir) and the results of: show engine innodb status\G from your MySQL server.
[25 Oct 2011 12:37]
Анатолий Кирсанов
InnoDB status
Attachment: innodbstatus.txt (text/plain), 3.65 KiB.
[20 Feb 2012 19:18]
Sveta Smirnova
This looks very similar to bug #62100. Need to check when bug #62100 is fixed.
[6 May 2013 12:12]
MySQL Verification Team
Please check with latest version. Thanks.
[7 Jun 2013 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".