1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY

UPDATE if the row wasn't actually changed.

This bug was caused by fix for bug#19978. It causes AFTER UPDATE triggers
not firing if a row wasn't actually changed by the update part of the
INSERT .. ON DUPLICATE KEY UPDATE.

Now triggers are always fired if a row is touched by the INSERT ... ON
DUPLICATE KEY UPDATE.
This commit is contained in:
evgen@moonbone.local
2007-03-16 17:23:26 +03:00
parent 830c134e84
commit e84584e2e3
3 changed files with 85 additions and 6 deletions

View File

@ -1238,19 +1238,19 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
if (table->next_number_field)
table->file->adjust_next_insert_id_after_explicit_value(
table->next_number_field->val_int());
info->touched++;
info->touched++;
if ((table->file->table_flags() & HA_PARTIAL_COLUMN_READ) ||
compare_record(table, thd->query_id))
{
info->updated++;
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER,
TRUE));
info->copied++;
}
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER,
TRUE));
goto ok_or_after_trg_err;
}
else /* DUP_REPLACE */