Bug #6095 Stored procedure crash if self-call after alter
Submitted: 14 Oct 2004 12:18 Modified: 23 Oct 2004 14:31
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

[14 Oct 2004 12:18] Peter Gulutzan
Description:
If a procedure contains an alter statement which changes the procedure's name, and a 
call to the procedure, then calling the procedure will fail and the next statement will cause 
a server crash. This bug will disappear if MySQL stops supporting "ALTER ... NAME". But 
it will reappear if MySQL someday supports another way to rename procedures. 
 

How to repeat:
mysql> create procedure p132 () begin alter procedure p132 name p133; call p133(); 
end;// 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> call p132()// 
ERROR 1305 (42000): PROCEDURE  does not exist 
mysql> drop procedure p133// 
ERROR 2006 (HY000): MySQL server has gone away
[23 Oct 2004 14:31] 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

Additional info:

This was a side-effect of the dysfunctional (and non-standard) renaming mechanism,
and has vanished when BUG#6027 (Stored procedures can be renamed) was fixed.