Bug #20525 | Can't drop primary key if there's a foreign key | ||
---|---|---|---|
Submitted: | 18 Jun 2006 20:43 | Modified: | 13 May 2010 16:12 |
Reporter: | Peter Gulutzan | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 5.0.23-debug | OS: | Linux (SUSE 10.0 / 64-bit) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[18 Jun 2006 20:43]
Peter Gulutzan
[18 Jun 2006 21:37]
Hartmut Holzgraefe
Dropping the primary key leads to a violation of the "In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order" condition, but unlike on a CREATE TABLE the "Such an index is created on the referencing table automatically if it does not exist" behavior is not triggered (quoted from http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html ) Not sure whether this is really a but, i.e. whether DROP KEY should trigger the creation of an implicit key here ... setting this to "verified" for now, to have higher forces than me decide on this
[13 Dec 2007 13:17]
Heikki Tuuri
Konstantin's foreign key implementation may solve this in the future.