Commit 81566708 authored by Sergei Golubchik's avatar Sergei Golubchik

sql_update.cc: always update default fields *after* compare_record()

(it was *after* in two cases and *before* in one case)
parent b52d4d00
...@@ -2047,8 +2047,7 @@ int multi_update::send_data(List<Item> &not_used_values) ...@@ -2047,8 +2047,7 @@ int multi_update::send_data(List<Item> &not_used_values)
store_record(table,record[1]); store_record(table,record[1]);
if (fill_record_n_invoke_before_triggers(thd, table, *fields_for_table[offset], if (fill_record_n_invoke_before_triggers(thd, table, *fields_for_table[offset],
*values_for_table[offset], 0, *values_for_table[offset], 0,
TRG_EVENT_UPDATE) || TRG_EVENT_UPDATE))
(table->default_field && table->update_default_fields()))
DBUG_RETURN(1); DBUG_RETURN(1);
/* /*
...@@ -2060,6 +2059,10 @@ int multi_update::send_data(List<Item> &not_used_values) ...@@ -2060,6 +2059,10 @@ int multi_update::send_data(List<Item> &not_used_values)
if (!can_compare_record || compare_record(table)) if (!can_compare_record || compare_record(table))
{ {
int error; int error;
if (table->default_field && table->update_default_fields())
DBUG_RETURN(1);
if ((error= cur_table->view_check_option(thd, ignore)) != if ((error= cur_table->view_check_option(thd, ignore)) !=
VIEW_CHECK_OK) VIEW_CHECK_OK)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment