Bug #51053 Crash upon generating SQL from ERR diagram
Submitted: 10 Feb 2010 9:48 Modified: 16 Feb 2010 15:34
Reporter: Darren Whitlen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.15 OSS Beta OS:Microsoft Windows (Windows7)
Assigned to: Sergei Tkachenko CPU Architecture:Any
Tags: err, model, sql export

[10 Feb 2010 9:48] Darren Whitlen
Description:
Exporting a model using Forward Engineer ALTER Script Options, WB crashes witht he below report before generating any SQL

----------------------------------------
Exception = System.AccessViolationException
Message = Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
FullText = System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at sigc.internal.signal_emit0<void,sigc::nil>.emit(signal_impl* impl)
   at sigc.signal0<void,sigc::nil>.emit(signal0<void\,sigc::nil>* )
   at mforms.Wizard.next_clicked(Wizard* )
   at MySQL.Forms.WizardImpl.nextClick(Object sender, EventArgs arguments)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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)

How to repeat:
Open Model
File > Export > Forward Engineer ALTER Script
Select Input File
Leave Output File blank OR select an existing SQL file
Click Next
[12 Feb 2010 9:57] Sergei Tkachenko
Parser was fixed to workaround omitted default schema, but to get proper alter script, you still need to set default schema in the beginning of the script you provided. In your case it's:
USE `mydb`;
By the way, it also serves as a workaround to crash.
[15 Feb 2010 22:13] Johannes Taxacher
fixed in repository as stated by developer
[16 Feb 2010 15:34] Tony Bedford
An entry has been added to the 5.2.16 changelog:

Using File, Export, Forward Engineer ALTER Script to export a model resulted in MySQL Workbench generating the exception AccessViolationException.