Bug #51305 Normal use of OSS Workbench far too easily leads to DB deletion.
Submitted: 19 Feb 2010 3:46 Modified: 25 Apr 2010 15:49
Reporter: Chris Procter Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:5.2 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: data loss database deletion

[19 Feb 2010 3:46] Chris Procter
Description:
While administering a mysql DB over a slow vmware connection using the workbench, I opened a table to view the contents.
After deciding to close it, I apparently double-clicked the location of the "Close" button, under which was a button to delete the entire database.

A scary dialogue appeared saying my DB was going to be deleted; the safest way to get out of these in Windows is with the "X" in the corner, which I pressed.

I was then shocked to see that my database (with all my store customers, products, etc) was gone.  We hadn't finished populating it, and so there is no backup, and we're left with spending days extra we hadn't counted on to recreate it.

How to repeat:
- Use workbench to open a DB and view a table
- Click twice where the close button is
- Panic and close the dialogue with the corner "X"

Suggested fix:
Don't overlay UI objects.
Don't delete the DB if the user cancels the dialogue!
Have more confirmation dialogues before catastrophic data deletion.
[19 Feb 2010 10:03] Johannes Taxacher
Hi Chris,

which version of Workbench have you been using? The problem with clicking the [x] not always "canceling" the dialog has been fixed in 5.2.16.
Although i agree, that the positioning of the close-button for the query tabs is not a good choice - we'll improve on that
[19 Feb 2010 17:36] Mike Frank
There was probably another bug as Tax pointed out, but still we need really confirm drop actions.

So for any drop of any object also put into the workflow the use of the "apply this code" wizard (as used for alter and inserts) should do that and would unify the workflow. 

Note: the current delete warning stays as well and after they confirm the delete then the "apply this code dialog" is popped up and user can inspect DDL statement and explicitly apply or cancel or copy statement, cancel and execute themselves.
[22 Feb 2010 20:34] Mike Frank
dropcheckexec

Attachment: dropchecksandsqltorun.pdf (application/pdf, text), 128.42 KiB.

[9 Mar 2010 20:56] Chris Procter
Hah! It was v 5.2.14 or something; I've updated workbench to avoid future such calamity, and implemented an overly psychotic backup regimen in case I hit something else.
Thx
[25 Apr 2010 15:49] Sveta Smirnova
Thank you for the feedback.

This looks like fixed in version 5.2.19: at least no X to remove database and dialog for dropping database cancels when I click X in my copy. If this is not true in your case please provide step-by-step instructions what you do.