Bug #37393 Generate Schema Diff Report Crash
Submitted: 13 Jun 2008 11:53 Modified: 10 Jul 2008 16:58
Reporter: Pablo Ros Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.22 SE Revision: 3118 OS:Microsoft Windows (Windows XP Professional)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: Generate Schema Diff Report, MySQL Workbench
Triage: D2 (Serious)

[13 Jun 2008 11:53] Pablo Ros
Description:
Hello,
MySQL Workbench generates one message error when I try to "Generate Schema Diff Report".
I execute "Reverse Engineer" and export my database to MySQL Workbench. I modified some tables and create new Foreign Keys.

I have these tables in my model: "age", "best_today", "brand", "Desc_desc", "extra".

After that, I execute "Generate Schema Diff Report" and it throws the message error. But if I delete the table "extra" it works fine.

The message error is:
____________________________________________________________________________
Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración 
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.AccessViolationException: Intento de leer o escribir en la memoria protegida. A menudo, esto indica que hay otra memoria dañada.
   en 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* )
   en MySQL.GUI.Workbench.Plugins.DbMySQL.DbMySQLDiffReporting.generate_report(String left_file, String right_file, GrtValue left_cat, GrtValue right_cat)
   en MySQL.GUI.Workbench.Plugins.DbMySQL.DiffReportingWizardPages.InitGeneratedScriptPage()
   en MySQL.GUI.Workbench.Plugins.WizardPlugin.InitializeActivePage()
   en MySQL.GUI.Workbench.Plugins.WizardPlugin.UpdateAfterPageProcessing(String errMsg)
   en MySQL.GUI.Workbench.Plugins.WizardPlugin.RestoreControlsState(String errMsg)
   en MySQL.GUI.Workbench.Plugins.WizardPlugin.GoToNextPage()
   en MySQL.GUI.Workbench.Plugins.WizardPlugin.btnNext_Click(Object sender, EventArgs e)
   en System.Windows.Forms.Control.OnClick(EventArgs e)
   en System.Windows.Forms.Button.OnClick(EventArgs e)
   en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.ButtonBase.WndProc(Message& m)
   en System.Windows.Forms.Button.WndProc(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Ensamblados cargados **************
mscorlib
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Versión del ensamblado: 5.0.22.3118
    Versión Win32: 5.0.22.3118
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/MySQLWorkbench.exe
----------------------------------------
wb.wr
    Versión del ensamblado: 0.0.0.0
    Versión Win32: 
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/wb.wr.DLL
----------------------------------------
grt.wr
    Versión del ensamblado: 0.0.0.0
    Versión Win32: 
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/grt.wr.DLL
----------------------------------------
System.Windows.Forms
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
MySQLCsUtilities
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/MySQLCsUtilities.DLL
----------------------------------------
msvcm80
    Versión del ensamblado: 8.0.50727.1433
    Versión Win32: 8.00.50727.1433
    Código base: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2/msvcm80.dll
----------------------------------------
MySQLGrtShell
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/MySQLGrtShell.EXE
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Versión del ensamblado: 2.2.3068.26230
    Versión Win32: 2.2.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
MySQLWorkbenchEditors
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/MySQLWorkbenchEditors.DLL
----------------------------------------
Aga.Controls
    Versión del ensamblado: 1.6.0.0
    Versión Win32: 1.6.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/Aga.Controls.DLL
----------------------------------------
System.Windows.Forms.resources
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.42 (RTM.050727-4200)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
grt.helpers.be
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/grt.helpers.be.DLL
----------------------------------------
mscorlib.resources
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
db.mysql.diff.reporting.wbp.fe
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/db.mysql.diff.reporting.wbp.fe.DLL
----------------------------------------
db.mysql.diff.reporting.wbp.wr
    Versión del ensamblado: 0.0.0.0
    Versión Win32: 
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/db.mysql.diff.reporting.wbp.wr.DLL
----------------------------------------
db.wbp.wr
    Versión del ensamblado: 0.0.0.0
    Versión Win32: 
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/db.wbp.wr.DLL
----------------------------------------
db.mysql.wbp.wr
    Versión del ensamblado: 0.0.0.0
    Versión Win32: 
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/db.mysql.wbp.wr.DLL
----------------------------------------
db.wbp.fe
    Versión del ensamblado: 1.0.0.0
    Versión Win32: 1.0.0.0
    Código base: file:///C:/Archivos%20de%20programa/MySQL/MySQL%20Workbench%205.0%20SE/db.wbp.fe.DLL
----------------------------------------
System.Xml
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.1433 (REDBITS.050727-1400)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
...

How to repeat:
This is DDL script:

CREATE DATABASE `bbdd` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `bbdd`;
CREATE TABLE `age` (
  `id_age` tinyint(1) unsigned NOT NULL COMMENT 'Age ID.',
  `description` varchar(100) default NULL COMMENT 'Description age',
  PRIMARY KEY  (`id_age`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Descriptions of age';

USE `bbdd`;
CREATE TABLE `best_today` (
  `id_section` smallint(5) unsigned NOT NULL default '0',
  `id_file` int(11) unsigned NOT NULL default '0',
  `mobile` bigint(32) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id_section`,`mobile`),
  UNIQUE KEY `id_section` (`mobile`,`id_section`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

USE `bbdd`;
CREATE TABLE `brand` (
  `id_brand` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`id_brand`)
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;

USE `bbdd`;
CREATE TABLE `desc_desc` (
  `id_desc1` int(11) unsigned default '0',
  `id_desc2` int(11) unsigned default '0',
  KEY `id_desc1` (`id_desc1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

USE `bbdd`;
CREATE TABLE `extra` (
  `id_file` int(11) unsigned NOT NULL default '0',
  `note` text,
  `requirement_min_extra` text,
  `requirement_rec_extra` text,
  `limitation` text,
  `improvement` text,
  `internal` text,
  KEY `id_file` (`id_file`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

I modified some fields, add comments and create foreign keys.

After that, I execute "Generate Schema Diff Report" and it throws the message error. 

But if I delete the table "extra" it works fine again.
[13 Jun 2008 13:58] Miguel Solorzano
Thank you for the bug report. Could you please specified what modification you did in the tables (I did some changes, added/modified comments and not luck to repeat). Thanks in advance.
[13 Jun 2008 14:20] Johannes Taxacher
maybe you could upload your MWB file for us to repeat.

thx in advance
[16 Jun 2008 11:13] Pablo Ros
MWD used to repeat the bug

Attachment: bug_37393.mwb (application/octet-stream, text), 5.92 KiB.

[16 Jun 2008 11:15] Pablo Ros
Hello,
Thanks for your quick answers. I have attached the mwb in the bug database.
http://bugs.mysql.com/file.php?id=9502

If you try to execute the “generate schema diff report” ,  it fails. But if you delete the extra table the report builds correctly.

I 'm attaching  again the database schema:

CREATE DATABASE `bbdd` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `bbdd`;

CREATE TABLE `age` (

 `id_age` tinyint(1) unsigned NOT NULL COMMENT 'Age ID.',

 `description` varchar(100) default NULL COMMENT 'Description age',

 PRIMARY KEY  (`id_age`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Descriptions of age';

USE `bbdd`;

CREATE TABLE `best_today` (

 `id_section` smallint(5) unsigned NOT NULL default '0',

 `id_file` int(11) unsigned NOT NULL default '0',

 `mobile` bigint(32) unsigned NOT NULL default '0',

 PRIMARY KEY  (`id_section`,`mobile`),

 UNIQUE KEY `id_section` (`mobile`,`id_section`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

USE `bbdd`;

CREATE TABLE `brand` (

 `id_brand` int(11) unsigned NOT NULL auto_increment,

 `name` varchar(100) NOT NULL default '',

 PRIMARY KEY  (`id_brand`)

) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;

 

USE `bbdd`;

CREATE TABLE `desc_desc` (

 `id_desc1` int(11) unsigned default '0',

 `id_desc2` int(11) unsigned default '0',

 KEY `id_desc1` (`id_desc1`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

USE `bbdd`;

CREATE TABLE `extra` (

 `id_file` int(11) unsigned NOT NULL default '0',

 `note` text,

 `requirement_min_extra` text,

 `requirement_rec_extra` text,

 `limitation` text,

 `improvement` text,

 `internal` text,

 KEY `id_file` (`id_file`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 
Thanks again!
Kind regards!
[16 Jun 2008 14:56] Miguel Solorzano
Thank you for the feedback.

Consulte o final desta mensagem para obter detalhes sobre como chamar a 
depuração just-in-time (JIT) em vez desta caixa de diálogo.

************** Texto de Exceção **************
System.AccessViolationException: Tentativa de leitura ou gravação em memória protegida. Normalmente, isso é uma indicação de que outra memória está danificada.
   em 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* )
   em MySQL.GUI.Workbench.Plugins.DbMySQL.DbMySQLDiffReporting.generate_report(String left_file, String right_file, GrtValue left_cat, GrtValue right_cat)
   em MySQL.GUI.Workbench.Plugins.DbMySQL.DiffReportingWizardPages.InitGeneratedScriptPage()
   em MySQL.GUI.Workbench.Plugins.WizardPlugin.InitializeActivePage()
   em MySQL.GUI.Workbench.Plugins.WizardPlugin.UpdateAfterPageProcessing(String errMsg)
   em MySQL.GUI.Workbench.Plugins.WizardPlugin.RestoreControlsState(String errMsg)
   em MySQL.GUI.Workbench.Plugins.WizardPlugin.GoToNextPage()
   em MySQL.GUI.Workbench.Plugins.WizardPlugin.btnNext_Click(Object sender, EventArgs e)
   em System.Windows.Forms.Control.OnClick(EventArgs e)
   em System.Windows.Forms.Button.OnClick(EventArgs e)
   em System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  <cut>
[23 Jun 2008 21:04] Johannes Taxacher
the crash was invoked by improper handling of an invalid FK in table `extra`. while this issue is correctly reported by a validation module in SE edition schema diff report didn't handle that correctly.
this issue is fixed for 5.0.23
[27 Jun 2008 6:27] Jonathan Adami
liar (just kidding ;))

Actually, I had exactly the same problem with the 5.0.22, I upgraded to the 5.0.23 and still the same problem ... Diff bring me a JIT Error with a wrong access to memory !

I added a lot of foreign keys, modified some tables structures, deleted some tables .... In a 188 tables schema that I can't send you because it's a private database structure.

Hope it'll be fixed one day because for us MWB is a very usefull tool !

Thank you !
[10 Jul 2008 16:58] Tony Bedford
An entry was added to the 5.023 changelog:

Using Generate Schema Diff Report resulted in a crash. The crash was caused by improper handling of an invalid FK in a table. While this issue is correctly reported by a validation module, in Standard Edition Generate Schema Diff Report didn't handle that correctly.