Bug #51102 | Wrong placement of objects when reverse engineering from Script in Schema "MYDB" | ||
---|---|---|---|
Submitted: | 11 Feb 2010 14:24 | Modified: | 14 Jun 2013 0:03 |
Reporter: | Martin Pirringer | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Workbench: Modeling | Severity: | S3 (Non-critical) |
Version: | 5.2.15, 5.2.16 | OS: | Any (Windows 7, Linux) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | MYDB, Object Placement |
[11 Feb 2010 14:24]
Martin Pirringer
[19 Feb 2010 11:39]
Susanne Ebrecht
Verified as described. CREATE SCHEMA bug51102; USE bug51102; CREATE TABLE t(i integer); Open Workbench: Reverse engineer bug51102; Click onto the schema tab. Add a routine. DELIMITER // CREATE PROCEDURE `routine1` () BEGIN select * from t; END// Sync database ... In sync script: CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `mydb`; DELIMITER $$ CREATE PROCEDURE `routine1` () BEGIN select * from t; END$$ DELIMITER ;
[14 Apr 2010 8:02]
Sergei Tkachenko
Can't repeat this with 5.2.18.
[23 Apr 2010 10:55]
Sergei Tkachenko
Reverse engineering places all unspecified objects into default schema, but it changes default schema correspondingly when encounters "use" statement in the passed script, while "create schema" statement doesn't change default schema (this behavior is equal to MySql CLI-client). Initial schema is determined by selected schema tab page in a physical schemata overview panel by the time of invoking reverse-engineering. Need Alex's input here. My proposal is to make forward-engineering generate "use" statement right after "create schema" statement.
[23 Apr 2010 11:02]
Sergei Tkachenko
Martin, in your case you just need to create target schema manually in your model, if it doesn't exist yet, and select it before starting reverse-engineering.
[14 Jun 2013 0:03]
Philip Olson
Fixed as of the upcoming MySQL Workbench 6.0.2 public beta release, and here's the changelog entry: The "USE" statement is now being added prior to creating procedures, as otherwise it was possible that the procedures would be placed in the wrong schema. Thank you for the bug report.