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

`FUNCTION does not exist` error on package body assoc array variable

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      A syntax error happens when parsing this package definition:

      SET sql_mode=ORACLE;
       
      DELIMITER $$
      CREATE OR REPLACE PACKAGE pkg1 AS
        PROCEDURE p1;
      END;
      $$
      CREATE OR REPLACE PACKAGE BODY pkg1 AS
        TYPE assoc_t IS TABLE OF INTEGER INDEX BY INTEGER;
        assoc0 assoc_t;
        PROCEDURE p1 AS
        BEGIN
          assoc0(0):= 10;
          SELECT assoc0.exists(0);
        END;
      END;
      $$
      DELIMITER ;
      CALL pkg1.p1;
      

      ERROR 1630 (42000) at line 19: FUNCTION assoc0.exists does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
      

      The error is wrong, this script should work. Note, it works if I move the variable definition from the PACKAGE BODY to the package procedure p1.

      Attachments

        Issue Links

          Activity

            People

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