Bug #33874 Import of SQL dump from phpmyadmin ignores all relationships
Submitted: 15 Jan 2008 2:08 Modified: 18 Jan 2008 17:32
Reporter: Elise Bosse Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.11 OS:Windows (Vista)
Assigned to: Sergei Tkachenko CPU Architecture:Any

[15 Jan 2008 2:08] Elise Bosse
Description:
Hi,

So I did an export of my DB from phpmyadmin. I exported the structure only, not the data, and saved it to a .sql file. The sql has the format as follows:

CREATE TABLE `Address` (
  `addressId` int(10) unsigned NOT NULL auto_increment,
  `contactId` int(10) unsigned NOT NULL default '0',
  ........
  PRIMARY KEY  (`addressId`),
  KEY `Address_FKIndex1` (`contactId`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=65468;
.
.
.
ALTER TABLE `Address`
  ADD CONSTRAINT `Address_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `Contact` (`contactId`) ON DELETE NO ACTION ON UPDATE NO ACTION);

Now when I go to Workbench and do Import -> RE MySQL create script, all the tables are imported in, and it all looks fine. But if I doubleclick on the Address table, while it shows the proper primary key and the indices, nothing is listed under the Foreign Keys tab. Likewise when I do Model -> Create Diagram from Catalog Objects, all the tables happily appear in the diagram, but there are no relationship links!

Is it something in the way I have done my export from phpmyadmin? Does it not like the "add constraint" way of doing a SQL dump file? This is really problematic...

Thanks!

How to repeat:
export table structure from phpmyadmin to sql file and import into WB
[15 Jan 2008 2:13] Elise Bosse
Oh, and I forgot to add, it also imports the tables (there are 91 in total) in a very long skinny fashion so that  the diagram is only 1.5 pages wide but 10 pages high... rather inconvenient to deal with... Thanks.
[18 Jan 2008 5:52] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.12, and inform about the results.
[18 Jan 2008 6:13] Elise Bosse
Hello,

I've just downloaded and tested 5.0.12 and unfortunately it behaves in the exact same manner as 5.0.11 - no relationships are drawn.

Moreover (and this happens in 5.0.11 too but I didn't say it before - I think other bugs may have been posted that may be the same thing) if I use the zoom slider at top right, if I even go below 70, all the tables disappear, you cna't access them anymore. If you use the slider to go up and down for the Model canvas, you can see the edges of the tables going up and down at far left, but you can't slide the canvas over to the left to get to them. The up and down slider also doesn't work to go all the way to the bottom of my giant 10 page long canvas.

Thanks!
[18 Jan 2008 17:32] Sergei Tkachenko
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.