[MDEV-16479] Oracle Comp.: Sql-Error when referencing database/schema in "select package-function from dual" Created: 2018-06-13  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.3.7
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Mebo Assignee: Alexander Barkov
Resolution: Unresolved Votes: 2
Labels: Compatibility, oracle, pl/sql
Environment:

Mac/Windows/DBeaver 5.0.5



 Description   

CREATE OR REPLACE PACKAGE lic.mytools AS
  FUNCTION gettest(atext INT) RETURN INT;
END;
 
CREATE OR REPLACE PACKAGE BODY lic.mytools AS
  FUNCTION gettest(atext INT) RETURN INT AS
    nSalary DECIMAL(10,2);
  BEGIN
    RETURN 111;
  END;
BEGIN
  -- This code is executed when the current session
  -- accesses any of the package routines for the first time
  -- log(0, 'Session ' || connection_id() || ' ' || current_user || ' started');
END;

use lic
 
select mytools.gettest(123) from dual;
--> 111
 
select lic.mytools.gettest(123) from dual;
--> SQL Error [1064] [42000]: (conn:16) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(123) from dual
Query is : select lic.mytools.gettest(123) from dual

We use to have util packages in a separate schema on oracle which could be called from any other schema. Shouldn't this also work analog here?



 Comments   
Comment by Elena Stepanova [ 2018-07-02 ]

It's not about DUAL, simple select lic.mytools.gettest(123) produces the same error. I don't think that three-level name specification is supported at all, assigning to bar to clarify whether it should be.

Comment by Alexander Barkov [ 2018-07-03 ]

Elena is right, three-level name specification is not supported yet.
This needs to be fixed.

Generated at Thu Feb 08 08:29:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.