[MDEV-28166] sql_mode=ORACLE: fully qualified package function calls do not work: db.pkg.func() Created: 2022-03-24  Updated: 2022-04-09  Resolved: 2022-03-25

Status: Closed
Project: MariaDB Server
Component/s: Parser, Stored routines
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.9.0, 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
Relates
relates to MDEV-19328 sql_mode=ORACLE: Package function in ... Closed
relates to MDEV-28267 ASAN heap-use-after-free in Item_sp::... Closed

 Description   

MariaDB supports only 2-part qualified names in the package function call syntax:

SET sql_mode=ORACLE;
DELIMITER $$
CREATE OR REPLACE PACKAGE pkg1 AS
  FUNCTION f1 RETURN TEXT;
END;
$$
CREATE PACKAGE BODY pkg1
AS
  FUNCTION f1 RETURN TEXT IS
  BEGIN
    RETURN 'Here';
  END;
END;
$$
DELIMITER ;
SELECT pkg1.f1();

+-----------+
| pkg1.f1() |
+-----------+
| Here      |
+-----------+

So far so good.

But fully qualified (i.e. including database name) calls do not work:

SELECT test.pkg1.f1();

ERROR 1064 (42000): You have an error in your SQL syntax ... near '()' at line 1

This should be fixed. This problem is a blocker for MDEV-19328.


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