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

MDEV-6849 ON UPDATE CURRENT_TIMESTAMP doesn't always work

reset default fields not for every modified row, but only once,
at the beginning, as the set of modified fields doesn't change.

exception: INSERT ... ON DUPLICATE KEY UPDATE - the set of fields
does change per row and in that case we reset default fields per row.
This commit is contained in:
Sergei Golubchik
2014-11-13 13:40:11 +01:00
parent 815667086c
commit 6a2c170141
7 changed files with 74 additions and 15 deletions

View File

@ -717,6 +717,8 @@ int mysql_update(THD *thd,
if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)
table->prepare_for_position();
table->reset_default_fields();
/*
We can use compare_record() to optimize away updates if
the table handler is returning all columns OR if
@ -1693,6 +1695,7 @@ int multi_update::prepare(List<Item> &not_used_values,
table->covering_keys.clear_all();
table->pos_in_table_list= tl;
table->prepare_triggers_for_update_stmt_or_event();
table->reset_default_fields();
}
}