Bug #52576 alter a table creating my third foreign key in workbench
Submitted: 3 Apr 2010 21:15 Modified: 4 May 2010 8:56
Reporter: Osmondsql Ara Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.16-beta OS:Windows (windows 7)
Assigned to: CPU Architecture:Any
Tags: creating database, foreign key, mysql-workbench-oss-5.2.16-beta-win32, workbench

[3 Apr 2010 21:15] Osmondsql Ara
Description:
Exception = System.Runtime.InteropServices.SEHException
Message = Componente externo acionou uma exceção.
FullText = System.Runtime.InteropServices.SEHException: Componente externo acionou uma exceção.
   em bec.FKConstraintColumnsListBE.get_column_is_fk(FKConstraintColumnsListBE* , NodeId* )
   em MySQL.Grt.Db.FKConstraintColumnsListBE.get_column_is_fk(NodeId node)
   em MySQL.GUI.Workbench.Plugins.DbMysqlTableFkColumnListModel.columnEnabledFkNodeControl_CheckStateChanged(Object sender, TreePathEventArgs e)
   em System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   em Aga.Controls.Tree.NodeControls.NodeCheckBox.OnCheckStateChanged(TreePathEventArgs args)
   em Aga.Controls.Tree.NodeControls.NodeCheckBox.OnCheckStateChanged(TreeNodeAdv node)
   em Aga.Controls.Tree.NodeControls.NodeCheckBox.SetCheckState(TreeNodeAdv node, CheckState value)
   em Aga.Controls.Tree.NodeControls.NodeCheckBox.MouseDown(TreeNodeAdvMouseEventArgs args)
   em Aga.Controls.Tree.TreeViewAdv.OnMouseDown(MouseEventArgs e)
   em System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   em System.Windows.Forms.Control.WndProc(Message& m)
   em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   em System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

How to repeat:
I try was creating a database with 6 tables, where one(processo) has 3 foreigns keys.

I was trying append the third (fkinteressado from table processo to table interessado) when it occurs. 

I already had tied fkstatus to table status and fkservidor to table servidor. 

I´m going to append my last sql backup before the crash. Good luck !!!
=================================================================
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 ;
DROP SCHEMA IF EXISTS `gir` ;
CREATE SCHEMA IF NOT EXISTS `gir` DEFAULT CHARACTER SET latin1 ;

-- -----------------------------------------------------
-- Table `gir`.`cargo`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`cargo` ;

CREATE  TABLE IF NOT EXISTS `gir`.`cargo` (
  `idcargo` INT(10) UNSIGNED NOT NULL ,
  `descr_cargo` VARCHAR(25) NOT NULL ,
  PRIMARY KEY (`idcargo`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;

CREATE UNIQUE INDEX `idcargo_UNIQUE` ON `gir`.`cargo` (`idcargo` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`historico`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`historico` ;

CREATE  TABLE IF NOT EXISTS `gir`.`historico` (
  `idhistorico` INT(11) NOT NULL AUTO_INCREMENT ,
  `fkinteressado` INT(11) NOT NULL ,
  PRIMARY KEY (`idhistorico`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;

CREATE UNIQUE INDEX `idhistorico_UNIQUE` ON `gir`.`historico` (`idhistorico` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`interessado`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`interessado` ;

CREATE  TABLE IF NOT EXISTS `gir`.`interessado` (
  `idinteressado` BIGINT(16) UNSIGNED NOT NULL ,
  `nome` VARCHAR(45) NULL DEFAULT NULL ,
  `fkhistorico` INT(10) UNSIGNED NOT NULL ,
  PRIMARY KEY (`idinteressado`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;

CREATE UNIQUE INDEX `idinteressado_UNIQUE` ON `gir`.`interessado` (`idinteressado` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`servidor`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`servidor` ;

CREATE  TABLE IF NOT EXISTS `gir`.`servidor` (
  `idservidor` INT UNSIGNED NOT NULL ,
  `nome` VARCHAR(30) NULL DEFAULT NULL ,
  `apelido` VARCHAR(20) NULL DEFAULT NULL ,
  `matric` INT(11) NULL DEFAULT NULL ,
  `ramal` VARCHAR(4) NULL DEFAULT NULL ,
  `ramal2` VARCHAR(4) NULL DEFAULT NULL ,
  `fkcargo` INT(10) UNSIGNED NOT NULL ,
  `nascim` DATE NULL DEFAULT NULL ,
  `dias_cred` INT(11) NULL DEFAULT NULL ,
  `email1` VARCHAR(25) NULL DEFAULT 'não tem email' ,
  `email2` VARCHAR(25) NULL DEFAULT NULL ,
  PRIMARY KEY (`idservidor`) ,
  CONSTRAINT `idcargo`
    FOREIGN KEY (`fkcargo` )
    REFERENCES `gir`.`cargo` (`idcargo` ))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;

CREATE UNIQUE INDEX `id_UNIQUE` ON `gir`.`servidor` (`idservidor` ASC) ;

CREATE INDEX `idcargo` ON `gir`.`servidor` (`fkcargo` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`status`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`status` ;

CREATE  TABLE IF NOT EXISTS `gir`.`status` (
  `idstatus` INT UNSIGNED NOT NULL ,
  `descr` VARCHAR(15) NOT NULL ,
  PRIMARY KEY (`idstatus`) )
ENGINE = InnoDB;

CREATE UNIQUE INDEX `idstatus_UNIQUE` ON `gir`.`status` (`idstatus` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`processo`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`processo` ;

CREATE  TABLE IF NOT EXISTS `gir`.`processo` (
  `iddta` INT UNSIGNED NOT NULL ,
  `idnum` INT UNSIGNED NOT NULL ,
  `tipo` INT UNSIGNED NOT NULL ,
  `dta_protocolizada` DATE NOT NULL ,
  `dtault_entrada` DATE NOT NULL ,
  `tipo_cpfcnpj_interessado` INT(11) NOT NULL ,
  `fkinteressado` BIGINT(16) NOT NULL ,
  `fkservidor` INT UNSIGNED NOT NULL ,
  `fkstatus` INT UNSIGNED NOT NULL ,
  PRIMARY KEY (`iddta`, `idnum`) ,
  CONSTRAINT `idservidor`
    FOREIGN KEY (`fkservidor` )
    REFERENCES `gir`.`servidor` (`idservidor` )
    ON DELETE RESTRICT
    ON UPDATE RESTRICT,
  CONSTRAINT `idstatus`
    FOREIGN KEY (`fkstatus` )
    REFERENCES `gir`.`status` (`idstatus` )
    ON DELETE RESTRICT
    ON UPDATE RESTRICT)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;

CREATE INDEX `idservidor` ON `gir`.`processo` (`fkservidor` ASC) ;

CREATE INDEX `idstatus` ON `gir`.`processo` (`fkstatus` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`usuario`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`usuario` ;

CREATE  TABLE IF NOT EXISTS `gir`.`usuario` (
  `idusuario` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
  `nome` VARCHAR(45) NOT NULL ,
  `login` VARCHAR(20) NOT NULL ,
  `senha` VARCHAR(20) NOT NULL ,
  `nivel` INT(11) NOT NULL DEFAULT '0' ,
  PRIMARY KEY (`idusuario`) )
ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARACTER SET = latin1;

CREATE UNIQUE INDEX `idusuario_UNIQUE` ON `gir`.`usuario` (`idusuario` ASC) ;

-- -----------------------------------------------------
-- Table `gir`.`status2`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gir`.`status2` ;

CREATE  TABLE IF NOT EXISTS `gir`.`status2` (
  `idstatus` INT UNSIGNED NOT NULL ,
  `descr` VARCHAR(15) NOT NULL DEFAULT 'status ignorado' ,
  PRIMARY KEY (`idstatus`) )
ENGINE = InnoDB
COMMENT = '\n';

CREATE UNIQUE INDEX `idstatus_UNIQUE` ON `gir`.`status2` (`idstatus` ASC) ;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
[4 Apr 2010 8:57] Valeriy Kravchuk
Thank you for the problem report. Please, check with a newer version, 5.2.17, and inform about the results.
[4 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".