[MDEV-15400] Upgrading to 10.2 breaks auto increment Created: 2018-02-23  Updated: 2020-04-23  Resolved: 2018-04-15

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2.13
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: bichinhoverde Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback

Issue Links:
Relates
relates to MDEV-20892 AUTO_INCREMENT is set lower than the ... Closed

 Description   

How to reproduce:
1. Install old MySQL (I was using Percona).
2. Create a table with auto_increment = something
3. Insert some rows
4. Upgrade to MariaDB 10.2
5. Inserting new rows causes Duplicate entry 'xxx' for key 'PRIMARY'

I think this issue is related to how MariaDB 10.2 handles auto_increment. Before, it would recalculate the next auto_increment every time the server was started. Now it is persistent, but after an upgrade, it uses the old auto_increment that was in the initial create table statement.

A workaround is to remove the auto increment and add it again.



 Comments   
Comment by Elena Stepanova [ 2018-03-16 ]

Please provide the table definition, exact statements that you use to insert values, and specify the version of the old server that you were using before the upgrade.
I can't reproduce it, for example, upon upgrade from Percona 5.6.38 to MariaDB 10.2.13 with a minimal table structure.

Generated at Thu Feb 08 08:21:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.