From 17ab02f4b0537de321a281f47dec825a6368d483 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 2 Sep 2019 10:53:46 +0200 Subject: cleanup: on update default now * remove one level of virtual functions * remove redundant checks * remove an if() as the value is always known at compilation time don't pretend that "DEFAULT expr" and "ON UPDATE DEFAULT NOW" are "basically the same thing" --- sql/sql_update.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'sql/sql_update.cc') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1d1c38f59d6..4f129eb995a 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -761,11 +761,8 @@ int mysql_update(THD *thd, if (!can_compare_record || compare_record(table)) { - if (table->default_field && table->update_default_fields(1, ignore)) - { - error= 1; - break; - } + if (table->default_field) + table->evaluate_update_default_function(); if ((res= table_list->view_check_option(thd, ignore)) != VIEW_CHECK_OK) { @@ -2156,8 +2153,8 @@ int multi_update::send_data(List ¬_used_values) { int error; - if (table->default_field && table->update_default_fields(1, ignore)) - DBUG_RETURN(1); + if (table->default_field) + table->evaluate_update_default_function(); if ((error= cur_table->view_check_option(thd, ignore)) != VIEW_CHECK_OK) @@ -2482,9 +2479,8 @@ int multi_update::do_updates() if (!can_compare_record || compare_record(table)) { int error; - if (table->default_field && - (error= table->update_default_fields(1, ignore))) - goto err2; + if (table->default_field) + table->evaluate_update_default_function(); if (table->vfield && table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_WRITE)) goto err2; -- cgit v1.2.1