Bug #57378 Forward Enginner SQL Create Script generates an ";" before sentence"create user"
Submitted: 11 Oct 2010 16:02 Modified: 11 Nov 2010 14:26
Reporter: Gerardo Palma Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.28 CE, 5.2.29 OS:Any (Windows, Mac OS X)
Assigned to: Alexander Musienko CPU Architecture:Any
Tags: Export Forward Engineer SQL Create Script

[11 Oct 2010 16:02] Gerardo Palma
Description:
I export a Model with "Forward Enginner SQL Create Script" from file menu.
The Wizard create an single statment with only ";" delimiter, this return an error when i want to run script on "MySQL Query Browser".

Example:

-- -----------------------------------------------------
-- View `A2IMDB`.`view_licencingmonitor`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `A2IMDB`.`view_licencingmonitor`;
USE `A2IMDB`;
CREATE  OR REPLACE VIEW `A2IMDB`.`view_licencingmonitor` AS
SELECT * FROM licassets;

;
CREATE USER `A2IMUSR`;

grant ALL on TABLE `A2IMDB`.`departments` to A2IMUSR;
grant ALL on TABLE `A2IMDB`.`directions` to A2IMUSR;
grant ALL on TABLE `A2IMDB`.`divisions` to A2IMUSR;

Thanks.

How to repeat:
Create a single model with defined users and roles & export it
[11 Oct 2010 16:16] Valeriy Kravchuk
It is easy to repeat. Just create one role (with no privileges) and one user in the model. This is the result of forward engineering:

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

;
CREATE USER `user1`;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
[8 Nov 2010 19:50] Johannes Taxacher
fix confirmed in repository
[11 Nov 2010 14:26] Tony Bedford
An entry has been added to the 5.2.30 changelog:

When a model was forward engineered with File, Export, Forward Engineer SQL CREATE Script, the generated script contained a statement that consisted of a single delimiter, “;”.