[MDEV-19907] In Partiitioned table using HASH, AUTOINCREMENT value reverts to original CREATE TABLE value when INSERTing explicitly to empty partition immediately after ANALYZE TABLE. Created: 2019-06-29 Updated: 2020-08-25 Resolved: 2019-07-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - MyISAM |
| Affects Version/s: | 10.3.7, 10.3.8, 10.3.9, 10.3.10, 10.3.11, 10.3.12, 10.3.13, 10.3.14, 10.3.15, 10.3.16, 10.4.6, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Juan | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | 10.3, 10.4, MyISAM, partitioning | ||
| Environment: |
CentOS 7.5 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
INSERTing explicitly to specific partition immediately after running ANALYZE TABLE in a MyISAM or Aria table partitioned by HASH with an AUTOINCREMENT column causes the AUTOINCREMENT value to revert to the original CREATE TABLE value, resulting in duplicate values. This happens when the table is MyISAM, has at least 2 partitions, and the inserts are done first to one partition, and immediately after running ANALYZE TABLE, INSERTs are done to another partition, and all inserts are done to specific partitions of a table partitioned by HASH. Any statement that touches table metadata, such as a SELECT from the table or a SHOW CREATE TABLE, makes it so the subsequent INSERT works correctly, but an INSERT into an empty partition, done immediately after an ANALYZE TABLE, always produces this error. Changing engines to either Aria or InnoDB has no effect in 10.2 servers (they still work correctly). However, in 10.3 and 10.4 servers using either Aria or InnoDB for the test results in a server crash on the first insert operation. ====Test Case====
|
| Comments |
| Comment by Juan [ 2019-06-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
The attached log shows the crash that results when running the same test case on 10.4.6 with Aria or InnoDB engines in place of MyISAM. Same result in 10.3. In 10.2, Aria & InnoDB run the test correctly with no duplicate AUTOINCREMENT values, as does MyISAM. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2019-07-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks! I repeated the crash on 10.3, 10.4, it seems to be the same bug as
Wrong auto_increment values while using MyIsam:
| ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Juan [ 2019-07-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
If this issue duplicates another, it is not appearing in the search above. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Juan [ 2019-07-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Found it! |