[MDEV-27010] Package members cannot be called cross schema Created: 2021-11-09  Updated: 2021-11-19

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Procedure
Affects Version/s: 10.6.3
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Anders Karlsson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux CentOS 7.9


Issue Links:
Relates
relates to MDEV-10591 Oracle-style packages Closed

 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.


Generated at Thu Feb 08 09:49:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.