Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
We need to have a way to list package routines.
Different implementation ways are possible.
Treat packages as SQL Standard Modules
We can add SQL Standard columns into INFORMATION_SCHEMA.ROUTINES:
- MODULE_SCHEMA
- MODULE_NAME
and fill these new columns to: - NULL for regular (schema) routines
- the schema and the name of the containing package for package routines
One will be able to run this statement to list routines in a specific package:
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
|
WHERE MODULE_SCHEMA='package_db' AND MODULE_NAME='package_name';
|
Treat packages as separate instances (not modules)
This proposal assumes that a PACKAGE is something completely different from a MODULE.
Peter Gulutzan in his blog post at http://ocelot.ca/blog/blog/2024/01/31/packages-in-mariadb-default-mode/ suggest adding a special column PACKAGE_NAME into INFORMATION_SCHEMA.ROUTINES.
Implementation questions
No matter which presentation way we choose, listing package routines in INFORMATION_SCHEMA.ROUTINES can be inefficient in case if a database has many packages:
every CREATE PACKAGE BODY statement (and possibly every corresponding CREATE PACKAGE statement) will have to be parsed.
Attachments
Issue Links
- relates to
-
MDEV-32101 CREATE PACKAGE [BODY] for sql_mode=DEFAULT
- Closed