Bug #50072 DROP DATABASE dialog drops database if closed without clicking a command button
Submitted: 5 Jan 2010 1:48 Modified: 15 Feb 2010 11:27
Reporter: Ranga Komaragiri Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.11 OSS Beta OS:Windows
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: DROP DATABASE dialog box; Drop Schema, regression

[5 Jan 2010 1:48] Ranga Komaragiri
Description:
The "Drop Schema" or "DROP DATABASE" dialog box has two buttons - 1) Cancel 2) DROP 'db', both the buttons perform what they are intended for. But clicking the Windows Close button (red colored "X" on the right side of the title bar) of the dialog box will actually drop the database. 

It looks like the logic is dropping the database when the dialog box is closed except when Cancel is clicked.

How to repeat:
1. Open MySQL Workbench
2. Click on "Overivew" tab.
3. Select a "DELETABLE" database from the available schemas.
4. Click on the "-" (minus) icon on the title bar just below the "Overview" tab. This icon is for DROPPING a schema.
4. DROP DATABASE dialog box is shown.
5. Click on the Windows Close button (the red colored "X" on the right side of the title bar of the dialog box), to close the dialog box without responding to either of the command buttons - Cancel or DROP db.
6. Try the USE command with the database that should have been dropped.

Suggested fix:
DROP the database only if the user explicitly clicks on the "DROP DB" command button.
[5 Jan 2010 8:53] Susanne Ebrecht
Verified as described.

On server do:
CREATE DATABASE foo;

After that:
Open Workbench
Open Connection to start querying
Connect to the server
Click Overview
Select database foo
Click minus
click cross on pop up

again on server:
SHOW databases;

you will figure out that database foo is gone.
[5 Jan 2010 20:54] Alfredo Kojima
Changed buttons so that Escape/Closing confirmation dialog through X button will Cancel the command.
[7 Jan 2010 14:02] Johannes Taxacher
fix confirmed. willl be included in 5.2.12
[8 Jan 2010 17:08] Tony Bedford
An entry has been added to the 5.2.12 changelog:

In the SQL Editor, if a database was selected in the Overview tab and then either the Drop Schema... context menu item was selected, or the drop schema toolbar button clicked, the DROP DATABASE dialog was displayed. However, if the dialog close button was then clicked to cancel the dialog, the database was still dropped, instead of being unaffected by the cancelling of the dialog.
[9 Feb 2010 10:58] Susanne Ebrecht
Bug #50960 is a duplicate of this bug here.
[12 Feb 2010 14:45] Alfredo Kojima
Fixed handling of window close button from confirmation dlg in Windows
[12 Feb 2010 22:15] Johannes Taxacher
this should is finally fixed now in repository
[15 Feb 2010 11:27] Tony Bedford
Changelog updated: noted now fixed in 5.2.16. Also noted 50960 as duplicate.