Bug #54091 undo does the wrong thing in SQL Editor, model data loss easily possible
Submitted: 31 May 2010 1:30 Modified: 11 Jun 2010 14:34
Reporter: Ivo Roper Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.21 OS:Windows
Assigned to: Alfredo Kojima CPU Architecture:Any

[31 May 2010 1:30] Ivo Roper
Description:
When you undo something in the SQL Editor, not only does it do nothing to your query edits, it silently undoes whatever you were doing in the last model you changed.

At that point, closing and saving will lose anything that you've undone in the model (or diagram) without knowing it. The menu shows that it will undo or redo the model related action, so if you ever use the menu to undo it's pretty obvious, but how many people don't use ^z?

How to repeat:
Open any model, or create a new one

Open an SQL Editor connection

Do anything in the model that can be undone

Do anything in SQL Editor that should be undo-able

The menu reflects that SQL Editor edits aren't tracked for undo, and ^z silently undoes things in the model you were working on, setting you for arbitrary data loss and confusion is you don't notice before saving and closing.

Suggested fix:
It seems to me that the intuitive behavior is for each query editor instance / window to have its own undo trail, completely independent of any other window, and only accessible while that window has focus.

If the fix will take long to implement, I'd suggest an interim fix of disabling undo while in the editor such that model changes can never be undone accidentally.
[31 May 2010 12:53] MySQL Verification Team
Thank you for the bug report.
[3 Jun 2010 19:07] Alfredo Kojima
Fixed in Windows.
[3 Jun 2010 21:55] Ivo Roper
Thank you Alfredo, that was fast and it's appreciated.
[4 Jun 2010 2:41] Alfredo Kojima
Fixed in Linux
[4 Jun 2010 12:18] Alfredo Kojima
Fixed in mac
[8 Jun 2010 21:08] Johannes Taxacher
fix confirmed in repository
[11 Jun 2010 14:34] Tony Bedford
An entry has been added to the 5.2.23 changelog:

Performing an undo operation in SQL Editor actually resulted in an undo operation in the Modeler.