Bug #51905 Crashing with Foreign keys
Submitted: 10 Mar 2010 10:55 Modified: 28 Apr 2010 12:27
Reporter: Rob Emery Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.15 OS:Any
Assigned to: CPU Architecture:Any
Tags: exception, foreign key

[10 Mar 2010 10:55] Rob Emery
Description:
When adding foreign keys between tables, mySQL workbench will frequently crash with:

Exception = System.Runtime.InteropServices.SEHException
Message = External component has thrown an exception.
FullText = System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at bec.FKConstraintColumnsListBE.get_column_is_fk(FKConstraintColumnsListBE* , NodeId* )
   at MySQL.Grt.Db.FKConstraintColumnsListBE.get_column_is_fk(NodeId node)
   at MySQL.GUI.Workbench.Plugins.DbMysqlTableFkColumnListModel.columnEnabledFkNodeControl_CheckStateChanged(Object sender, TreePathEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Aga.Controls.Tree.NodeControls.NodeCheckBox.OnCheckStateChanged(TreePathEventArgs args)
   at Aga.Controls.Tree.NodeControls.NodeCheckBox.OnCheckStateChanged(TreeNodeAdv node)
   at Aga.Controls.Tree.NodeControls.NodeCheckBox.SetCheckState(TreeNodeAdv node, CheckState value)
   at Aga.Controls.Tree.NodeControls.NodeCheckBox.MouseDown(TreeNodeAdvMouseEventArgs args)
   at Aga.Controls.Tree.TreeViewAdv.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

This does seem to happen mainly if the types of the fields are not exactly matched (and so nothing appears in teh fields) but when you edit the column and correct this, then add the foreign key again the exception is still thrown.

How to repeat:
Reverse Engineer a database and attempt to add foreign key constraints to it.
[10 Mar 2010 10:57] Susanne Ebrecht
Please attache the backtrace ...

http://bugs.mysql.com/how-to-report.php

"#  If the product is crashing, include a backtrace. Instructions for doing this can be found here. http://dev.mysql.com/doc/refman/5.1/en/using-stack-trace.html "
[10 Mar 2010 11:39] Rob Emery
mysqld does not crash, only mysql workbench (hence no stack trace). The exception thrown by mysql workbench is included with the first report.
[28 Mar 2010 12:27] Valeriy Kravchuk
Please, check with a newer version, 5.2.16. If the problem is repeatable, please, inform about the exact data types of referencing and referenced columns of the foreign key you are trying to add.
[28 Apr 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".