summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-06-22 00:56:16 +0900
committerNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-06-28 01:48:55 +0900
commit5375f0b495b69dbd6e1d5558ace6ce0fcd9cc636 (patch)
tree5fb7b87dc6725e591bafb0ac06895348508388e4 /sql/ha_partition.h
parentf339ef3f9793d5de8f825f1ec6489550b98e7e9a (diff)
downloadmariadb-git-5375f0b495b69dbd6e1d5558ace6ce0fcd9cc636.tar.gz
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.
The bug is caused by a similar mechanism as MDEV-21027. The function, check_insert_or_replace_autoincrement, failed to open all the partitions on INSERT SELECT statements and it results in the assertion error.
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 6c0e4ef6cf2..c2a71e143c5 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -1408,7 +1408,8 @@ private:
unless we already did it.
*/
if (!part_share->auto_inc_initialized &&
- (ha_thd()->lex->sql_command == SQLCOM_INSERT ||
+ (ha_thd()->lex->sql_command == SQLCOM_INSERT ||
+ ha_thd()->lex->sql_command == SQLCOM_INSERT_SELECT ||
ha_thd()->lex->sql_command == SQLCOM_REPLACE) &&
table->found_next_number_field)
bitmap_set_all(&m_part_info->read_partitions);