Bug #47361 Wrongly generated SQL for procedures
Submitted: 16 Sep 2009 10:02 Modified: 10 Nov 2009 14:21
Reporter: olaf ocke Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.1.18 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: forward engineer, PROCEDURE, stored

[16 Sep 2009 10:02] olaf ocke
Description:
When I create a stored procedure and forward engineer, it creates SQL which results in errors. Although it executes fine, and the SQL is completed, it's annoying because you get errors.

For example this is the sql generated by forward engineer, for a simple 'loginUser' procedure.

DELIMITER //
//
USE massMailer//
massMailer//
CREATE PROCEDURE `massMailer`.`loginUser` (IN name VARCHAR(16), IN pass VARCHAR(16))
BEGIN
  select 1 as access from user where `username`=name and `password`=sha1(concat(pass, `salt`));
END//

The 'massMailer//' line is unnecessary and results in an error.

How to repeat:
Create a procedure and forward engineer. I used utf8_unicode_ci for collation and InnoDB for my databases.
[16 Sep 2009 10:04] olaf ocke
BTW, this is what I put in the routine textarea:
-- -------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER //

CREATE PROCEDURE `massMailer`.`loginUser` (IN name VARCHAR(16), IN pass VARCHAR(16))
BEGIN
  select 1 as access from user where `username`=name and `password`=sha1(concat(pass, `salt`));
END//
[16 Sep 2009 10:42] Valeriy Kravchuk
Thank you for the bug report. Verified just as described.
[10 Nov 2009 14:18] Susanne Ebrecht
This is a duplicate of bug #46505