From 1e70b287e702b7ff9191454d1316d9137b9be0c1 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Mon, 11 Oct 2021 13:36:07 +0300 Subject: MDEV-25891 Computed default for INVISIBLE column is ignored in INSERT There are two fill_record() functions (lines 8343 and 8618). First one is used when there are some explicit values, the second one is used for all implicit values. First one does update_default_fields(), the second one did not. Added update_default_fields() call to the implicit version of fill_record(). --- sql/sql_base.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index b65737bfb02..a1f3f6116b9 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8699,8 +8699,11 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List &values, goto err; field->set_has_explicit_value(); } - /* Update virtual fields */ thd->abort_on_warning= FALSE; + if (table->default_field && + table->update_default_fields(ignore_errors)) + goto err; + /* Update virtual fields */ if (table->vfield && table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_WRITE)) goto err; -- cgit v1.2.1