We're updating the issue view to help you get more done. 

Error 1329 is reported even if it is handled

Description

Create a trivial procedure with a cursor and a loop for that cursor. Handle the NOT FOUND event, or the 1329 error, or both.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 DELIMITER || CREATE TABLE `test`.`tab1` (c INT); CREATE PROCEDURE `test`.demo() BEGIN DECLARE `eof` BOOL; DECLARE `v` INT; DECLARE `crs` CURSOR FOR SELECT `c` FROM `test`.`tab1`; -- this should handle error... DECLARE CONTINUE HANDLER FOR NOT FOUND, 1329 SET eof = TRUE; OPEN `crs`; `lp`: LOOP FETCH `crs` INTO `v`; IF `eof` IS TRUE THEN LEAVE `lp`; END IF; END LOOP; CLOSE `crs`; END; || DELIMITER ;

Then run it:

1 2 3 4 5 6 7 8 9 10 MariaDB [(none)]> CALL test.demo(); Query OK, 0 rows affected, 1 warning (0.00 sec) MariaDB [(none)]> SHOW WARNINGS; +-------+------+-----------------------------------------------------+ | Level | Code | Message | +-------+------+-----------------------------------------------------+ | Error | 1329 | No data - zero rows fetched, selected, or processed | +-------+------+-----------------------------------------------------+ 1 row in set (0.00 sec)

As far as I understand this warning should not appear, because that warning is handled.
This also happens with MySQL 5.5.30, but not with 5.6.

Environment

None

Status

Assignee

Sergei Golubchik

Reporter

Federico Razzoli

Labels

Fix versions

Affects versions

5.5.31

Priority

Minor