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

GTT in-use guard is bypassed by DROP DATABASE statement

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q3/2026 Server Maintenance

    Description

      MTR test

      CREATE GLOBAL TEMPORARY TABLE gtt (id INT) ON COMMIT PRESERVE ROWS;
      INSERT INTO gtt VALUES (1);
      --ERROR ER_TABLE_IN_USE 
      DROP TABLE gtt; -- ER_TABLE_IN_USE (4256)
      DROP DATABASE test; -- SUCCEEDS (bypasses the guard)
      

      13.0.0-opt>CREATE GLOBAL TEMPORARY TABLE gtt (id INT) ON COMMIT PRESERVE ROWS;
      Query OK, 0 rows affected (0.014 sec)
       
      13.0.0-opt>INSERT INTO gtt VALUES (1);
      Query OK, 1 row affected (0.001 sec)
       
      13.0.0-opt>DROP TABLE gtt;
      ERROR 4256 (HY000): Table `test`.`gtt` is in use.
      13.0.0-opt>DROP DATABASE test;
      Query OK, 1 row affected (0.014 sec)
       
      13.0.0-opt>
      

      Attachments

        Issue Links

          Activity

            People

              pranav.tiwari@mariadb.com Pranav Kumar Tiwari
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 14m
                  1d 14m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5d Time Not Required
                  0.5d

                  Git Integration

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