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

Unexpected Table does not exist error in procedure with PS

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q3/2026 Server Development

    Description

      CREATE OR REPLACE TABLE t1 (a INT) ENGINE=MyISAM;
      DELIMITER $$
      CREATE OR REPLACE PROCEDURE p3()
      BEGIN
         EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (9)';
      END;
      $$
      CREATE OR REPLACE FUNCTION f2() RETURNS INT
      BEGIN
        CALL p3();
        RETURN 0;
      END;
      $$
      CREATE OR REPLACE PROCEDURE p1()
      BEGIN
        DECLARE n INT;
        SET n= f2();
      END;
      $$
      DELIMITER ;
      CALL p1;
      

      ERROR 1146 (42S02): Table 'test.t1' doesn't exist
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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