diff options
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 17f8995239c..35aa306c88c 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -248,6 +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(); store_record(table, record[1]); if (likely(!res)) res= src->save_in_field(table->field[dst_fieldno], true); @@ -262,6 +263,8 @@ int update_portion_of_time(THD *thd, TABLE *table, res= table->triggers->process_triggers(thd, TRG_EVENT_INSERT, TRG_ACTION_AFTER, true); restore_record(table, record[1]); + if (res) + table->file->restore_auto_increment(); if (likely(!res) && lcond && rcond) res= table->period_make_insert(period_conds.end.item, |