diff options
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r-- | sql/ha_partition.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 2d618f4afe0..00ef8e34ead 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1401,15 +1401,16 @@ private: unlock_auto_increment(); } - void check_insert_autoincrement() + void check_insert_or_replace_autoincrement() { /* - If we INSERT into the table having the AUTO_INCREMENT column, + If we INSERT or REPLACE into the table having the AUTO_INCREMENT column, we have to read all partitions for the next autoincrement value 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_REPLACE) && table->found_next_number_field) bitmap_set_all(&m_part_info->read_partitions); } |