Bug #2260 Handler NOT FOUND declaration does't work in stored procedure
Submitted: 2 Jan 2004 14:29 Modified: 8 Jan 2004 2:02
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.0 OS:Linux (SuSE 8.2)
Assigned to: Bugs System CPU Architecture:Any

[2 Jan 2004 14:29] Peter Gulutzan
Description:
Declaring a CONTINUE  handler for a NOT FOUND condition has no effect. The result of 
"fetching past the end" is still ERROR 1313. 

How to repeat:
mysql> delimiter | 
mysql> create table t11 (s1 int)| 
Query OK, 0 rows affected (0.65 sec) 
 
mysql> create procedure p22 () begin declare v1 int; declare continue handler for not found 
set @x2 = 1; declare c1 cursor for select s1 from t11; open c1; fetch c1 into v1; set @x2 = 
2; close c1; end| 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> call p22()| 
ERROR 1313 (02000): No data to FETCH 
mysql> select @x2| 
+------+ 
| @x2  | 
+------+ 
| NULL | 
+------+ 
1 row in set (0.00 sec)
[8 Jan 2004 2:02] 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