Bug #8863 | INNODB: FOREIGN KEY cannot be dropped. | ||
---|---|---|---|
Submitted: | 1 Mar 2005 13:28 | Modified: | 1 Mar 2005 20:07 |
Reporter: | Disha | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.0.2 | OS: | Windows (Windows 2003) |
Assigned to: | CPU Architecture: | Any |
[1 Mar 2005 13:28]
Disha
[1 Mar 2005 14:31]
MySQL Verification Team
When you create foreign key constraints, index on the column is automatically created. When you drop foreign key, of course only foreign key is dropped. mysql> show create table t2; +-------+----------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------------------------------------------------------------------+ | t2 | CREATE TABLE `t2` ( `a1` int(11) NOT NULL, `a2` char(1) NOT NULL, KEY `fk_1` (`a1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+----------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
[1 Mar 2005 20:07]
Heikki Tuuri
Hi! I could add to Victoria's fine reply that the FOREIGN KEY name is actually the CONSTRAINT name. Dropping the constraint does not require dropping the index. Regards, Heikki