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

Qualified data types in SP

    XMLWordPrintable

Details

    Description

      Under terms of MDEV-19632 we're introducing qualified data types, e.g.:

      SET sql_mode=ORACLE;
      CREATE TABLE t1 (a mariadb_schema.DATE);
      

      This syntax is needed for disambiguation.

      In stored routines this syntax is not needed for disambiguation, because sql_mode is stored together with the SP definition, so data types are unambiguously parsed according to the SP sql_mode.

      Anyway, for symmetry purposes, let's add qualified syntax inside SP definitions, to make qualified types work in:

      • Function return type

        SET sql_mode=ORACLE;
        DELIMITER $$
        CREATE FUNCTION f1() RETURN mariadb_schema.DATE AS
        BEGIN
          RETURN CURRENT_DATE;
        END;
        $$
        DELIMITER ;
        

      • Parameter type

        SET sql_mode=ORACLE;
        DELIMITER $$
        CREATE PROCEDURE p1(a mariadb_schema.DATE) AS
        BEGIN
          NULL;
        END;
        $$
        DELIMITER ;
        

      • Local variable type

        SET sql_mode=ORACLE;
        DELIMITER $$
        CREATE PROCEDURE p1() AS
          a mariadb_schema.DATE;
        BEGIN
          NULL;
        END;
        $$
        DELIMITER ;
        

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              1 Vote for this issue
              Watchers:
              3 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.