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

Package members cannot be called cross schema

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6.3
    • None
    • None
    • Linux CentOS 7.9

    Description

      You cannot in MariaDB call functions and procedures that exist in a different schema than the one where the package is created.

      SET SQL_MODE=ORACLE;
       
      CREATE DATABASE IF NOT EXISTS test;
      CREATE DATABASE IF NOT EXISTS test2;
      USE test
       
      delimiter //
      CREATE OR REPLACE PACKAGE pkg1
      AS
         FUNCTION func1() RETURN INTEGER;
         PROCEDURE proc1();
      END
      //
       
      CREATE OR REPLACE PACKAGE BODY pkg1
      IS
         FUNCTION func1()
         RETURN INTEGER
         IS
         BEGIN
            RETURN 1;
         END;
       
         PROCEDURE proc1()
         IS
         BEGIN
            SELECT 2;
         END;
      END
      //
       
      delimiter ;
       
      SELECT pkg1.func1();
      CALL pkg1.proc1;
      USE test2
      SELECT test.pkg1.func1();
      CALL test.pkg1.proc1();
      

      This is valid syntax for Packages in Oracle.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              karlsson Anders Karlsson
              Votes:
              0 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.