Bug #55439 Strange behavior when saving model to read-only file.
Submitted: 21 Jul 2010 12:31 Modified: 3 Sep 2010 14:02
Reporter: Andrei Frolov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.25 CE OS:Windows
Assigned to: Mike Lischke CPU Architecture:Any
Tags: mode, read-only, save

[21 Jul 2010 12:31] Andrei Frolov
Description:
If model was opened from read-only file. Then first attempt to save model doesn't produce any warning or error and results in creating readonly 'MySQL Workbench File' back up file and new 'MySQL Workbench File' without read-only attribute. Second and subsequent attemtps to save model produce error that hardly describe the reason why model can't be saved.

How to repeat:
1. Create new EER model, save it.
2. Mark model file as read-only. 
3. Change model in any way, save it.
4. Change model in any way, save it.

The following error is shown:

'Couldn't backup existing file name-of-the-file.mwb: No such file or directory'

Suggested fix:
Ask whether to overwrite read-only file or not. On positive answer remove read-only attribute from model file and follow existing 'save mode' procedure.

or

at least instead of 'No such file or directory' show 'Back up file is read-only' or something like that.
[21 Jul 2010 12:52] MySQL Verification Team
Thank you for the bug report. Could you please verify if in the first change the tool creates a bak file?. Thanks in advance.
[21 Jul 2010 18:23] Andrei Frolov
Yes, it creates read-only bak file.
[21 Jul 2010 22:38] MySQL Verification Team
Thank you for the bug report.
[5 Aug 2010 16:01] Mike Lischke
Fixed in repository.
[26 Aug 2010 7:19] Johannes Taxacher
fix confirmed in repository
[3 Sep 2010 14:02] Tony Bedford
An entry has been added to the 5.2.27 changelog:

On the second attempt to save a read-only model file, the following error was generated:

Couldn't backup existing file name-of-the-file.mwb: No such file or directory