[Commits] Rev 4472: sql_update.cc: always update default fields *after* compare_record() in lp:~maria-captains/maria/10.0

Sergei Golubchik serg at mariadb.org
Tue Nov 11 11:39:35 EET 2014


At lp:~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4472
revision-id: sergii at pisem.net-20141111093935-9ix76vd0cs6nb77k
parent: sergii at pisem.net-20141103164737-457hfby1eg82zol9
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 10.0
timestamp: Tue 2014-11-11 10:39:35 +0100
message:
  sql_update.cc: always update default fields *after* compare_record()
  
  (it was *after* in two cases and *before* in one case)
=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2014-09-30 17:31:14 +0000
+++ b/sql/sql_update.cc	2014-11-11 09:39:35 +0000
@@ -2047,8 +2047,7 @@ int multi_update::send_data(List<Item> &
       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> &
       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)
         {



More information about the commits mailing list