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

InnoDB: Error: trx already had an AUTO-INC lock

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
      --source include/have_partition.inc
       
      CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB PARTITION BY key (pk) PARTITIONS 2;
       
      CREATE TABLE t2 (a INT) ENGINE=InnoDB;
      INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);
       
      CREATE TABLE t3 (b INT) ENGINE=InnoDB;
      INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
       
      --connect (con1,localhost,root,,test)
      --send
        INSERT t1 SELECT NULL FROM t2;
       
      --connection default
      --error 0,ER_LOCK_DEADLOCK
      INSERT t1 SELECT NULL FROM t3;
       
      --connection con1
      --error 0,ER_LOCK_DEADLOCK
      --reap
       
      # Cleanup
      --disconnect con1
      --connection default
      DROP TABLE t1, t2, t3;
      

      10.1 1d10c9afe0f2f

      line
      InnoDB: Error: trx already had an AUTO-INC lock!
      ^ Found warnings in /data/bld/10.1/mysql-test/var/log/mysqld.1.err
      ok
      

      The error started appearing in 10.1 tree with this commit:

      commit 723f87e9d318aedad30dfb9dde104312d6612662
      Author: Marko Mäkelä
      Date:   Wed Mar 14 09:39:47 2018 +0200
       
          lock_table_create(), lock_rec_create(): Clean up the WSREP code
          
          By definition, c_lock->trx->lock.wait_lock==c_lock cannot hold.
          That is, the owner transaction of a lock cannot be waiting for that
          particular lock. It must have been waiting for some other lock.
          Remove the dead code related to that. Also, test c_lock for NULLness
          only once.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: