mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#29770 Two handlers are allowed to catch an error in an stored procedure.
Add test case. mysql-test/r/sp.result: Add test case result for Bug#29770 mysql-test/t/sp.test: Add test case for Bug#29770
This commit is contained in:
@ -6578,6 +6578,22 @@ DROP PROCEDURE db28318_a.t1;
|
|||||||
DROP PROCEDURE db28318_b.t2;
|
DROP PROCEDURE db28318_b.t2;
|
||||||
DROP DATABASE db28318_a;
|
DROP DATABASE db28318_a;
|
||||||
DROP DATABASE db28318_b;
|
DROP DATABASE db28318_b;
|
||||||
|
USE test;
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
DROP PROCEDURE IF EXISTS bug29770;
|
||||||
|
CREATE TABLE t1(a int);
|
||||||
|
CREATE PROCEDURE bug29770()
|
||||||
|
BEGIN
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLSTATE '42S22' SET @state:= 'run';
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @exception:= 'run';
|
||||||
|
SELECT x FROM t1;
|
||||||
|
END|
|
||||||
|
CALL bug29770();
|
||||||
|
SELECT @state, @exception;
|
||||||
|
@state @exception
|
||||||
|
run NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP PROCEDURE bug29770;
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# -- End of 5.0 tests
|
# -- End of 5.0 tests
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
@ -7698,6 +7698,30 @@ DROP PROCEDURE db28318_a.t1;
|
|||||||
DROP PROCEDURE db28318_b.t2;
|
DROP PROCEDURE db28318_b.t2;
|
||||||
DROP DATABASE db28318_a;
|
DROP DATABASE db28318_a;
|
||||||
DROP DATABASE db28318_b;
|
DROP DATABASE db28318_b;
|
||||||
|
USE test;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#29770 Two handlers are allowed to catch an error in an stored procedure.
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
DROP PROCEDURE IF EXISTS bug29770;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE t1(a int);
|
||||||
|
delimiter |;
|
||||||
|
CREATE PROCEDURE bug29770()
|
||||||
|
BEGIN
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLSTATE '42S22' SET @state:= 'run';
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @exception:= 'run';
|
||||||
|
SELECT x FROM t1;
|
||||||
|
END|
|
||||||
|
delimiter ;|
|
||||||
|
CALL bug29770();
|
||||||
|
SELECT @state, @exception;
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP PROCEDURE bug29770;
|
||||||
|
|
||||||
|
|
||||||
--echo # ------------------------------------------------------------------
|
--echo # ------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user