Bug #49587 Snychronization is droping databases
Submitted: 10 Dec 2009 13:35 Modified: 8 Feb 2010 11:52
Reporter: Susanne Ebrecht Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:5.2 OS:Linux (Ubuntu)
Assigned to: Alexander Musienko CPU Architecture:Any

[10 Dec 2009 13:35] Susanne Ebrecht
Description:
This critical behaviour occurs on every existing database in your MySQL instance.

There are several different possibilities testing it.

Here is just an easy way to test it:

1) Open Workbench
2) New Project
3) Reverse Engineer mysql database
4) Synchronize Model
5) Set conntect and press next
6) press next
7) choose additionally another database like information_schema or test or whetever else (don't choose a database here that you need in further on)

For testing I choosed information_schema

So besides database mysql mark database information_schema

press next ...

8) press next
9) mark mydb and press ignore
10) press arrow key at information_schema so that the whole list of tables will get shown
11) mark information schema then press SHIFT and scroll up to the end and click on the last entry (VIEW). Now all stuff for information schema is marked
12) press ignore
13) Check it ... all and really all from information_schema should be ignored now. Press next
14) Read the SQL Script ... You will see:

DROP SCHEMA IF EXISTS `information_schema` ;

Same happens with every other database you will choose. I already lost more often my productive database here.

How to repeat:
See above

Suggested fix:
When user says he wants to ignore the database then let it be totally ignored and not drop the database.
[25 Jan 2010 17:11] Alexander Musienko
Fixed by removing shemas that doesn't exist in model from list, since there is no sense to sync to them.
[26 Jan 2010 21:00] Johannes Taxacher
fix confirmed. will be included in 5.2.15
[8 Feb 2010 11:53] Tony Bedford
An entry has been added to the 5.2.15 changelog:

The Synchronize Model with Database wizard generated a script that erroneously dropped schemata that had been selected to be ignored.