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

TokuDB: Behavior of auto_increment_offset + auto_increment_increment differs from MySQL spec

    XMLWordPrintable

Details

    Description

      According to MySQL manual (http://dev.mysql.com/doc/refman/5.5/en/replication-options-master.html#sysvar_auto_increment_increment), if the combination of values is valid, the auto-increment sequence should start from auto_increment_offset. With TokuDB, it starts from auto_increment_offset+auto_increment_increment – in other words, the first value is omitted.

      SET auto_increment_offset = 200;
      SET auto_increment_increment = 300;
      CREATE TABLE t1 (a int AUTO_INCREMENT, b char(8), primary key(a)) ENGINE=TokuDB;
      INSERT INTO t1 VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
      SELECT LAST_INSERT_ID();
      LAST_INSERT_ID()
      500
      SELECT a,b FROM t1;
      a	b
      500	a
      800	b
      1100	c

      Test case:

      install soname 'ha_tokudb.so';
       
      SET auto_increment_offset = 200;
      SET auto_increment_increment = 300;
      CREATE TABLE t1 (a int AUTO_INCREMENT, b char(8), primary key(a)) ENGINE=TokuDB;
      INSERT INTO t1 VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
      SELECT LAST_INSERT_ID();
      SELECT a,b FROM t1;

      bzr version-info

      revision-id: holyfoot@askmonty.org-20130514121908-d6tp4zsdkim0q4dg
      revno: 3768
      branch-nick: 5.5-hf-tokudb

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.