mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-10411 Providing compatibility for basic PL/SQL constructs
An additional change for "Part 9: EXCEPTION handlers" This construct: EXCEPTION WHEN OTHERS THEN ...; now catches warning-alike conditions, e.g. NO_DATA_FOUND.
This commit is contained in:
@ -199,5 +199,24 @@ ERROR 24000: Cursor is not open
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Testing that warning-alike errors are caught by OTHERS
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE FUNCTION f1 RETURN VARCHAR
|
||||
AS
|
||||
a INT:=10;
|
||||
BEGIN
|
||||
SELECT a INTO a FROM t1;
|
||||
RETURN 'OK';
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN RETURN 'Exception';
|
||||
END;
|
||||
$$
|
||||
SELECT f1() FROM DUAL;
|
||||
f1()
|
||||
Exception
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
|
||||
#
|
||||
|
Reference in New Issue
Block a user