summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-04 17:52:04 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-04 17:52:04 +0300
commit537f8594a60a1e09d6da0933b55764e0f8abbf5c (patch)
tree628c68bccb01538df826045ba6f3aaa45c29b93a /sql/sql_base.cc
parent647d5b243020b799fd7112a801965f5780b86349 (diff)
parentf605ce08b5c0e6ed6907d0639bcc5b5630e9b40a (diff)
downloadmariadb-git-537f8594a60a1e09d6da0933b55764e0f8abbf5c.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3483c9381e8..458c921e01b 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -8343,7 +8343,7 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
rfield->move_field_offset((my_ptrdiff_t) (table->record[1] -
table->record[0]));
}
- rfield->set_explicit_default(value);
+ rfield->set_has_explicit_value();
}
if (update && thd->variables.sql_mode & MODE_SIMULTANEOUS_ASSIGNMENT)
@@ -8362,9 +8362,13 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
}
}
- if (!update && table_arg->default_field &&
- table_arg->update_default_fields(0, ignore_errors))
- goto err;
+ if (update)
+ table_arg->evaluate_update_default_function();
+ else
+ if (table_arg->default_field &&
+ table_arg->update_default_fields(ignore_errors))
+ goto err;
+
/* Update virtual fields */
if (table_arg->vfield &&
table_arg->update_virtual_fields(table_arg->file, VCOL_UPDATE_FOR_WRITE))
@@ -8554,7 +8558,6 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
{
List_iterator_fast<Item> v(values);
List<TABLE> tbl_list;
- bool all_fields_have_values= true;
Item *value;
Field *field;
bool abort_on_warning_saved= thd->abort_on_warning;
@@ -8585,10 +8588,7 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
DBUG_ASSERT(field->table == table);
if (unlikely(field->invisible))
- {
- all_fields_have_values= false;
continue;
- }
else
value=v++;
@@ -8617,11 +8617,8 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
else
if (value->save_in_field(field, 0) < 0)
goto err;
- all_fields_have_values &= field->set_explicit_default(value);
+ field->set_has_explicit_value();
}
- if (!all_fields_have_values && table->default_field &&
- table->update_default_fields(0, ignore_errors))
- goto err;
/* Update virtual fields */
thd->abort_on_warning= FALSE;
if (table->vfield &&