| Bug #82946 | drop foreign key with FOREIGN_KEY_CHECKS=0 lead table lost when restart | ||
|---|---|---|---|
| Submitted: | 12 Sep 2016 8:51 | Modified: | 12 Sep 2016 9:08 |
| Reporter: | zhang simon (OCA) | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
| Version: | 5.5,5.6 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[12 Sep 2016 8:51]
zhang simon
[12 Sep 2016 9:02]
zhang simon
5.7 have fixed
commit c1ed0eafcf3de23635e18f6d1f306c8fe97fa287
Author: Thirunarayanan B <thirunarayanan.balathandayuth@oracle.com>
Date: Mon May 5 16:47:13 2014 +0530
Bug #17449901 TABLE DISAPPEARS WHEN ALTERING WITH
FOREIGN KEY CHECKS OFF
Analysis:
By removing the FK index with out removing the foreign key constraint,
we are moving the table into inconsistent state. FK index lookup happens
during load table process. So it fails to open the table when FK index
is missing.
Fix:
Don't allow to drop an index if it is needed for an FK constraint,
even if foreign_key_checks is disabled.
Approved by Jimmy (rb-5274)
[12 Sep 2016 9:08]
MySQL Verification Team
Hello zhang, Thank you for the report and test case. As you already found, this is duplicate of Bug #70260 Thanks, Umesh
