Bug #91510 Workbench model files keep FILE_ATTRIBUTE_TEMPORARY upon saving
Submitted: 30 Jun 2018 11:06 Modified: 2 Jul 2018 12:36
Reporter: Alexander Schmitz Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:8.0.11 OS:Windows
Assigned to: CPU Architecture:Any
Tags: cloud syncing, file attributes, Saving, temporary files

[30 Jun 2018 11:06] Alexander Schmitz
Description:
Saving a Workbench model file will correctly create a ".bak" copy of the previous file version, yet leave the newly saved ".mwb" file as a temporary file by either setting or not unsetting the FILE_ATTRIBUTE_TEMPORARY flag upon saving.

I think this is crucial for consistency on the one hand and will also make the model files run into problems with other party software, espacially such as cloud syncing clients, which often rely on this very attribute (see e.g. OwnCloud issue #6610).

This behaviour was present in 6.3 (bug #84028) but persists in 8.0.11rc.

As the debug log does not output anything, this behaviour seems to either be desired or has just not be taken into account yet. I would guess it could be related to closing the zip file using libzip in wb_model_file, however, I unfortunately don't have the resources to check right at the moment.

How to repeat:
1. Create new Workbench model file and save or open existing file and save again.
2. Run "fsutil usn readdata ***.mwb" on the created file and check file attributes.
3. Attributes always contain the 0x100 flag FILE_ATTRIBUTE_TEMPORARY (while the .bak file does not).

Suggested fix:
Current workaround:
1. Save Workbench model file.
2. Run Windows PowerShell.
3. Execute "Get-childitem C:\PATH\TO\MODEL\FILE.mwb | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}" to remove the 0x100 flag manually.
[2 Jul 2018 12:36] Chiranjeevi Battula
Hello Alexander,

Thank you for the bug report.
This is most likely duplicate of Bug #84028, please see Bug #84028

Thanks,
Chiranjeevi.