Bug #35369 Abnormal behavior when auto_increment_offset is greater than auto_increment_incr
Submitted: 18 Mar 2008 6:37 Modified: 19 Mar 2008 8:44
Reporter: Salman Rawala Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.22 OS:Windows
Assigned to: CPU Architecture:Any
Tags: auto_increment_offset

[18 Mar 2008 6:37] Salman Rawala
Description:
On assigning value to variable auto_increment_offset greater than auto_increment_increment, index value starts incrementing randomly.

How to repeat:
Current offset value is 125

SET @@auto_increment_offset = 140;
SET @@auto_increment_increment = 10;

INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');

Actual Output
=============
SELECT * from t1;
id	name
5	Record_1
15	Record_2
24	Record_3
34	Record_4
36	Record_5
51	Record_6
54	Record_7
69	Record_8
80	Record_9
95	Record_10
110	Record_11
125	Record_12
134	Record_13
140	Record_14
[19 Mar 2008 8:44] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

According to http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#option_mysqld_auto-inc...: "If the value of auto_increment_offset  is greater than that of auto_increment_increment, the value of auto_increment_offset is ignored. Should one or both of these variables be changed and then new rows inserted into a table containing an AUTO_INCREMENT column, the results may seem counterintuitive because the series of AUTO_INCREMENT values is calculated without regard to any values already present in the column, and the next value inserted is the least value in the series that is greater than the maximum existing value in the AUTO_INCREMENT column. " So I close this report as "Not a Bug"