Bug #41559 Wrong insert order in last versions
Submitted: 17 Dec 2008 16:01 Modified: 15 Jan 2009 14:09
Reporter: moi meme Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.29 OS:Any
Assigned to: CPU Architecture:Any

[17 Dec 2008 16:01] moi meme
Description:
Few versions ago, inserts where generated after each corresponding create table.

You changed that recently and since, insert are generated at the end of the script.

But the order does not consider foreign keys. So some inserts can fails since they depends on another insert few lines under.

How to repeat:
Export my database (see attached file).
[12 Jan 2009 14:14] Susanne Ebrecht
Many thanks for writing a bug report.

Did you ever tried if the inserts really fail?

They should not fail because looking into the dump one of the first lines is:

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

This means that foreign key checks were disabled.

They will be enabled again (if they were enabled before) at the end of the script:

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

This means, your inserts should not fail, doesn't matter which order they will have.
[15 Jan 2009 14:09] moi meme
Indeed, I changed the checking values to 1.
If I left 0, what security could I have on the database coherency at the end of the script !?