1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for bug #10886 merge

This commit is contained in:
evgen@moonbone.local
2005-06-22 21:07:28 +04:00
3 changed files with 22 additions and 1 deletions

View File

@ -2119,9 +2119,12 @@ bool select_insert::send_data(List<Item> &values)
}
if (!(error= write_record(thd, table, &info)))
{
if (table->triggers)
if (table->triggers || info.handle_duplicates == DUP_UPDATE)
{
/*
Restore fields of the record since it is possible that they were
changed by ON DUPLICATE KEY UPDATE clause.
If triggers exist then whey can modify some fields which were not
originally touched by INSERT ... SELECT, so we have to restore
their original values for the next row.