Bug #3294 Stored procedure crash if table dropped before use
Submitted: 25 Mar 2004 15:39 Modified: 10 Sep 2004 9:15
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.1-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Bugs System CPU Architecture:Any

[25 Mar 2004 15:39] Peter Gulutzan
Description:
Inside a stored procedure, if I drop a table and then try to insert into the same table, I 
should get an error. Usually I do. But if the dropping happens within a handler, crash. 
 

How to repeat:
mysql> create table t (s1 int, primary key (s1)) engine=innodb// 
Query OK, 0 rows affected (0.34 sec) 
 
mysql> insert into t values (1)// 
Query OK, 1 row affected (0.29 sec) 
 
mysql> create procedure p9 () 
    -> begin 
    -> declare continue handler for sqlexception drop table t; 
    -> insert into t values (1); 
    -> insert into t values (1); 
    -> end; 
    -> // 
Query OK, 0 rows affected (0.47 sec) 
 
mysql> call p9()// 
ERROR 2013 (HY000): Lost connection to MySQL server during query
[25 Mar 2004 16:27] MySQL Verification Team
Verified on Windows XP.
[10 Sep 2004 9:15] 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:

Dropping the table was not the real problem, the problem was with errors occuring within error handlers.