Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Won't Fix
-
10.2, 10.3, 10.4, 10.5
-
None
Description
When having the sql-error-log plugin enabled, and running a simple procedure test fetching data from a cursor, the following is written to the sql error plugin log, even though a HANDLER for NOT FOUND exists to catch this error, so that it is never actually returned to the client at all:
Error 1329: No data - zero rows fetched, selected, or processed ....
|
Looks as if the plugin API event that the sql error log plugin hooks into fires before the procedures HANDLER even has a chance to actually act on the error ...
CREATE TABLE t1(i INT); |
|
DELIMITER //
|
|
CREATE PROCEDURE p1() |
BEGIN
|
DECLARE done INT DEFAULT FALSE; |
DECLARE x INT; |
DECLARE cur1 CURSOR FOR SELECT i FROM t1; |
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; |
|
OPEN cur1; |
|
read_loop: LOOP
|
FETCH cur1 INTO x; |
IF done THEN |
LEAVE read_loop;
|
END IF; |
END LOOP; |
|
CLOSE cur1; |
END; // |
|
DELIMITER ;
|
|
CALL p1();
|