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

sql_mode=ORACLE: TYPE definitions in PACKAGE BODY

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      MariaDB supports RECORD and associative array data type definitions inside routines.
      However, RECORD and associative array declarations were forgotten in PACKAGE BODY.

      Under terms of this tasks we'll also allow type definitions inside PACKAGE BODY, to make this work:

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE OR REPLACE PACKAGE pkg1 AS
        PROCEDURE p1;
      END;
      $$
      CREATE OR REPLACE PACKAGE BODY pkg1 AS
        TYPE record_t IS RECORD (a INT, b VARCHAR(32));
        TYPE assoc_t IS TABLE OF record_t INDEX BY INT;
        PROCEDURE p1 AS
        a assoc_t;
        BEGIN
          a(10):= record_t(10,'test');
          SELECT a(10).a, a(10).b;
        END;
      END;
      $$
      DELIMITER ;
       
      CALL pkg1.p1;
      

      +---------+---------+
      | a(10).a | a(10).b |
      +---------+---------+
      |      10 | test    |
      +---------+---------+
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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