Bug #60751 Application cut last lines from sql export file
Submitted: 4 Apr 2011 9:43 Modified: 18 May 2011 2:08
Reporter: Marek Rodkiewicz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.33 OS:MacOS (10.5.8)
Assigned to: CPU Architecture:Any
Tags: sql export file

[4 Apr 2011 9:43] Marek Rodkiewicz
Description:
orward Engineer SQL Script wizard creates valid file until last button "Finish" will be pressed. Pressing Finish button couses cutting last lines (about 2.5 lines) from output sql file.

For instance output sql file:

--------before Finish button pressed (step: Review and edit the generated script and press Finish to save.)
[..]
INSERT INTO `databasename`.`messages` (`id`, `name`, `title`, `content`, `mestype_id`, `created`, `modified`, `lang`) VALUES (7, 'error', 'Błąd systemu', '<p>Wystąpił błąd:</p>\n<p>[=details=]</p>\n<p>Located: [=file=]:[=line=]</p>', 1, NULL, NULL, 'pol');
INSERT INTO `databasename`.`messages` (`id`, `name`, `title`, `content`, `mestype_id`, `created`, `modified`, `lang`) VALUES (8, 'custom', 'Wiadomość', '[=body=]', 1, NULL, NULL, 'pol');

COMMIT;

--------after Finish button. Close Forward Engineer SQL Script wizard
[..]
INSERT INTO `databasename`.`messages` (`id`, `name`, `title`, `content`, `mestype_id`, `created`, `modified`, `lang`) VALUES (7, 'error', 'Błąd systemu', '<p>Wystąpił błąd:</p>\n<p>[=details=]</p>\n<p>Located: [=file=]:[=line=]</p>', 1, NULL, NULL, 'pol');
INSERT INTO `databasename`.`messages` (`id`, `name`, `title`, `content`, `mestype_id`, `created`, `modified`, `lang`) VALUES (8, 'custom', 'Wiadomość', '[=body=]', 1, NULL, NU

Tested on two independents databases - same results.
This behavior appears only with objects inserts to output file checked. 

How to repeat:
1. Open some database with some inserts (output sql file in my case at least 220 lines).
2. File->Export->Forward Engineer SQL CREATE Script ...
4. 
-Enter path to output file
-Check all checkboxes except Omit Schema Qualifier in Object Names, Generate USE statements, Do Not Create User.
-Continue
5. Dialog: click Replace if output file exists
6. Check export mysql table objects and Export user objects. Click continue
7. In preview and output file (e.g. in notepad) you will see nice sql script.
And now when you click Finish button, wizard cutes about 2.5 last lines from output file.

Suggested fix:
I don't know. Maybe some buffer in last step is overflowed. 
In version 5.2.3 this process worked fine.
[5 Apr 2011 16:03] Valeriy Kravchuk
Verified just as described. The workaround is to copy/paste script while it is not truncated (before clicking on Finish button).
[18 May 2011 2:08] Paul DuBois
Noted in 5.2.34 changelog.

Forward Engineer SQL Script wizard wrote incomplete output.