mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
sql_insert.cc:
After merge fix.
This commit is contained in:
parent
37add3b661
commit
41c732493e
1 changed files with 12 additions and 16 deletions
|
@ -1262,26 +1262,22 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
|||
compare_record(table))
|
||||
{
|
||||
info->updated++;
|
||||
/*
|
||||
If ON DUP KEY UPDATE updates a row instead of inserting one, it's
|
||||
like a regular UPDATE statement: it should not affect the value of a
|
||||
next SELECT LAST_INSERT_ID() or mysql_insert_id().
|
||||
Except if LAST_INSERT_ID(#) was in the INSERT query, which is
|
||||
handled separately by THD::arg_of_last_insert_id_function.
|
||||
*/
|
||||
insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
|
||||
if (table->next_number_field)
|
||||
table->file->adjust_next_insert_id_after_explicit_value(
|
||||
table->next_number_field->val_int());
|
||||
trg_error= (table->triggers &&
|
||||
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
|
||||
TRG_ACTION_AFTER,
|
||||
TRUE));
|
||||
TRG_ACTION_AFTER, TRUE));
|
||||
info->copied++;
|
||||
}
|
||||
/*
|
||||
If ON DUP KEY UPDATE updates a row instead of inserting one, it's
|
||||
like a regular UPDATE statement: it should not affect the value of a
|
||||
next SELECT LAST_INSERT_ID() or mysql_insert_id().
|
||||
Except if LAST_INSERT_ID(#) was in the INSERT query, which is
|
||||
handled separately by THD::arg_of_last_insert_id_function.
|
||||
*/
|
||||
insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
|
||||
if (table->next_number_field)
|
||||
table->file->adjust_next_insert_id_after_explicit_value(
|
||||
table->next_number_field->val_int());
|
||||
trg_error= (table->triggers &&
|
||||
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
|
||||
TRG_ACTION_AFTER, TRUE));
|
||||
|
||||
goto ok_or_after_trg_err;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue