Bug #27698 Foreign keys not loaded when editing table
Submitted: 7 Apr 2007 15:39 Modified: 27 Apr 2007 15:40
Reporter: Thomas Vanhaniemi Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.11 OS:Windows (Vista 32-bit)
Assigned to: CPU Architecture:Any
Tags: fk, foreign key

[7 Apr 2007 15:39] Thomas Vanhaniemi
Description:
When you want to edit a table with foreign keys the keys aren't loaded into the list under the tab "Foreign Keys".

How to repeat:
1. Make a new table with Foreign Keys to another table and save it.
2. Right click on the newly created table and choose "Edit Table".
3. Go to "Foreign Keys" and the newly added Foreign Keys doesn't load.

Suggested fix:
Make sure the keys are loaded and that there isn't any drawing errors in the listbox.
[9 Apr 2007 10:49] MySQL Verification Team
Thank you for the bug report. I was unable to repeat with the simple
example from our Manual at:

http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html

Could you please provide the create table script you have used?. Thanks
in advance.
[9 Apr 2007 13:50] Thomas Vanhaniemi
Ok, I have now revised when this problem occurs and it's when you use some special charactes in the Foreign Key name, in my case the character ':' makes so that the FK:s isn't loaded correctly.

And directly when I accept the changes and it successfully creates the table my foreign keys disapears.

I will upload the script to create the tables with my used names and a coupe of screenshots of the Table Editor window.
[9 Apr 2007 13:50] Thomas Vanhaniemi
Create Table script

Attachment: script.sql (text/plain), 660 bytes.

[9 Apr 2007 13:51] Thomas Vanhaniemi
Adding the table with a Foreign Key

Attachment: adding_table_with_fk.gif (image/gif, text), 27.95 KiB.

[9 Apr 2007 13:51] Thomas Vanhaniemi
Editing the newly created table

Attachment: editing_table_with_fk.gif (image/gif, text), 26.89 KiB.

[10 Apr 2007 23:10] MySQL Verification Team
Thank you for the feedback. Verified with the sample provided.
[27 Apr 2007 15:40] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html