summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-03-16 17:23:26 +0300
committerunknown <evgen@moonbone.local>2007-03-16 17:23:26 +0300
commit6d93f15039d551f291232c1b60527b00cd9c6bc9 (patch)
treed4d4df4bcb01b8fe3d02056fdf3b0b15e53b3a3c /sql/sql_insert.cc
parent43b9ff1b21b2d645e5cd52d82878a48b47b01f8d (diff)
downloadmariadb-git-6d93f15039d551f291232c1b60527b00cd9c6bc9.tar.gz
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. sql/sql_insert.cc: Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. Now triggers are always fired if a row is touched by the INSERT ... ON DUPLICATE KEY UPDATE. mysql-test/r/trigger.result: Added a test case for the bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. mysql-test/t/trigger.test: Added a test case for the bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 35e724beec8..dd08ccef462 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -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 */