Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.4, 11.5(EOL)
-
None
Description
Non-Oracle mode.
The following package can be created without errors:
CREATE SCHEMA IF NOT EXISTS test; |
USE test; |
|
DELIMITER ||
|
|
CREATE OR REPLACE PACKAGE ctr |
FUNCTION a() RETURNS INT; |
END; |
||
|
|
CREATE OR REPLACE PACKAGE BODY ctr |
|
FUNCTION a() RETURNS INT |
BEGIN |
RETURN b(); |
END; |
|
FUNCTION b() RETURNS INT |
BEGIN |
RETURN 1; |
END; |
END; |
||
|
|
DELIMITER ;
|
But calling a() returns an error:
MariaDB [test]> SELECT ctr.a(); |
ERROR 1305 (42000): FUNCTION test.b does not exist |
This happens because b() was not defined before the line that calls it.
You can verify that the code works if you invert a() and b() code, or if you declare b() in CREATE PACKAGE.
This error makes it impossible to have two mutually recursive private methods.
Attachments
Issue Links
- relates to
-
MDEV-32101 CREATE PACKAGE [BODY] for sql_mode=DEFAULT
- Closed