Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
Description
An out of range error is produced when an INSERT is targeted at a partitioned table with a PARTITION clause to force the partition selection. Only occurs when using SELECT to get rows, not when using VALUES clause. Only occurs if the most recent statement targeting the table was a TRUNCATE PARTITION, but the TRUNCATE could be on any partition, not just the one being inserted.
The auto increment has plenty of room within the INT data type size and the relevant field values match the targeted partition. Performing a SELECT without a PARTITION clause against the table resolves the situation and the INSERT with PARTITION succeeds.
Related to MDEV-20718 and MDEV-18244
Before the fixes from MDEV-18244 this would crash. After that was fixed, the VALUES version of the INSERT worked, but the SELECT version throws the out of range error.
I have attached a test case that is slightly modified from the one in MDEV-20718 which demonstrates the slightly different scenario of using INSERT..SELECT.
Attachments
Issue Links
- relates to
-
MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher
- Closed
-
MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning
- Closed