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

Make Global Temporary Tables DDL errors more specific

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • N/A
    • None
    • Q4/2025 Server Maintenance, Q4/2025 Server Development

    Description

      Summary:

      MariaDB MDEV-35915

      12.2.0-opt>CREATE GLOBAL TEMPORARY TABLE t (c INT) ON COMMIT PRESERVE ROWS;
      Query OK, 0 rows affected (0.009 sec)
       
      12.2.0-opt>INSERT t VALUES (1);
      Query OK, 1 row affected (0.000 sec)
       
      12.2.0-opt>DROP TABLE t;
      ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      

      Versus oracle:

      oracle

      SQL> DROP TABLE t;
      DROP TABLE t
                 *
      ERROR at line 1:
      ORA-14452: attempt to create, alter or drop an index on temporary table already in use
      Help: https://docs.oracle.com/error-help/db/ora-14452/
      

      Original description
      The discussion is in MDEV-37385. Lock timeout error for cases like

      CREATE GLOBAL TEMPORARY TABLE t (c INT) ON COMMIT PRESERVE ROWS;
      INSERT t VALUES (1);
      DROP TABLE t;
      

      does not inspire confidence.

      The proposed error is ER_TABLE_ALREADY_IN_USE, though we haven't one.
      Another candidate is ER_LOCK_OR_ACTIVE_TRANSACTION

      Attachments

        Issue Links

          Activity

            People

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