Bug #61939 MySQL workbench crashes on Forward engineer SQL ALTER script
Submitted: 21 Jul 2011 8:32 Modified: 2 Sep 2014 21:51
Reporter: Pehmo Lelu Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:5.2.34 CE Revision 7780 OS:Windows (7)
Assigned to: CPU Architecture:Any
Tags: alter, crash, model

[21 Jul 2011 8:32] Pehmo Lelu
Description:
I don't know why, but my MySQL workbench just crashes every time I try to go to File - Export - Forward engineers SQL alter script - choose sql file and click next. Then windows says it stopped working and shuts down.

Im using the .NET 4 framework.

My co-worker has exactly the same problem on different computer. We just downloaded the fresh copies and also had to download the Microsoft Visual C++ 2010 Redistributable Package (x86) from http://wb.mysql.com/workbench/wb52_prerequisites.php

My other co-worker is using older version of workbench on mac and he doesn't have this problem. Im not exactly sure what version it was but I think it was around version 5.2.27-5.2.29

How to repeat:
I created new EER Model on home page, click Add diagram on model overview, add 1 table with id idtable1, save and take the File - Export - Forward engineer SQL CREATE script... and then just click next and next to get the create script and it gives this script (I have also tried ticking on the Generate DROP statements, with no effect but just wanted to add that aswell):

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;

SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

DROP SCHEMA IF EXISTS `mydb` ;

CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;

USE `mydb` ;

-- -----------------------------------------------------

-- Table `mydb`.`table1`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `mydb`.`table1` ;

CREATE  TABLE IF NOT EXISTS `mydb`.`table1` (

  `idtable1` INT NOT NULL ,

  PRIMARY KEY (`idtable1`) )

ENGINE = InnoDB;

SET SQL_MODE=@OLD_SQL_MODE;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Ok so it seems like fine SQL.

Then I just add new table to that same model and save. Then I go to File - Export - Forward engineer SQL ALTER script... . Now it asks me for input and output file. I created the database and table with that previous SQL script and then took a mysqldump. I chose the sqldump file I just created as input file and click next. The next page on that dialog opens but the inside of the textarea in which the alter script should appear is just white and after 1 second whole program freezes and windows says it has stopped working. No error messages or anything. Just plain close program button.

I have also tried just generating the alter script from the create file aswell but its still the same problem.

Other weird thing was that when I chose browse on the output file it wanted me to select a file. I couldnt just write a file name to file name field and press open because it didnt exists... 

Suggested fix:
I have no suggested fix really, but a way around getting the actual SQL Alter script. Just have to choose the File - Export - Synchronize with SQL Create script. Then create EER Model from SQL script (dump file) and put the file there to the input field and click next. (This page also allows me to select a file that does not exist in the output file but then it wont allow me to click next button!). So I click now next with the output file name empty and get the changes list. Then I just click next and I get the alter scripts I wanted. Then in that window I can save it to file by clicking the save to file button.

Just wanted to offer solution for those with same problem.
[25 Aug 2011 13:35] Armando Lopez Valencia
Thank you very much for your report.
[2 Sep 2014 21:51] Alfredo Kojima
No longer repeatable