diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-09-02 10:53:46 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-09-03 20:34:30 +0200 |
commit | 17ab02f4b0537de321a281f47dec825a6368d483 (patch) | |
tree | 1ce787d6d66c224336266e55510945666661c814 /sql/sql_update.cc | |
parent | ef00ac4c86daf3294c46a45358da636763fb0049 (diff) | |
download | mariadb-git-17ab02f4b0537de321a281f47dec825a6368d483.tar.gz |
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"
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 16 |
1 files changed, 6 insertions, 10 deletions
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<Item> ¬_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; |