Bug #13799 Can't add foreign keys linked to the same table
Submitted: 6 Oct 2005 11:36 Modified: 12 Apr 2006 8:12
Reporter: Sorin Sbarnea Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Preview Severity:S1 (Critical)
Version:1.0.2 OS:Windows (WinXP)
Assigned to: Mike Lischke CPU Architecture:Any

[6 Oct 2005 11:36] Sorin Sbarnea
Description:
Adding a foreign key to the same table will generate an exception.
( parent_id -> id )

How to repeat:
Create a table with a colum id an one parent_id of the same type and add
dd a foreign key to the same table. This will generate an exception.
( parent_id -> id )
[6 Oct 2005 11:42] Sorin Sbarnea
I should mention that this behavior will appear if you don't press apply changes between the adding of the second column (parent_id) and the adding of the foreign key. Also after this exception i have a floating relation that could not be deleted and that doesn't apear into the foreign.. tab.
[6 Oct 2005 12:26] Sorin Sbarnea
After some more reaseach i discovered that I could delete the relation manualy from the XML file :) but also that self-relations are not supported any way. This it's a very common relation type also and I don't see any way of skipping it so i raise the severity level.
[9 Oct 2005 11:51] Vasily Kishkin
I was not able to reproduce the exception. But I've got very strange picture. Screen copy is attached.
[9 Oct 2005 11:53] Vasily Kishkin
screen copy

Attachment: screencopy.GIF (image/gif, text), 90.31 KiB.

[12 Apr 2006 8:12] Mike Lischke
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/