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

Global temp table with ON COMMIT PRESERVE ROWS results in a lock wait timeout

    XMLWordPrintable

Details

    • Unexpected results

    Description

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 34
      Server version: 12.3.0-MariaDB MariaDB Server
       
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [(none)]> USE test
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Database changed
      MariaDB [test]> SELECT @@lock_wait_timeout;
      +---------------------+
      | @@lock_wait_timeout |
      +---------------------+
      |               86400 |
      +---------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> 
      MariaDB [test]> CREATE OR REPLACE GLOBAL TEMPORARY TABLE tmp (
          ->     id INT NOT NULL,
          ->     PRIMARY KEY (id)
          -> )
          ->     ENGINE InnoDB
          ->     ON COMMIT PRESERVE ROWS
          -> ;
      Query OK, 0 rows affected (0.007 sec)
       
      MariaDB [test]> 
      MariaDB [test]> START TRANSACTION;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> INSERT INTO tmp (date_1, date_2) VALUES (CURRENT_DATE(), CURRENT_DATE() + INTERVAL 1 DAY);
      ERROR 1054 (42S22): Unknown column 'date_1' in 'INSERT INTO'
      MariaDB [test]> SELECT * FROM tmp;
      Empty set (0.000 sec)
       
      MariaDB [test]> COMMIT;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> 
      MariaDB [test]> CREATE OR REPLACE GLOBAL TEMPORARY TABLE tmp (
          ->     id INT NOT NULL,
          ->     PRIMARY KEY (id)
          -> )
          ->     ENGINE InnoDB
          ->     ON COMMIT PRESERVE ROWS
          -> ;
      ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      

      It happens consistently.
      The timeout has not been reached.
      COMMIT or ROLLBACK don't solve the problem
      Closing the connection and starting a new one solves the problem.

      Attachments

        Issue Links

          Activity

            People

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