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

Unexpected "No database selected" error for a CALL inside an anonymous block

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 12.3, 13.0
    • None
    • None

    Description

      I start a command line client as just "mariadb", i.e. without the current database.
      Then I run this script:

      CREATE DATABASE test1;
      DELIMITER $$
      CREATE OR REPLACE PROCEDURE test1.p1()
      BEGIN
        SELECT 1;
      END;
      $$
      DELIMITER ;
      CALL test1.p1();
      

      +---+
      | 1 |
      +---+
      | 1 |
      +---+
      

      It works as expected.

      Now I call the procedure inside an anonymous block:

      DELIMITER $$
      BEGIN NOT ATOMIC
        CALL test1.p1();
      END;
      $$
      DELIMITER ;
      

      It return an unexpected error:

      ERROR 1046 (3D000): No database selected
      

      The failure is possibly related to MDEV-34391, as it does repease before 12.3.

      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.