Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Not a Bug
-
Affects Version/s: 10.0.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
RESIGNAL can only be used "when handler is active" (like the error message says). In 5.5, if a condition handler contains "CALL x()", then x() could contain a RESIGNAL, and it worked as expected. But in MariaDB 10 and MySQL 5.6, an error is produced at runtime:
Example:
SET @@session.SQL_MODE = 'ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES,STRICT_TRANS_TABLES';
DELIMITER ||
DROP PROCEDURE IF EXISTS `test`.`handle_error`;
CREATE PROCEDURE `test`.`handle_error`()
BEGIN
RESIGNAL SET MESSAGE_TEXT = 'RESIGNALed';
END;
DROP PROCEDURE IF EXISTS `test`.`t`;
CREATE PROCEDURE `test`.`t`()
BEGIN
DECLARE CONTINUE HANDLER
FOR SQLWARNING
BEGIN
CALL `test`.`handle_error`();
END;
SELECT 1/0;
END;
||
DELIMITER ;
Let's try it:
MariaDB [(none)]> CALL test.t(); +------+ | 1/0 | +------+ | NULL | +------+ 1 row in set (0.03 sec) ERROR 1645 (0K000): RESIGNAL when handler not active MariaDB [(none)]>
(I'm reporting this to MariaDB because Oracle registration requires too many personal data)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Hi Federico,
If I understand correctly, it's documented as an intentional change between 5.5 and 5.6.
See this:
http://dev.mysql.com/doc/refman/5.6/en/resignal.html#resignal-handler
(the part "more difficult example)
and compare with
http://dev.mysql.com/doc/refman/5.5/en/resignal.html#resignal-handler
Could you please take a look and confirm (or not confirm) that it's the same case?