Bug #71311 Crash at startup
Submitted: 7 Jan 2014 11:26 Modified: 7 Jan 2014 17:04
Reporter: Frederik De Smedt Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:6.0.7.11215 OS:Windows (Windows 8.1 Home Premium (64-bit))
Assigned to: CPU Architecture:Any
Tags: crash at startup

[7 Jan 2014 11:26] Frederik De Smedt
Description:
I am a student in Applied Computer Science and I currently use MySQL Workbench to make SQL-queries. One day when I tried to open MySQL Workbench an error message popped up saying that an external component has caused an exception (not sure if this is the exact message as I am translating this from the dutch version: "Een extern onderdeel heeft een uitzondering veroorzaakt.")

The body of the error message :
"We are sorry for the inconvenience but an unexpected exception has been raised by one of the MySQL Workbench modules. In order to fix this issue we would kindly ask you to file a bug report. You can do that by pressing ..."

How to repeat:
1. Open MySQL Workbench and open one of your MySQL Connections.
2. Save your SQL-file with no content (so just an empty SQL-file). You can name it whatever you want.
3. An error will show up:
"builtin:query.saveFile
string too long"
4. Now simply reboot your MySQL Workbench and it will not work.

Note:

This always happens when trying to save an empty file, even if it hasn't always been empty.

When trying to save the file after step 3 the following error occures:
"Error writing file <location of file>
Existing file '<location of file>' could not be removed: g_unlink() failed:
Permission denied"

This can be fixed by manually deleting the file.

Suggested fix:
When a user wants to save, check if the String is empty and if the file location already exists, if it does not yet exist tell the user that an empty file cannot be saved, when it does exist clear the contents of the already existing file so it looks like it's saved. Here is some very simple code to illustrate my idea:

if(editor.getText() == ""){
  if(destinationDirectory.exists){
    destinationDirectory.clear();
  }else{
    GUI.showMessage("Empty file cannot be saved");
  }
}
[7 Jan 2014 12:07] Alfredo Kojima
Please try 6.0.8
[7 Jan 2014 13:14] Frederik De Smedt
Edit: Bug fixed with MySQL Workbench 6.0.8(.11354)