Bug #28800 ON DUPLICATE KEY UPDATE doesn't run triggers
Submitted: 31 May 2007 9:16 Modified: 31 May 2007 10:36
Reporter: Filipe Martins Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.0.37-community-nt OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any
Tags: ON DUPLICATE KEY UPDATE, triggers

[31 May 2007 9:16] Filipe Martins
Description:
When we run a INSERT statement with a ON DUPLICATE KEY UPDATE clause, triggers aren't run if the key already exists and the ON DUPLICATE KEY UPDATE updates the table, even if the value it updates is the different from the one in the field.

I can't see why the ON BEFORE/AFTER UPDATE trigger shouldn't run...

How to repeat:
I'll upload a complete test file. Please put it in a database an than just "CALL test();"

Suggested fix:
I think update triggers should be run everytime the data changes.
[31 May 2007 9:18] Filipe Martins
Test file with a working sample of what's happening

Attachment: onkeyupdate_trigger.sql (application/octet-stream, text), 2.37 KiB.

[31 May 2007 10:37] Sveta Smirnova
Thank you for the report.

Bug is repeatable with 5.0.37, but is not repeatable with current sources. So I close it as "Can't repeat"