ClustrixDB provides support for MariaDB Stored Routines (Procedures and Functions) with the following exceptions.
Unsupported Stored Routine Features
- Altering a routine
- Creating a view which calls a stored routine - ClustrixDB will permit the creation of the view, but querying the view is unsupported.
- Creating a prepared statement that calls a stored routine
- SQL 2003 Compliant Case Statement
- RESIGNAL
- Savepoints
- Backups via stored routines (stored functions)
Caveats of the Stored Routine Feature
MariaDB does not allow dynamic SQL in stored routines, but in ClustrixDB you can use SQL prepared statements (PREPARE, EXECUTE) in stored routines.
ClustrixDB will not report an error when encountering duplicate label names.
- When creating a table with a trailing select statement, (CREATE ... SELECT), the following data types do not translate properly:
- BIT type will always be BIT(64)
- DECIMAL type will become VDECIMAL
- ENUM and SET types will always be VARCHAR(256)
- Storing a TIMESTAMP in a session variable yields 0000-00-00 00:00:00.
- ClustrixDB allows you to create a stored procedure with the same name as system built-in procedures. MariaDB does not permit this.
Example: CREATE PROCEDURE pi(); BEGIN; END; does not error in Xpand. - ClustrixDB allows DROP or ALTER of another stored routine from within a stored routine