Bug #43721 WB outputs error when passing an sql file name as parameter
Submitted: 18 Mar 2009 7:39 Modified: 30 Jul 2013 22:20
Reporter: dolzenko dolzenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.10 OS:Windows
Assigned to: Mike Lischke CPU Architecture:Any
Tags: regression

[18 Mar 2009 7:39] dolzenko dolzenko
Description:
Query Browser crashes when passed script name on command line, which consequently makes it impossible to associate *.sql files with Query Browser and open them directly from Windows Explorer.
The resulting crash is extremely inconvenient to user because multiple error messages appear.

How to repeat:
In "C:\Program Files\MySQL\MySQL Tools for 5.0" folder execute commands:

echo. > 1.sql

MySQLQueryBrowser.exe 1.sql

After choosing connection settings user is presented with following error messages:

1. Querying tool for MySQL Servers has encountered a problem and needs to close.  We are sorry for the inconvenience.

2. Exception EInvalidOperation in module MySQLQueryBrowser.exe at 0007CCEE. Cannot focus a disabled or invisible window.

3. Runtime error 216 at 0040417A

4. The instruction at "0x00466441" referenced memory at "0x01a52abc". The memory could not be "read".
[18 Mar 2009 8:47] Valeriy Kravchuk
Thank you for the bug report. Verified just as described.
[14 Apr 2009 8:31] Valeriy Kravchuk
Bug #44256 was marked as a duplicate of this one.
[19 Oct 2009 6:52] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Query Browser into MySQL Workbench. We won't fix this anymore.

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/
[3 Dec 2009 10:10] Valeriy Kravchuk
This problem is NOT solved neither in WB 5.1.18 (it just hangs), not in WB 5.2.10 (it either hangs or says that it can not open document, say, t.sql, and refers to %TMP%\t.sqld4\document.mwb.xml). 

Verified on 64-bit Windows XP.

As WB is positioned as an ultimate tool for SQL development, working association of .sql files with it is essential.
[3 Dec 2009 21:06] Alfredo Kojima
I don't understand. Loading SQL scripts from cmdline into WB is not a feature of Workbench. 
Is there something that suggests it is?
That said, it's a good feature request, so I propose setting it as a P4 feature request for WB52 which will be implemented if we have time or postponed to 6.0 if not.
[7 Dec 2009 13:15] Mike Lischke
That's indeed a good feature request. Currently WB tries to open any given file as model file. We have to add recognition for script files.
[30 Jul 2013 22:20] Philip Olson
Fixed as of MySQL Workbench 6.0.4, and here's the changelog entry:

Support for opening SQL ("*.sql" and "*.dbquery") files from the command line
option was added. 

If only a ".sql" file is passed in, then a connection
dialog will be opened so that a MySQL connection can be chosen. If the
"-query" "$connection" option is also passed in, then the file will be
opened using that MySQL connection.

Thank you for the bug report.