Bug #32822 Creating a Foreign Key Crashes Workbench
Submitted: 28 Nov 2007 16:53 Modified: 1 Jan 2008 7:34
Reporter: Haddad Said Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version: OS:Windows
Assigned to: CPU Architecture:Any

[28 Nov 2007 16:53] Haddad Said
Description:
Whenever I try to create a foreign key in one table workbench will throw out the error pasted below, if I ignore it, workbench will crash when I save the model.

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at MySQL.Grt.ListModel.set_field(NodeId node, Int32 column, String value)
   at MySQL.GUI.Workbench.Plugins.DbMysqlTableFkColumnListModel.ValuePushed(Object sender, NodeControlValueEventArgs e)
   at Aga.Controls.Tree.NodeControls.BindableControl.OnValuePushed(NodeControlValueEventArgs args)
   at Aga.Controls.Tree.NodeControls.BindableControl.SetValue(TreeNodeAdv node, Object value)
   at MySQL.Utilities.AdvNodeComboBox.DoApplyChanges(TreeNodeAdv node, Control editor)
   at Aga.Controls.Tree.NodeControls.EditableControl.ApplyChanges()
   at Aga.Controls.Tree.TreeViewAdv.OnLeave(EventArgs e)
   at System.Windows.Forms.Control.NotifyLeave()
   at System.Windows.Forms.ContainerControl.UpdateFocusedControl()

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Assembly Version: 5.0.9.2131
    Win32 Version: 5.0.9.2131
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/MySQLWorkbench.exe
----------------------------------------
wb.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/wb.wr.DLL
----------------------------------------
grt.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/grt.wr.DLL
----------------------------------------
MySQLCsUtilities
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/MySQLCsUtilities.DLL
----------------------------------------
msvcm80
    Assembly Version: 8.0.50727.762
    Win32 Version: 8.00.50727.762
    CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700/msvcm80.dll
----------------------------------------
MySQLGrtShell
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/MySQLGrtShell.EXE
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
MySQLWorkbenchEditors
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/MySQLWorkbenchEditors.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/Aga.Controls.DLL
----------------------------------------
grt.helpers.be
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/grt.helpers.be.DLL
----------------------------------------
db.mysql.editors.wbp.fe
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/db.mysql.editors.wbp.fe.DLL
----------------------------------------
db.mysql.editors.wbp.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/db.mysql.editors.wbp.wr.DLL
----------------------------------------
grt.db.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20SE/grt.db.wr.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

How to repeat:
1. open the attached model.
2. create a foreign key on incoming.bearer to bearer.id_bearer
3. Watch the error, ignore it.
4. Try to save the model
[28 Nov 2007 16:54] Haddad Said
the data model file

Attachment: sms.mwb (application/octet-stream, text), 5.24 KiB.

[29 Nov 2007 18:34] Tom Parker
I get the same behavior with the MySQL Workbench OSS model. version 5.0.9 OSS Beta revision 2131. Specifically I can set up the foreign Key Name and the referenced table and save. But when I select the column to associate with the foreign key and save, that is when the work bench crashes. 

My temporary work around was to create as much as I could in the workbench, then export the schema to a SQL script, add the foreign key details, reimport into workbench. Seems to work. The only issue I see so far is the foreign key name seems to not be displayed, though the referenced table and the associated column are still in tact.
[1 Dec 2007 7:34] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.10, and inform about the results.
[5 Dec 2007 19:11] Sergey Romanov
I have this problem in 5.0.10 from time to time.
[2 Jan 2008 0: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".