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

Wrong error on DROP TABLE GTT after DROP DATABASE

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Maintenance

    Description

      as reported by Roel, drop table:

      USE test;
      CREATE GLOBAL TEMPORARY TABLE t (c INT) ON COMMIT PRESERVE ROWS;
      UPDATE t SET foo=1;
      DROP DATABASE test;
      CREATE DATABASE test;
      USE test;
      SHOW TABLES;  # No tables 
      DROP TABLE t;  # ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      DROP TABLE tt;  # As a test; no such table
      

      results in LOCK_WAIT_TIMEOUT,

      This means the child table still exists.

      We may find though that select * from t; results in ER_NO_SUCH_TABLE.
      Note that temporary tables are not dropped as part of DROP DATABASE:

      use test;
      create temporary table tt(x int);
      drop database test;
      create database test;
      use test;
      select * from tt;
      

      results in no error.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.