Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.8, 12.3, 13.2
-
None
-
Can result in hang or crash
Description
Crash or stack overrun when using its own package routine as DEFAULT
The script below produces a stack overrun error, but also can crash occasionally. It should not produce any errors and parse with success. The routine pkgx.g() obviously refers to g() of this package pkgx, just using the qualified notation. It should work like if it was written FUNCTION f(a BIGINT := pkgx.g()) RETURN BIGINT;:
SET sql_mode=ORACLE; |
DELIMITER $$
|
CREATE OR REPLACE PACKAGE pkgx AS |
FUNCTION g RETURN BIGINT; |
FUNCTION f(a BIGINT := pkgx.g()) RETURN BIGINT; |
END; |
$$
|
CREATE PACKAGE BODY pkgx AS |
FUNCTION g RETURN BIGINT AS |
BEGIN |
RETURN 1; |
END; |
FUNCTION f(a BIGINT := pkgx.g()) RETURN BIGINT AS |
BEGIN |
RETURN a; |
END; |
END; |
$$
|
DELIMITER ;
|
SELECT pkgx.f(); |
SHOW WARNINGS;
|
ERROR 1457 (HY000): Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS
|
MariaDB [test]> DELIMITER ;
|
MariaDB [test]> SELECT pkgx.f();
|
ERROR 1457 (HY000): Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS
|
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Error | 1436 | Thread stack overrun: 229392 bytes used of a 299008 byte stack, and 81920 bytes needed. Consider increasing the thread_stack system variable. |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
| Error | 1457 | Failed to load routine test.pkgx (internal code -6). For more details, run SHOW WARNINGS |
|
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------+
|
Attachments
Issue Links
- relates to
-
MDEV-41817 Crash on cyclic package specifications (parameter defaults call each other)
-
- Open
-