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

Temporary tables are not dropped together with the database which contains them

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      USE test;
      CREATE TEMPORARY TABLE tt (c INT);
      INSERT INTO test.tt VALUES (1);
      DROP DATABASE test;
      CREATE DATABASE test;
      USE test;
      SELECT * FROM tt;
      

      Leads to:

      CS 12.2.0 b8a77289639a3b10ada64cf892f02b5cecdb1603 (Debug, Clang 21.1.0-20250811) Build 24/09/2025

      12.2.0-dbg>USE test;
      Database changed
       
      12.2.0-dbg>CREATE TEMPORARY TABLE tt (c INT);
      Query OK, 0 rows affected (0.001 sec)
       
      12.2.0-dbg>INSERT INTO test.tt VALUES (1);
      Query OK, 1 row affected (0.000 sec)
       
      12.2.0-dbg>DROP DATABASE test;
      Query OK, 0 rows affected (0.006 sec)
       
      12.2.0-dbg>CREATE DATABASE test;
      Query OK, 1 row affected (0.000 sec)
       
      12.2.0-dbg>USE test;
      Database changed
       
      12.2.0-dbg>SELECT * FROM tt;
      +------+
      | c    |
      +------+
      |    1 |
      +------+
      1 row in set (0.000 sec)
      

      Present at least for MyISAM and InnoDB.

      The behavior was addressed for GTT tables, so perhaps the GTT functionality can be copied for TT tables. Ref MDEV-37850.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              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.