Bug #70896 MySQL Workbench does not export stored routines
Submitted: 13 Nov 2013 12:01 Modified: 15 Jan 2014 0:36
Reporter: Teodor Hadjiev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:6.0.8 OS:Windows (Windows 7 x64)
Assigned to: CPU Architecture:Any

[13 Nov 2013 12:01] Teodor Hadjiev
Description:
This has caused me major headaches today. WB seems extremely buggy after having all kinds of problems working with more than just simple sql queries :( ovber the years.

After playing around with Export databases options, WB doesn't seem to export stored procedures anymore, no matter the checkbox Dump Stored Routines.
I'm selecting all databases, and at first it was dumping them in the resulting sql file, but no more in subsequent exports.

How to repeat:
I'm exporting all databases (30-40) excluding mysql and perf schema. Then I set complete inserts, extended inserts, dump stored routines, create in single transaction (one time mysqldump command as it seems), to self contained sql file, lock tables, dump date, add-locks, disable-keys, tz-utc, comments, create-options, allow-keywords, quote-names, and no no-create-info - all these options selected (excl. the last).

The first time it worked and I got 1Gig file and the one stored routine was in the file.
Then I created several backups for some tests, with the same options, and no stored routine inside the new exports, the checkbox is still selected.
The resulting command in the progress tab doesn't mention the --routines option:

Running: mysqldump.exe --defaults-extra-file="c:\users\admini~1\appdata\local\temp\tmpwdq39i.cnf"  --set-gtid-purged=OFF --max_allowed_packet=1G --host=localhost --user=root --complete-insert=TRUE --allow-keywords=TRUE --port=3306 --default-character-set=utf8 --single-transaction=TRUE --databases "test" ............

Suggested fix:
There is some bug, WB does not respect the checkbox Dump store routines in the Export window, after the first 1 or 2 exports. Even restarting the app, it doesn't include --routines in the command.

Now if I deselect the Create dump in a Single Transaction checkbox, it includes the stored routine just fine.
Earlier today, it included it in a dump even when this checkbox was selected.
[14 Nov 2013 10:39] MySQL Verification Team
Hello Teodor,

Thank you for the bug report.
I was able to reproduce this issue after 7-8 attempts, despite enabling to export routines - mysqldump didn't show --routines option.

Thanks,
Umesh
[14 Nov 2013 13:24] Teodor Hadjiev
Thanks Umesh, for not giving up after the 3 or 4th attempt.
It was odd enough that the problem persists after WB was closed and restarted.
[15 Jan 2014 0:36] Philip Olson
Fixed as of the upcoming Workbench 6.0.9 release, and here is the changelog entry:

The "--routines" command line option was missing from the generated
mysqldump command when multiple schemas were selected for a dump into a
single file backup when the routines option was enabled. This could happen
after executing the dump multiple times.

Thank you for the bug report.