Bug #1267 Problems editing table with foregn key
Submitted: 12 Sep 2003 12:37 Modified: 12 Sep 2003 12:53
Reporter: Marko Kranjcic Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQLCC Severity:S2 (Serious)
Version:0.9.3b OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[12 Sep 2003 12:37] Marko Kranjcic
Description:
If table created with foregn key is modified through MySQLCC, you can not save changes becouse it can not drop Constraint (this foregn key) with error:
ERROR 1091: Can't DROP '0_377'. Check that column/key exists

Table can be modified w/o problems through SQL ALTER commands. Through SQL you can even drop this key w/o problems..

How to repeat:
create tables with :
CREATE TABLE `i_navigation_lookup` (
  `IDParent` int(11) NOT NULL default '0',
  PRIMARY KEY  (`IDParent`),
) TYPE=InnoDB;
CREATE TABLE `i_navigation` (
  `IDNavigation` int(11) NOT NULL default '0',
  PRIMARY KEY  (`IDNavigation`),
  CONSTRAINT `navigation_key` FOREIGN KEY (`IDNavigation`) REFERENCES `i_navigation_lookup` (`IDParent`)
) TYPE=InnoDB;

Than try to do anything on table `i_navigation` (eg. add column, or set default value to existing column, or add index..)

Suggested fix:
I do not what causes this problem...
[12 Sep 2003 12:53] MySQL Verification Team
Duplicate of #1265