Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1, 13.2
-
None
Description
--source include/have_partition.inc
|
 |
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY HASH(pk) PARTITIONS 2; |
INSERT INTO t1 VALUES (2),(4); |
FLUSH TABLES;
|
--write_file $MYSQLTEST_VARDIR/tmp/t1.txt
|
\N
|
EOF
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t1 PARTITION (p1)
|
let $ok= `SELECT GROUP_CONCAT(pk ORDER BY pk)='2,4,5' FROM t1`; |
if (!$ok) |
{
|
--die The loaded row did not get AUTO_INCREMENT value 5, the next value over all partitions |
}
|
DROP TABLE t1; |
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
|
Leads to:
|
CS 10.11.19 ece09631eaf7a66e4e832f5e17059e73a9f24851 (Debug, Clang 22.1.8-20260622) Build 05/10/2026 |
mysqltest: At line 10: query 'LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t1 PARTITION (p1)' failed: HA_ERR_AUTOINC_ERANGE (167): Out of range value for column 'pk' at row 1
|
Without the PARTITION clause, or with PARTITION (p0,p1), the row gets the value 5. A file with an explicit value loads fine. Optimized builds give the same error.
From the code it seems that check_insert_or_replace_autoincrement() in sql/ha_partition.h does not list SQLCOM_LOAD, so only the named partition is opened before the next AUTO_INCREMENT value is read.
Attachments
Issue Links
- relates to
-
MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table | Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
-
- Closed
-
-
MDEV-21561 Assertion `bitmap_is_subset(&m_part_info->read_partitions, &m_part_info->lock_partitions)' failed in ha_partition::start_stmt
-
- Confirmed
-
-
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
-
-
MDEV-41396 SIGSEGV in _ma_unpin_all_pages on INSERT ... PARTITION w/ AUTO_INCREMENT as second key part
-
- Open
-