Bug #9167 Procedure CALL fails with named block and NAMES UTF8
Submitted: 14 Mar 2005 12:51 Modified: 14 Mar 2005 14:01
Reporter: Anders Karlsson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[14 Mar 2005 12:51] Anders Karlsson
Description:
Calling a procedure with a named block having NAMES UTF-8 set fails with error 1064, pointing to the procedure text starting at the label.

How to repeat:
Create a file bug.sql with the following contents:
DROP PROCEDURE IF EXISTS foo;
delimiter //
CREATE PROCEDURE foo()
main: BEGIN
END;
//

Then:
C:\> mysql test < bug.sql
C:\> mysql test
mysql> set names utf8;
mysql> call foo();
ERROR 1064 (42000): 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 'main:
 BEGIN
END' at line 2

This appears on Linux too. Note that the following sequence will NOT expose this problem:
C:\> mysql test
mysql> call foo();
mysql> set names utf8;
mysql> call foo();

I.e. if the procedure foo() is called once before "set names", then the problem does not occur. As "MySQL Query Browser" seems to run a SET NAMES UTF8 when connecting, this bug prohibits calling procedures from MQB.
[14 Mar 2005 13:01] MySQL Verification Team
Thank you for the bug report.
[14 Mar 2005 13:06] Hartmut Holzgraefe
Duplicate of #6062
[14 Mar 2005 13:08] Hartmut Holzgraefe
actually its a duplcate of Bug #6063, sorry for the typo