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: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.11, 11.1(EOL), 11.2, 11.4, 10.4(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.3(EOL), 11.5(EOL)
    • 10.5, 10.6, 10.11, 11.2, 11.4
    • 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

              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.