Bug #9856 Stored procedures: crash if handler for sqlexception, not found
Submitted: 12 Apr 2005 20:02 Modified: 13 Apr 2005 16:22
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.5-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Bugs System CPU Architecture:Any

[12 Apr 2005 20:02] Peter Gulutzan
Description:
If there is a handler declaration for "sqlexception, not found" (a combination), and the "not found" situation occurs, crash.

How to repeat:
mysql> delimiter //
mysql> create table t16 (s1 int)//
Query OK, 0 rows affected (0.01 sec)

mysql> create procedure p16 () begin declare v int; declare c cursor for select * from t16; declare exit handler for sqlexception, not found select '16'; open c; fetch c into v; select v; end//
Query OK, 0 rows affected (0.01 sec)

mysql> call p16()//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[13 Apr 2005 15:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23972