Bug #70365 Cannot save empty script in Workbench
Submitted: 17 Sep 2013 11:53 Modified: 6 Nov 2013 16:51
Reporter: Pavel Foltyn Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.0.7 OS:Windows (Windows 7 64bit 4cores)
Assigned to: CPU Architecture:Any
Tags: Failure, file, save, script, SQL

[17 Sep 2013 11:53] Pavel Foltyn
Description:
Cannot save an empty SQL script file while working in MySQL Workbench.

How to repeat:
1) Open MySQL Workbench.
2) Select an existing MySQL database connection by clicking on it.
3) An IDE tab with "Navigator", "Information", "Output", and "Query 1" sections will open.
4) Click anywhere in the "Query 1" section, but do not type anything in.
5) Select "File" -> "Save Script As" from the menu.
6) "Save SQL Script" dialog will pop up.
7) Select the location in C:\ on the file system and fill in "server1_database2_tableName3_SELECT_all.sql" as "File name".
8) Click "Save".

Expected behaviour:
The (empty) script file stores in C:\ as server1_database2_tableName3_SELECT_all.sql

Actual behaviour:
An error pops up - caption "MySQL Workbench", text in bold "builtin:query.saveFileAs", another text "string too long".

Suggested fix:
Workaround:
You have to type some text in the "Query 1" window first and only then try to save the script.
[17 Sep 2013 12:46] Lisa Ehrlinger
Thank you for the bug report.
[28 Oct 2013 16:02] Dan Kloke
After getting this error, I added some text to the file and tried to save it again, receiving the error:
Error writing file 
[filespec]
Existing file [filespec] could not be removed: g_unlink() failed: Permission denied.

Trying to close Workbench, the app gives a Close SQL Tab notice, with Save or Don't Save options, Save fails as above.

On trying to restart Workbench, the Unexpecte Error dialog: External component has thrown an exception, after this dialog Workbench crashes. 

It is necessary to manually remove the file before restarting Workbench.
[3 Nov 2013 17:42] Daniel Cavalcante Silva Daniel
I have the same problem when I installed this new version.

I had to go back to Release 5.2.47.

There is a way around this problem for the new version 6.0.7 or wait for a new release?
[6 Nov 2013 16:51] Philip Olson
Fixed as of MySQL Workbench 6.0.8, and here's the changelog entry:

An empty SQL script file could not be saved from within MySQL Workbench,
and attempting this action would generate an unexpected error.

Thank you for the bug report.