Bug #10347 Delimiter error when creating a stored procedure
Submitted: 3 May 2005 19:34 Modified: 4 May 2005 0:38
Reporter: Guillaume Lebur Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.7 (mySQL 5.0.4) OS:Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any

[3 May 2005 19:34] Guillaume Lebur
Description:
Trying to create stored procedures in a script tab causes various errors whatever delimiter is used.

Note that I also have delimiter problems with the command-line client (see bug #10346)

How to repeat:
DELIMITER \\

DROP PROCEDURE IF EXISTS `tutoriel`.`TEST`\\
CREATE PROCEDURE `tutoriel`.`TEST` ()
BEGIN
  DECLARE a INT;
  SET a = 0;
END\\

DELIMITER ;

causes the following error :

1064 : You have an error in your SQL syntax; check the Manual that corresponds to your MySQL server version for the right syntax to use near '\\
CREATE PROCEDURE `tutoriel`.`TEST` ()
BEGIN
  DECLARE a INT' at line 1

DELIMITER //

CREATE PROCEDURE `tutoriel`.`TEST` ()
BEGIN
  DECLARE a INT;
  SET a = 0;
END//

DELIMITER ;

This script doesn't generate the same error but it still fails :

Error Nr 1193 - Unknown system variable 'a'.
[4 May 2005 0:38] Jorge del Conde
Hi!

This is the expected behavoiur in Query Browser.  What happens is each query that's executed in query browser creates a new connection to mysqld, so when ever the stored procedure code is actually executed, mysqld never sees its corresponding "DELIMITER //" call.

Please use the script mode for these types of queries.
[5 May 2005 7:42] [ name withheld ]
No, this really doesn't work. The script below was produced by the interface when I right-clicked on "Test3" in the "Schemata" and chose "Edit Procedure". It doesn't execute when I choose "Execute" from the "Script" menu. As far as I can tell this is "script mode". What is going on? Perhaps you should attempt these steps?

DELIMITER $$

DROP PROCEDURE IF EXISTS `vuetec`.`Test`$$
CREATE PROCEDURE `vuetec`.`Test`()
SELECT COUNT(*) FROM config$$

DELIMITER ;

Jaye.
[5 May 2005 7:43] [ name withheld ]
Argh! Why the hell can't I attach a screenshot to this!