Bug #54046 Forward engineer a database creates wrong DELIMTER statement
Submitted: 27 May 2010 23:09 Modified: 28 May 2010 18:56
Reporter: J Chimene Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.21 OS:Any (Linux, Mac OS X)
Assigned to: CPU Architecture:Any

[27 May 2010 23:09] J Chimene
Description:
The script created via "Forward Engineer" does not generate a DELIMITER statement the first time the delimiter should change.
For example, the following code was generated:
-- -----------------------------------------------------
-- procedure CreateInspectionCompany
-- -----------------------------------------------------
USE `eaudit_dev`$$
DROP procedure IF EXISTS `eaudit_dev`.`CreateInspectionCompany`$$

DELIMITER $$
USE `eaudit_dev`$$

Notice that the first instance of the alternate delimiter was not preceded by DELIMITER $$

How to repeat:
1) Create stored procedure.
2) Check the checkbox for "DROP objects before each CREATE OBJECT"
3) Forward engineer the database

Suggested fix:

1) Manually remove the erroneous delimiters
OR
2) insert a delimiter $$ statement before each USE/DROP pair
OR
3) Clear the checkbox for "DROP objects before each CREATE OBJECT" (not tested)
[28 May 2010 3:27] Valeriy Kravchuk
Thank you for the bug report. Verified just as described on Mac OS X.
[28 May 2010 18:42] Johannes Taxacher
this is a duplicate of Bug #53467
[28 May 2010 18:56] J Chimene
Agreed. The bug was closed for the .17 release; which explains why I didn't see it when searching the bug database before opening this report.

It may be a duplicate of #53467; which means .21 has regressed. I distinctly recall using the "Forward Engineer" process when I started using Workbench (circa .19). This issue is new to me since .21