Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38933

Implement basic low level functions for DBMS_SQL

    XMLWordPrintable

Details

    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 OPEN c0 FOR PREPARE stmt
      • Statement FETCH c0
      • 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 OPEN c0 FOR PREPARE stmt

      This statement opens a SYS_REFCURSOR variable from a previously prepared statement. This statement is not standard and is a MariaDB extension.

      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

        Activity

          People

            Unassigned Unassigned
            bar Alexander Barkov
            Alexander Barkov Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.