Bug #7031 Foreign keys always have almost the same name
Submitted: 6 Dec 2004 8:38 Modified: 10 Dec 2004 12:37
Reporter: Jerome Canler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.16 OS:Windows (WinXP Pro SP2)
Assigned to: CPU Architecture:Any

[6 Dec 2004 8:38] Jerome Canler
Description:
Each time I create a foreign key constraint, the table editor asks me the key name; so I type an explicit name. The generated SQL query looks perfect.
However, but when I close the table editor and re-open it, the foreign keys have the name 'contact_ibfk_xx' where xx is a number.Thus the name I gave during the creation is lost.

How to repeat:
Create or modify a table with the table editor.
Specify a column as a foreign key.
Type the key name of your choice. 
Click on 'apply changes'
Close the table editor
Re-open the table editor and display  the 'foreign keys' tab.

Suggested fix:
?
[6 Dec 2004 11:02] Heikki Tuuri
Hi!

The name of a FOREIGN KEY constraint is really the CONSTRAINT name, not a key (or index) name.

Maybe MySQL Administrator should be modified so that you can also specify the CONSTRAINT name?

Regards,

Heikki
[6 Dec 2004 16:51] Jerome Canler
Thanks Heikki, but I don't understand why the table editor allows me to give a name to the foreign key (name appearing in the generated SQL query) whereas this data isn't kept by the server (Is this a mySQL bug or a functionality that will be available in the future ?)
[7 Dec 2004 23:58] Michael G. Zinner
Thanks for reporting! It was a bug in the table editor. It is now fixed and will be in the next release of MA and QB.
[10 Dec 2004 12:37] 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