Bug #26305 | Foreign Keys: Incorrect error reporting when dropping index tied by an FK | ||
---|---|---|---|
Submitted: | 13 Feb 2007 0:25 | Modified: | 12 Jul 2012 14:53 |
Reporter: | Alex Rytov | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 5.1.15, 5.0 BK, 4.1 BK | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | error, foreign key, INDEX |
[13 Feb 2007 0:25]
Alex Rytov
[13 Feb 2007 8:04]
Sveta Smirnova
Thank you for the report. Verified as described. All versions are affected.
[16 Nov 2007 6:05]
terry tao
the errno 150 gives more info,it can be found in the file include/my_base.h(#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */), but it can't be found in the manual? also you can give the detail info from the server. tail -f var/log/master.err 071106 11:17:31 InnoDB: Error: in ALTER TABLE `test`.`t` InnoDB: has or is referenced in foreign key constraints InnoDB: which are not compatible with the new table definition. ...
[12 Jul 2012 14:53]
Jon Olav Hauglid
In 5.6.6 after the fix for Bug#64617, you now get: query 'drop index ix1 on t' failed: 1553: Cannot drop index 'ix1': needed in a foreign key constraint