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

REPLACE INTO not updating auto_increment correctly for galera cluster

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.0.20-galera
    • N/A
    • None
    • Debian 7.8
      MaxScale 1.2.1
      wsrep_auto_increment_control=OFF
      wsrep_sync_wait=1
      auto_increment_increment=1
      MaxScale configured with R/W Split

    Description

      Similar to, but not exactly the same as http://bugs.mysql.com/bug.php?id=65116.

      Only shows up on cluster, standalone install work fine.

      Create the following table:
      CREATE TABLE `auto_inc` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `data` varchar(45) DEFAULT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `data_UNIQUE` (`data`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

      Insert some data using REPLACE INTO:

      REPLACE INTO auto_inc (data) VALUES ('Hello');

      SHOW TABLE STATUS LIKE 'auto_inc' shows Auto_increment set to 2.

      Issue the same query again:
      REPLACE INTO auto_inc (data) VALUES ('Hello');

      The row is now updated with id=2, but auto_increment is unchanged. On next insert this will result in duplicate key error.

      Attachments

        Issue Links

          Activity

            People

              jplindst Jan Lindström (Inactive)
              mmikkola Mattias Mikkola
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.