Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
When running with sql_mode=ORACLE, MariaDB (the bb-10.2-compatibility branch) requires extra BEGIN..END in multi-statement exception handlers in THEN clause:
SET sql_mode=ORACLE; |
DROP PROCEDURE p1; |
DELIMITER /
|
CREATE PROCEDURE p1 AS |
BEGIN
|
INSERT INTO t1 (a) VALUES (10); |
EXCEPTION
|
WHEN DUP_VAL_ON_INDEX THEN |
BEGIN |
NULL; |
NULL; |
END; |
WHEN OTHERS THEN |
BEGIN |
NULL; |
NULL; |
END; |
END; |
/
|
DELIMITER ;
|
For better Oracle compatibility, we'll fix it not to require BEGIN..END, to make this work:
SET sql_mode=ORACLE; |
DROP PROCEDURE p1; |
DELIMITER /
|
CREATE PROCEDURE p1 AS |
BEGIN
|
INSERT INTO t1 (a) VALUES (10); |
EXCEPTION
|
WHEN DUP_VAL_ON_INDEX THEN |
NULL; |
NULL; |
WHEN OTHERS THEN |
NULL; |
NULL; |
END; |
/
|
DELIMITER ;
|