Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33385

Support package routines in metadata views

    XMLWordPrintable

Details

    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

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.