Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10764 PL/SQL parser - Phase 2
  3. MDEV-11210

TYPE OF and %TYPE in stored function RETURN data type

    XMLWordPrintable

Details

    • Technical task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3(EOL)
    • None
    • Parser
    • None

    Description

      The task MDEV-10577 implemented anchored data types for stored routine local variables and parameters.

      • TYPE OF, for sql_mode=DEFAULT
      • %TYPE, for sql_mode=ORACLE

      This task will additionally allow to use anchored data types as stored function return data types:

      SET sql_mode=DEFAULT;
      DROP TABLE t1;
      DROP FUNCTION f1;
      CREATE TABLE t1 (a INT);
      DELIMITER /
      CREATE FUNCTION f1() RETURNS TYPE OF t1.a RETURN 0;
      BEGIN
        RETURN 0;
      END;
      /
      DELIMITER ;
      SELECT f1() FROM DUAL;
      

      SET sql_mode=ORACLE;
      DROP TABLE t1;
      DROP FUNCTION f1;
      CREATE TABLE t1 (a INT);
      DELIMITER /
      CREATE FUNCTION f1 RETURN t1.a%TYPE
      AS
      BEGIN
        RETURN 0;
      END;
      /
      DELIMITER ;
      SELECT f1() FROM DUAL;
      

      Attachments

        Issue Links

          Activity

            People

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