Bug #77542 | Autoincrement variables Have different Behavior than the document | ||
---|---|---|---|
Submitted: | 29 Jun 2015 13:41 | Modified: | 10 Jul 2015 12:49 |
Reporter: | Justin Biebber | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.6, 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | auto_increment_increment, auto_increment_offset |
[29 Jun 2015 13:41]
Justin Biebber
[29 Jun 2015 16:26]
MySQL Verification Team
I think that our documentation covers the effects of the change in those values good enough. Relevant chapter in our manual is the 5.1.4 (Server-wise system variables), where you can find sufficient description, among others: " 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. In other words, the series is calculated like so: "
[9 Jul 2015 23:14]
Justin Biebber
I can't agree with you. Just look at the words here: 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. The series is calculated like this: auto_increment_offset(5) + N × auto_increment_increment(10) According to the equation: The calculated numbers are : 5, 15, 25, 35, 45, 55. The existing numbers are: 1, 11, 21, 31. Now, with your normal logic, just tell me, which is the LEAST number that is greater than 31? 35 or 45? According to the equation, it should be 35. But unfortunately, my test result is 45. That's why I ask you to fix the document. It's really wrong!
[10 Jul 2015 12:49]
MySQL Verification Team
You are reporting that values that come, AFTER one of those variables are changed, are not logical. The text from our manual that I quoted is on the point. There is no logic in the next value after one of those variables are changed.