Bug #66590 Workbench executes script passed on the commandline twice?
Submitted: 29 Aug 2012 12:12 Modified: 26 Nov 2012 3:28
Reporter: Craig Fowler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.42 OS:Linux (Debian testing)
Assigned to: CPU Architecture:Any
Tags: cli, scripting

[29 Aug 2012 12:12] Craig Fowler
Description:
When executing a script from the commandline it appears that the script is executed twice.  For example a simple python script that prints the text "Oh dear . . ." to STDOUT prints "Oh dear . . .Oh dear . . ."

How to repeat:
Here is the commandline I used to reproduce this:

mysql-workbench --log-level=debug3 --quit-when-done --run "print 'Oh dear . . .'"

---

The output I received from this was:

Initializing AdvancedSidebar factory method
Initializing mforms factory
** Message: Gnome keyring daemon seems to not be available. Stored passwords will be lost once quit
Creating WBOptions
Logger set to level 'debug3'. '0111111'
/bin/sh: 1: ifconfig: not found
Ready.

** Message: overview.home built-in command is being overwritten
Oh dear . . .Oh dear . . .

SystemError: null argument to internal routine
[29 Aug 2012 13:27] Valeriy Kravchuk
Does not happen to me on Windows:

C:\Program Files\MySQL\MySQL Workbench 5.2 CE>MySQLWorkbench.exe -log-level=debu
g3 -quit-when-done -run "print 'Oh dear . . .'"

C:\Program Files\MySQL\MySQL Workbench 5.2 CE>Logger set to level 'debug3'. '011
1111'
Oh dear . . .

C:\Program Files\MySQL\MySQL Workbench 5.2 CE>
[30 Aug 2012 19:32] MySQL Verification Team
Verified on Centos 6.2:

[miguel@izalco ~]$ mysql-workbench --log-level=debug3 --quit-when-done --run "print 'Oh dear . . .'"
Initializing AdvancedSidebar factory method
Initializing mforms factory
Creating WBOptions
Logger set to level 'debug3'. '0111111'
Ready.

** Message: overview.home built-in command is being overwritten
Oh dear . . .Oh dear . . .

SystemError: null argument to internal routine
[miguel@izalco ~]$
[10 Sep 2012 12:19] Nik Mik
i think, option
--log-level=debug3
will duplicate it
[10 Sep 2012 12:48] Sergio Andres De La Cruz Rodriguez
It seems that the real issue is a duplication of the output to stdout and not 
that the script is run two times. The actual script is only run once, as 
expected. I have tried this: 

mysql-workbench --quit-when-done --log-level=DEBUG3 --run "import 
random;f=open('/tmp/file_%d' % random.randint(10000,99999), 'w');f.close()" 

If it were run twice, there should be two /tmp/file_* files created but I get 
only one.
[26 Nov 2012 3:28] Philip Olson
Fixed as of the upcoming MySQL Workbench 5.2.45, and here's the changelog entry:

 On Linux, executing MySQL Workbench from the command-line would print
 "stdout" twice.

Thank you for the bug report.