summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-11-11 10:39:35 +0100
committerSergei Golubchik <sergii@pisem.net>2014-11-11 10:39:35 +0100
commit815667086cfa4ee28eb1bdc88d5ae86755c71b72 (patch)
treeced42a601015dc5d5f0700c1fe1525414e0e2f73 /sql/sql_update.cc
parentb52d4d0076a7fbd2f4cb4d226947b708077ed8a6 (diff)
downloadmariadb-git-815667086cfa4ee28eb1bdc88d5ae86755c71b72.tar.gz
sql_update.cc: always update default fields *after* compare_record()
(it was *after* in two cases and *before* in one case)
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index f83e11912d1..788448563ac 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -2047,8 +2047,7 @@ int multi_update::send_data(List<Item> &not_used_values)
store_record(table,record[1]);
if (fill_record_n_invoke_before_triggers(thd, table, *fields_for_table[offset],
*values_for_table[offset], 0,
- TRG_EVENT_UPDATE) ||
- (table->default_field && table->update_default_fields()))
+ TRG_EVENT_UPDATE))
DBUG_RETURN(1);
/*
@@ -2060,6 +2059,10 @@ int multi_update::send_data(List<Item> &not_used_values)
if (!can_compare_record || compare_record(table))
{
int error;
+
+ if (table->default_field && table->update_default_fields())
+ DBUG_RETURN(1);
+
if ((error= cur_table->view_check_option(thd, ignore)) !=
VIEW_CHECK_OK)
{