[MDEV-22357] Clearing InnoDB autoincrement counter when upgrading from MariaDB < 10.2.4 Created: 2020-04-23 Updated: 2023-10-04 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Upgrades |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Task | Priority: | Major |
| Reporter: | Michael Widenius | Assignee: | Michael Widenius |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Some MariaDB users have complained that when upgrading from a MariaDB 10.1 to MariaDB 10.2+ The reason is probably that the area that InnoDB uses to store auto_increment in 10.2.4 and above can in some cases contain 'not cleared data', which causes the above problem. The intent of this task is to ensure that when upgrading from MariaDB < 10.2.4 then this area is cleared, which would mean that next generated auto_increment would be max(auto_increment_column) +1 Here follows the suggested way to do this: Update innodb::check_for_upgrade() as follows: Returning HA_ADMIN_NEEDS_UPGRADE will cause mysqlcheck (part of mysql_upgrade) to call REPAIR and thus innodb::repair() will be called. In innodb::repair, if the above test in check_for_upgrade() is true if check_for_upgrade() or repair() returns HA_ADMIN_OK then Upper level change: Change in handler::ha_repair() DBUG_ASSERT(result == HA_ADMIN_NOT_IMPLEMENTED || -> DBUG_ASSERT(result == HA_ADMIN_NOT_IMPLEMENTED || The end effect of this change would be that if one runs mysql_upgrade, then any INNODB tables created before 10.2.4 will have it's auto_increment area cleared and the next generated auto_increment value will be max(auto_increment_column) +1 |
| Comments |
| Comment by Marko Mäkelä [ 2022-01-14 ] |
|
Sorry, I have not come around to this. Is this still needed? MariaDB Server 10.1 reached End of Life in October 2020. I suppose that everyone will have upgraded already. |