Bug #26471 generated request for two tables (many to many relation) bad request generated
Submitted: 18 Feb 2007 13:55 Modified: 19 Feb 2007 9:25
Reporter: Shaman Shaman Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Workbench Preview Severity:S1 (Critical)
Version:1.1.8alpha OS:Linux (linux)
Assigned to: CPU Architecture:Any
Tags: many to many relation ; bad script generated ; crash

[18 Feb 2007 13:55] Shaman Shaman
Description:
First BUG :
++++++++++++

design 2 tables 'A' and 'B'
and make a relation as  : 'A has many B'and 'B has many A'

the generated script is this one :

======================================================
CREATE TABLE `test`.`A` (
  `primaryID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`primaryID`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `test`.`B` (
  `primaryID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`primaryID`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `test`.`A_has_B` (
  `FKAprimaryID`  NOT NULL,
  `FKBprimaryID`  NOT NULL,
  CONSTRAINT `FKA` FOREIGN KEY `FKA` (`FKAprimaryID`)
    REFERENCES `test`.`A` (`primaryID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `FKB` FOREIGN KEY `FKB` (`FKBprimaryID`)
    REFERENCES `test`.`B` (`primaryID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION
)
ENGINE = InnoDB;
======================================================

I )  As you can see the table which is created 'A_has_B' has two keys, ok, but the datatype is messing ! so this script cannot work and generates an error.

II ) the keys are not marked as primary key in 'A_has_B'

Second bug (linked whith the first one).
++++++++++++++++++++++++++++++++++++++++++
I try to modify the middle table 'A_has_B' in order to put the missing data type:
1) the data type are not listed when tab in the column
2) if i cut/past the datatype of another key INT(11) the application crashed 
 

How to repeat:
First BUG :
++++++++++++

1) design 2 tables 'A' and 'B'

2) make a relation as  : 'A has many B'and 'B has many A'

3) menu-->Synchronise

==> generated script is a bad script

Second bug (linked whith the first one).
++++++++++++++++++++++++++++++++++++++++++
I try to modify the table 'A_has_B' in order to put the missing data types :

1) when typing int the table editor the data type are not listed

2) if i put by "cutting and pasting" the datatype of another key INT(11) 

=====> the application is crashing.
[19 Feb 2007 9:25] Sveta Smirnova
Thank you for the report.

Verified as described using current version.