Details

    Description

      I am filing this bug with MariaDB, just for the sake of completeness, as it was already filed with MySQL/InnoDB here (by someone else):

      http://bugs.mysql.com/bug.php?id=76872

      "InnoDB AUTO_INCREMENT produces same value twice"

      "When more than one INSERT is executed concurrently on a non-empty InnoDB table with an AUTO_INCREMENT PK immediately after MySQL start up (before any other INSERTs on the same table) one will often fail with the message like "Duplicate entry '123' for key 'PRIMARY'". This will only happen if innodb_autoinc_lock_mode is 1 or 2 and auto_increment_increment > 1."

      There is much more in the actual bug report, but I didn't want to copy/paste the entire report.

      Attachments

        Activity

          ccalender Chris Calender (Inactive) created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Status Open [ 1 ] Confirmed [ 10101 ]

          Non-deterministic test case by Laurynas Biveinis from the upstream report (run with --repeat=N):

          --source include/have_innodb.inc
           
          # Should be != 0
          SELECT @@innodb_autoinc_lock_mode;
           
          CREATE TABLE `test` (
            `test_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
            `testcol` varchar(256)
          ) ENGINE=InnoDB;
           
          INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk');
           
          SET SESSION auto_increment_increment = 2;
          send INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk');
          --connect(con1,localhost,root,,)
          --connection con1
          SET SESSION auto_increment_increment = 2;
          send INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk');
          # --error 0,1062
          reap;
          --disconnect con1
          --connection default
          # --error 0,1062
          reap;
           
          SELECT * FROM test;
           
          DROP TABLE test;

          elenst Elena Stepanova added a comment - Non-deterministic test case by Laurynas Biveinis from the upstream report (run with --repeat=N): --source include/have_innodb.inc   # Should be != 0 SELECT @@innodb_autoinc_lock_mode;   CREATE TABLE `test` ( `test_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `testcol` varchar(256) ) ENGINE=InnoDB;   INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk');   SET SESSION auto_increment_increment = 2; send INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk'); --connect(con1,localhost,root,,) --connection con1 SET SESSION auto_increment_increment = 2; send INSERT INTO `test` (`testcol`) VALUES ('aldsldjfhasjk'); # --error 0,1062 reap; --disconnect con1 --connection default # --error 0,1062 reap;   SELECT * FROM test;   DROP TABLE test;
          elenst Elena Stepanova made changes -
          Component/s Storage Engine - InnoDB [ 10129 ]
          Fix Version/s 10.1 [ 16100 ]
          Fix Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 5.5 [ 15800 ]
          Affects Version/s 10.0.20 [ 19201 ]
          Labels upstream
          elenst Elena Stepanova made changes -
          ratzpo Rasmus Johansson (Inactive) made changes -
          Assignee Jan Lindström [ jplindst ]
          jplindst Jan Lindström (Inactive) made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Assignee Jan Lindström [ jplindst ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Jan Lindström [ jplindst ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          serg Sergei Golubchik added a comment - http://lists.askmonty.org/pipermail/commits/2015-November/008693.html
          serg Sergei Golubchik made changes -
          Assignee Jan Lindström [ jplindst ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Critical [ 2 ]

          I forgot that this fix should be applied to 5.5 (you need to remove galera change, galera change only to 5.5-galera).

          jplindst Jan Lindström (Inactive) added a comment - I forgot that this fix should be applied to 5.5 (you need to remove galera change, galera change only to 5.5-galera).
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5 [ 15800 ]
          serg Sergei Golubchik made changes -
          Status Stalled [ 10000 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5.47 [ 20300 ]
          Fix Version/s 10.0.23 [ 20401 ]
          Fix Version/s 10.1.10 [ 20402 ]
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          marko Marko Mäkelä added a comment - I ported the MySQL 5.6.35/5.7.17 fix to MariaDB 5.5.65 and reverted our fix because our fix conflicted with a revert that I applied from upstream .

          It is possible that due to the fix that I had to revert due to reverting the MySQL 5.6 change we are reintroducing MySQL Bug #88321 into MariaDB. It is also possible that that bug was fixed by reverting the MySQL 5.6 change. Oracle does not always update the public bug reports.

          elenst, maybe you could try the test case?

          marko Marko Mäkelä added a comment - It is possible that due to the fix that I had to revert due to reverting the MySQL 5.6 change we are reintroducing MySQL Bug #88321 into MariaDB. It is also possible that that bug was fixed by reverting the MySQL 5.6 change. Oracle does not always update the public bug reports. elenst , maybe you could try the test case ?
          marko Marko Mäkelä made changes -
          marko Marko Mäkelä made changes -
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 71711 ] MariaDB v4 [ 149632 ]

          People

            serg Sergei Golubchik
            ccalender Chris Calender (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            13 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.