[MDEV-25357] AUTO_INCREMENT on secondary column can result in duplicate keys when using Aria storage engine Created: 2021-04-07 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Aria |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.4.13, 10.4.17, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Martijn | Assignee: | Alexey Botchkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | auto_increment | ||
| Environment: |
Linux |
||
| Description |
|
Start two or more connections running
This will eventually result in a duplicate entry error (1062). This does not happen when using the MyISAM storage engine. |
| Comments |
| Comment by Martijn [ 2021-04-07 ] | ||||
|
Perhaps worth noting that this feature (having AUTO_INCREMENT on a secondary column) is not mentioned on https://mariadb.com/kb/en/auto_increment/ It is however mentioned in the MySQL manual (for MyISAM):
https://dev.mysql.com/doc/refman/8.0/en/example-auto-increment.html | ||||
| Comment by Alice Sherepa [ 2021-04-12 ] | ||||
|
thank you, repeatable on 5.5-10.5, getting "Duplicate entry" errors:
KB says "In some storage engines (including the default InnoDB), if the key consists of multiple columns, the AUTO_INCREMENT column must be the first column. Storage engines that permit the column to be placed elsewhere are Aria, MyISAM, MERGE, Spider, TokuDB, BLACKHOLE, FederatedX and Federated.", so it is mentioned, maybe not explained. (https://mariadb.com/kb/en/auto_increment/) |