summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 35aa306c88c..f3472cac330 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -248,7 +248,7 @@ int update_portion_of_time(THD *thd, TABLE *table,
uint dst_fieldno= lcond ? table->s->period.end_fieldno
: table->s->period.start_fieldno;
- table->file->store_auto_increment();
+ ulonglong prev_insert_id= table->file->next_insert_id;
store_record(table, record[1]);
if (likely(!res))
res= src->save_in_field(table->field[dst_fieldno], true);
@@ -264,7 +264,7 @@ int update_portion_of_time(THD *thd, TABLE *table,
TRG_ACTION_AFTER, true);
restore_record(table, record[1]);
if (res)
- table->file->restore_auto_increment();
+ table->file->restore_auto_increment(prev_insert_id);
if (likely(!res) && lcond && rcond)
res= table->period_make_insert(period_conds.end.item,