Bug #51892 Workbench crash when synking from design mode to db
Submitted: 9 Mar 2010 20:53 Modified: 26 Mar 2010 11:37
Reporter: danie van ophem Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.16 OS:Windows (windows 2003 and 7)
Assigned to: Alexander Musienko CPU Architecture:Any

[9 Mar 2010 20:53] danie van ophem
Description:
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:
when synchronizing design mode to db:

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';

CREATE SCHEMA IF NOT EXISTS `projectarchery` DEFAULT CHARACTER SET latin1 ;

CREATE SCHEMA IF NOT EXISTS `projectarchery` DEFAULT CHARACTER SET latin1 ;

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

-- Table `projectarchery`.`address`

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

CREATE  TABLE IF NOT EXISTS `projectarchery`.`address` (

  `AddressID` INT(11) NOT NULL AUTO_INCREMENT ,

  `City` VARCHAR(45) NOT NULL ,

  `StreetOne` VARCHAR(45) NOT NULL ,

  `StreetTwo` VARCHAR(45) NULL DEFAULT NULL ,

  `ZipCode` VARCHAR(45) NOT NULL ,

  `Country` VARCHAR(45) NOT NULL ,

  `State` VARCHAR(45) NOT NULL ,

  PRIMARY KEY (`AddressID`) )

ENGINE = InnoDB

DEFAULT CHARACTER SET = latin1;

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

-- Table `projectarchery`.`club`

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

CREATE  TABLE IF NOT EXISTS `projectarchery`.`club` (

  `ClubID` INT(11) NOT NULL ,

  `Name` VARCHAR(45) NOT NULL ,

  `AddressID` INT(11) NOT NULL ,

  `E-Mail` VARCHAR(45) NOT NULL ,

  `Website` VARCHAR(45) NOT NULL ,

  PRIMARY KEY (`ClubID`) ,

  INDEX `Address` (`AddressID` ASC) ,

  INDEX `address` (`AddressID` ASC) ,

  CONSTRAINT `address`

    FOREIGN KEY (`AddressID` )

    REFERENCES `projectarchery`.`address` (`AddressID` )

    ON DELETE NO ACTION

    ON UPDATE NO ACTION)

ENGINE = InnoDB

DEFAULT CHARACTER SET = latin1;

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

-- Table `projectarchery`.`members`

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

CREATE  TABLE IF NOT EXISTS `projectarchery`.`members` (

  `MembersID` INT(11) NOT NULL ,

  `ClubID` INT(11) NOT NULL ,

  `Name` VARCHAR(45) NOT NULL ,

  `LastName` VARCHAR(45) NOT NULL ,

  `DateOfBirth` DATETIME NOT NULL ,

  `MemberIdNumber` VARCHAR(45) NOT NULL ,

  `AddressID` INT(11) NOT NULL ,

  `Admin` TINYINT(1) NOT NULL ,

  PRIMARY KEY (`MembersID`) ,

  INDEX `Adress` (`AddressID` ASC) ,

  INDEX `Club` (`ClubID` ASC) ,

  INDEX `address` (`AddressID` ASC) ,

  INDEX `club` (`ClubID` ASC) ,

  CONSTRAINT `address`

    FOREIGN KEY (`AddressID` )

    REFERENCES `projectarchery`.`address` (`AddressID` )

    ON DELETE NO ACTION

    ON UPDATE NO ACTION,

  CONSTRAINT `club`

    FOREIGN KEY (`ClubID` )

    REFERENCES `projectarchery`.`club` (`ClubID` )

    ON DELETE NO ACTION

    ON UPDATE NO ACTION)

ENGINE = InnoDB

DEFAULT CHARACTER SET = latin1;

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

-- Table `projectarchery`.`accounts`

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

CREATE  TABLE IF NOT EXISTS `projectarchery`.`accounts` (

  `AccountID` INT(11) NOT NULL AUTO_INCREMENT ,

  `E-mail` VARCHAR(45) NOT NULL ,

  `Password` VARCHAR(45) NOT NULL ,

  `MemberID` INT(11) NOT NULL ,

  PRIMARY KEY (`AccountID`) ,

  INDEX `SiteMember` (`MemberID` ASC) ,

  INDEX `Member` (`MemberID` ASC) ,

  CONSTRAINT `Member`

    FOREIGN KEY (`MemberID` )

    REFERENCES `projectarchery`.`members` (`MembersID` )

    ON DELETE NO ACTION

    ON UPDATE NO ACTION)

ENGINE = InnoDB

DEFAULT CHARACTER SET = latin1;

SET SQL_MODE=@OLD_SQL_MODE;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Suggested fix:
have no idea
[9 Mar 2010 20:54] danie van ophem
project file

Attachment: ProjectArchery-DB-Design.mwb (application/octet-stream, text), 14.95 KiB.

[9 Mar 2010 21:30] danie van ophem
this bug happens when you have multiple tables with a Foreign key with the same name. 
so just give each key a different name and bug is fixed.
[10 Mar 2010 18:07] Johannes Taxacher
while i needed to modify the script posted in this bug to avoid duplicate key names (otherwise i wouldn't have been able to put that schema onto a server instance) i could repeat the crash when trying to sync the model file provided.
[24 Mar 2010 10:52] Johannes Taxacher
crash fixed in repository.
but please note that using multiple schemas with same name (only different cases) might (most probably will) lead to unwanted side-effects not only for synching.
[26 Mar 2010 11:37] Tony Bedford
An entry has been added to the 5.2.17 changelog:

MySQL Workbench crashed when synchronizing a model to a live server.