Bug #6476 Existing Foreign Keys are not shown in MySQL Table Editor
Submitted: 6 Nov 2004 13:07 Modified: 1 Dec 2004 1:35
Reporter: Morgan Fraser Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.0 gamma OS:Windows (Windows XP)
Assigned to: Michael G. Zinner CPU Architecture:Any

[6 Nov 2004 13:07] Morgan Fraser
Description:
The Foreign keys that are created in the table editor are not visible when I go back into the table editor a second time.

How to repeat:
I go into the table editor for a table in my database and create a foreign key relationship to another table on a column.
I apply the changes - they work. I then push close.
I then try to edit the table again.
The window appears, but the foreign key is now gone.

Here is the output from the SHOW CREATE TABLE statement after I apply changes

CREATE TABLE "char_attributes" (
  "Attrib_UID" int(10) unsigned NOT NULL default '0',
  "Char_UID" int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  ("Char_UID"),
  KEY "FK_char_attributes_Def" ("Attrib_UID"),
  CONSTRAINT "char_attributes_ibfk_1" FOREIGN KEY ("Attrib_UID") REFERENCES "char_attributes_def" ("UID") ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This appears to indicate that the foreign key relationship is established, but this does not appear in the Table Editor window.

Suggested fix:
The Table editor should be able to detect foreign keys that it created and display them properly.
[1 Dec 2004 1:35] Michael G. Zinner
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html