Bug #5461 MySQL Query Browser fails to run stored procedure install scripts
Submitted: 8 Sep 2004 9:20 Modified: 3 Nov 2004 12:47
Reporter: Roger Wallace Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.0.5 alpha OS:Windows (Windows 2000)
Assigned to: Michael G. Zinner CPU Architecture:Any

[8 Sep 2004 9:20] Roger Wallace
Description:
Query Browser fails to run a create stored procedure script, that is known to work from the command line. The following error is returned:

  You have an error in your SQL... near 'delimiter |'
  You have an error in your SQL... near 'SELECT '
  You have an error in your SQL... near 'END '
  Query was empty

How to repeat:
1 Create a simple stored procedure script (e.g. a simple select statement). 

2 Test that this script is valid by running it on the MySQL command line
   > \. c:\xxx.sql

3 Test that the procedure was installed using the command line
   > SHOW CREATE PROCEDURE xxx

4 Change the name of the stored proc. 

5 Launch MySQL Query Browser and select the "Script Editor" view.

6 Copy the renamed stored procedure script into the Script editor and run.

Suggested fix:
Is this perhaps something to do with the Delimiter command?
[8 Sep 2004 9:22] Roger Wallace
Note that the script gives a similar error from at least one other GUI client: 
The Eclipse plugin - QuantumDB.
[3 Nov 2004 12:47] Michael G. Zinner
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/
[14 Aug 2009 14:17] moi meme
This bug still exists on v "1.2.17" .

A script created with workbench, containing procedures, can't be executed.
See sample line 2:

DELIMITER //
//
CREATE PROCEDURE `SpotDatabaseTEST`.`GetModulePaths_Names`
(IN moduleTypeParam VARCHAR(255), IN moduleNameParam VARCHAR(255), OUT importPathParam TEXT, OUT exportPathParam TEXT)
BEGIN

DECLARE idModuleVar VARCHAR(255) DEFAULT NULL;

# Get the id of the module
SELECT m.idModule 
  INTO idModuleVar
  FROM TSpotModule m
  INNER JOIN TSpotModuleType mt ON mt.idModuleType = m.idModuleType
  INNER JOIN TConfModule mc ON m.idModule = mc.idModule
  WHERE mc.name = moduleNameParam
  AND mt.moduleTypeName = moduleTypeParam;

CALL getModulePaths_ids(idModuleVar, importPathParam, exportPathParam);

END//