Bug #55918 forward engineer drops too many schemas
Submitted: 11 Aug 2010 16:12 Modified: 17 Sep 2010 13:34
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.26 OS:Any
Assigned to: Alexander Musienko CPU Architecture:Any

[11 Aug 2010 16:12] [ name withheld ]
Description:
Forward Engineer can cause data loss!

I have a model that contains two schemas. When I try to forward-engineer just one schema, and filter out objects from the other schema, FE will generate a drop statement for both schemas.

How to repeat:
1. Create a model with two schemas, one table in each.
2. Open Forward Engineer wizard.
3. Check Generate DROP SCHEMA and uncheck everything else, click Next.
4. Use the table filter to pick a table from just one schema, click Next.

View the generated SQL. It will contain two DROP SCHEMA statements, rather than just the one for the schema from which the table has been selected in step 4.
[16 Sep 2010 20:23] Johannes Taxacher
fix confirmed in repository.

DROP and USE statements will now be inserted only for schemas whose objects are processed (and not filtered out)
[17 Sep 2010 13:34] Tony Bedford
An entry has been added to the 5.2.28 changelog:

If a model contained two schemata, and an attempt was made to forward engineer only one of the schemata by use of the object filters, then data loss could result. This happened because a DROP statement was generated for both schemata in the model, rather than just the one being forward engineered.