Bug #5307 Stored procedure allows statement after BEGIN ... END
Submitted: 30 Aug 2004 23:43 Modified: 2 Sep 2004 19:10
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Per-Erik Martin CPU Architecture:Any

[30 Aug 2004 23:43] Peter Gulutzan
Description:
A procedure body should be a single statement, which is usually a compound statement, 
i.e. BEGIN ... END. But MySQL allows me to put another statement after the BEGIN ... 
END. Then I cannot call the procedure, I get an error message. 
 

How to repeat:
mysql> delimiter // 
mysql> create procedure p40 () begin end; set @x = 1;// 
Query OK, 0 rows affected (0.00 sec) 
 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> call p40()// 
Query OK, 0 rows affected (0.00 sec) 
 
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 'h4z°' at line 1
[31 Aug 2004 4:38] MySQL Verification Team
Thank you for the bug report. I was able to repeat.
[2 Sep 2004 19:10] Per-Erik Martin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html