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

Calling a private package routine by its 3-step name does not fail

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5
    • 10.5
    • Stored routines

    Description

      I create the following package with a private procedure and try to call the procedure from outside of the package:

      SET sql_mode=ORACLE;
      CREATE OR REPLACE DATABASE db1;
       
      DELIMITER $$
      CREATE OR REPLACE PACKAGE db1.pkg AS
        PROCEDURE p1;
      END;
      $$
      CREATE PACKAGE BODY db1.pkg AS
        PROCEDURE p0 AS BEGIN SELECT 5; END;
        PROCEDURE p1 AS BEGIN CALL p0(); END;
      END;
      $$
      DELIMITER ;
      USE db1;
      CALL pkg.p0() /* This fails, correct */;
      

      ERROR 1305 (42000): PROCEDURE pkg.p0 does not exist
      

      The CALL statement correctly fails, because pkg.p0 is a private routine.

      Now I use a 3-step procedure name notation:

      CALL db1.pkg.p0() /* This succeeds, wrong */;
      

      +---+
      | 5 |
      +---+
      | 5 |
      +---+
      

      The above is wrong. It should fail in the same way with the first CALL.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.