Bug #35878 Generate Schema Diff Report
Submitted: 7 Apr 2008 12:16 Modified: 10 Jul 2008 16:32
Reporter: Daniel Haas Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.16a RC rev 2911/5.0.17 OS:Windows (Vista)
Assigned to: Alfredo Kojima CPU Architecture:Any

[7 Apr 2008 12:16] Daniel Haas
Description:
When creating a Schema Diff Report from the local model to a live database, the wizard crashes with an unhandled exception:

System.AccessViolationException: Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.
   bei DbMySQLDiffReporting.generate_report(DbMySQLDiffReporting* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , MYX_GRT_VALUE* , MYX_GRT_VALUE* )
   bei MySQL.GUI.Workbench.Plugins.DbMySQL.DbMySQLDiffReporting.generate_report(String left_file, String right_file, GrtValue left_cat, GrtValue right_cat)
   bei MySQL.GUI.Workbench.Plugins.DbMySQL.DiffReportingWizardPages.InitGeneratedScriptPage()
   bei MySQL.GUI.Workbench.Plugins.WizardPlugin.InitializeActivePage()
   bei MySQL.GUI.Workbench.Plugins.WizardPlugin.UpdateAfterPageProcessing(String errMsg)
   bei MySQL.GUI.Workbench.Plugins.WizardPlugin.RestoreControlsState(String errMsg)
   bei MySQL.GUI.Workbench.Plugins.WizardPlugin.GoToNextPage()
   bei MySQL.GUI.Workbench.Plugins.WizardPlugin.btnNext_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bei System.Windows.Forms.Button.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I just forward engineered my database successfully to a database, than added a column to one table with a TIMESTAMP datatype, and than ran the schema diff report when the crash happened.

How to repeat:
I don't know how easily this is reproducable, try the following:
1. Create a model with one table
2. Forward engineer the model to a database
3. Add a column to the table
4. Run the Schema Diff Report and watch it crash right at the end

Suggested fix:
The Schema Diff Report should work and display the differences between the model and the database.
[7 Apr 2008 13:11] MySQL Verification Team
Thank you for the bug report.

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

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at DbMySQLDiffReporting.generate_report(DbMySQLDiffReporting* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , MYX_GRT_VALUE* , MYX_GRT_VALUE* )
   at MySQL.GUI.Workbench.Plugins.DbMySQL.DbMySQLDiffReporting.generate_report(String left_file, String right_file, GrtValue left_cat, GrtValue right_cat)
   at MySQL.GUI.Workbench.Plugins.DbMySQL.DiffReportingWizardPages.InitGeneratedScriptPage()
   at MySQL.GUI.Workbench.Plugins.WizardPlugin.InitializeActivePage()
<cut>
[9 Apr 2008 13:40] MySQL Verification Team
Showing Exception

Attachment: schema_diff.PNG (image/png, text), 65.20 KiB.

[11 Apr 2008 14:26] Johannes Taxacher
this is fixed. (tested in SVN Rev 3049)
[14 Apr 2008 12:09] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=36056 has been marked as duplicate
of this bug.
[11 May 2008 0:59] Paul DuBois
Noted in 5.0.18 changelog.

Creating a Schema Diff Report from the local model to a live database
caused a crash.
[19 Jun 2008 19:27] MySQL Verification Team
I am able to reproduce this error with 5.0.22 SE, doing Live Server to Live Server.

When the two servers are the same, the "Right Catalog" contains duplicates for each schema. If I choose the first of the pair, the report completes correctly. If I choose the second, the application crashes.
[23 Jun 2008 14:53] Johannes Taxacher
the special case (using "Live server" on both comparison sides) is fixed too. Fix will be in 5.0.23
[10 Jul 2008 16:32] Tony Bedford
An entry has been added to the 5.0.23 changelog:

When creating a Schema Diff Report from the local model to a live database, the wizard crashes with an unhandled exception.