Bug #52739 Foreign keys
Submitted: 10 Apr 2010 12:14 Modified: 15 Apr 2010 11:00
Reporter: sadsa sdasdasd Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.17 OSS OS:Windows
Assigned to: CPU Architecture:Any

[10 Apr 2010 12:14] sadsa sdasdasd
Description:
Try to add/change foreign keys

How to repeat:
Try to add/change foreign keys
[10 Apr 2010 17:23] Edwin DeSouza
similar to http://bugs.mysql.com/bug.php?id=51124
[10 Apr 2010 20:56] Valeriy Kravchuk
What exact version, 5.2.x, do you use?
[11 Apr 2010 20:59] sadsa sdasdasd
I'm using 5.2.17 OSS

And i have figured out how to repeat this.

Try to add foreign key to same table.

for example if you are creating/altering table "users"
set try to set foreign key for this tabe (same what column).

P.S.
it was my mistake =))
[12 Apr 2010 3:35] Valeriy Kravchuk
Thank you for the clarification. Still I am not able to repeat this. Can you send .mwb file to demonstrate the problem, with detailed instruction what exact foreign key to add/alter?
[12 Apr 2010 8:03] sadsa sdasdasd
More detailed:

1) create tabe name: "test", Collation: latin1 (default), Engine: InnoDB
2) add column: "idtest" (PRIMARY, NOT NULL, INT(11) (it will be there as default))
3) add column: "idtest2" (NOT NULL, INT(11))
4) go to "Foreign Keys" Tab 
5) type in "Foreign Key Name" somethink like "qwe"
6) From "Referenced Table" dropdown Select current databese and and our "test" table... and here we go "MySQL Workbench Unexpected Error" window will popup.

and i have noticed that i wasn't able to repeat this when altering table
becouse if you just try to add foreign key workbench says "No changes to object were dedeted".

P.S.
thank you for really great free tool =)
[12 Apr 2010 8:04] sadsa sdasdasd
....Может просто по русски поболтаем? :)
[12 Apr 2010 9:41] Valeriy Kravchuk
Verified just as described in the last comment. 

I missed the fact that this should be done in SQL Editor, after connecting to some server, NOT in ERR Model (there adding such a foreign key works).
[15 Apr 2010 11:00] Sergei Tkachenko
Duplicates the bug #51124.