[MDEV-21154] AUTO_INCREMENT value too high after certain insert Created: 2019-11-26 Updated: 2020-01-15 Resolved: 2020-01-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert, Storage Engine - InnoDB |
| Affects Version/s: | 10.1, 10.3.20 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Markus Nägele | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS Linux release 7.6.1810 (Core) |
||
| Description |
|
The auto increment of a table is not counting continuously in any case. For example create a table:
Then insert some rows:
After that the added rows have the correct ID, but the auto_increment of the table is not 5 but 8.
Leads to the following table:
And the auto_increment of the table is 15. |
| Comments |
| Comment by Alice Sherepa [ 2020-01-15 ] |
|
This case is not a bug, but expected behavior, please see https://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.html for more details: "Gaps in auto-increment values for “bulk inserts” ... For lock modes 1 or 2, gaps may occur between successive statements because for bulk inserts the exact number of auto-increment values required by each statement may not be known and overestimation is possible." |