Details
-
New Feature
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q2/2026 Server Maintenance, Q2/2026 Server Development
Description
Under terms of this task we'll implement low level functionality which will be later used by the DBMS_SQL package.
Functionality to be implemented:
- Statement EXECUTE stmt0 – without USING clause
- Statement FETCH c0 – without INTO clause
- Function DBMS_SQL_COMMAND(ps_name)
- Function DBMS_SQL_BIND_PARAM_BY_NAME(ps_name,pos,value)
- Function DBMS_SQL_COLUMN_VALUE(c,pos,dst)
Details.
Statement EXECUTE stmt0 – without USING
This statement executes a prepared statement with some parameters, assuming that all parameters were previously set by DBMS_SQL_BIND_PARAM_BY_NAME calls. This assumes sql_mode=ORACLE, which supports named parameters.
Statement FETCH c0
This statement fetches from a SYS_REFCURSOR variable without specifying a target list. On the very first call after OPEN it sets the cursor position to the very first record. On concequent calls it moves the cursor pointer to the next record. This statement is not standard and is a MariaDB extension.
Function DBMS_SQL_COMMAND(ps_name) RETURN INT
This function returns the sql command of the prepared statement with name ps_name, according to enum_sql_command. If ps_name is not a known prepared statement then NULL is returned.
Function DBMS_SQL_BIND_PARAM_BY_NAME(ps_name SYS_REFCURSOR,pos INT,value <data type>) RETURN BOOL
This function allows to bind parameters by name and then call EXECUTE without specifying the USING clause. <data type> can be any data type supported in the USING clause of the EXECUTE statement. This functions returns 0 on success and NULL on error.
Function DBMS_SQL_COLUMN_VALUE(c SYS_REFCURSOR,pos INT,dst <data type>) RETURN BOOL
This function allows to get cursor column values. Designed to be used in combination with FETCH without a target list. <data type> can be any data type supported by the target list in the INTO clause of the FETCH statement. This function returns 0 on success and NULL on error.
The above list is not the full set of low level functionality which will be added for DBMS_SQL. It's just the basic set. Some more low level functions will be needed, the will be added later.
Attachments
Issue Links
- relates to
-
MDEV-39022 Add `LOCAL spvar` syntax for prepared statements and SYS_REFCURSORs
-
- In Review
-