When running sql_mode=ORACLE, MariaDB should support:
- user defined EXCEPTION declaration
- using user defined exceptions in RAISE name (signal)
- using user defined exceptions in RAISE (resignal)
- using user defined exceptions in EXCEPTION WHEN
User defined exception names should be case insensitive.
MariaDB does not support multiple handlers for the same SQLSTATE. This script returns an error:
In sql_mode=ORACLE it will be possible to have multiple user-defined exceptions in the same block. All user defined exceptions will be associated with SQLSTATE '45000' and MySQL errno ER_SIGNAL_EXCEPTION
Notice, both e and f are associated with the same SQLSTATE and errno, but having WHEN e followed by WHEN f is valid, because e and f are different exceptions.
However, specifying the same exception multiple times in WHEN clause will not be possible:
The above script will return the ER_SP_DUP_HANDLER error:
In MariaDB variables and exceptions (conditions) are in separate name spaces. Oracle-alike user defined exceptions will be in the same name space with MariaDB conditions.
In Oracle, variables and exceptions (conditions) are in the same name space. Placing exceptions and variables into the same name space will be done separately. See MDEV-11058.