summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-18 15:05:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-18 15:05:52 +0300
commitfaf6d0ef3f9323c6d24f8cdb6533ed23d1a6bb40 (patch)
tree086848c0085880912bec60369effef8ec449c91c /sql/sql_base.cc
parent386f168ab340791631e4d8979c4370ecef7e6b05 (diff)
parent5e12aca57f19f3e4f623e92637492edf8a69f42f (diff)
downloadmariadb-git-faf6d0ef3f9323c6d24f8cdb6533ed23d1a6bb40.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc26
1 files changed, 10 insertions, 16 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 529dd815b51..d00cd4a6e15 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -8463,11 +8463,9 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
if (table->next_number_field &&
rfield->field_index == table->next_number_field->field_index)
table->auto_increment_field_not_null= TRUE;
- Item::Type type= value->type();
const bool skip_sys_field= rfield->vers_sys_field(); // TODO: && !thd->vers_modify_history() [MDEV-16546]
if ((rfield->vcol_info || skip_sys_field) &&
- type != Item::DEFAULT_VALUE_ITEM &&
- type != Item::NULL_ITEM &&
+ !value->vcol_assignment_allowed_value() &&
table->s->table_category != TABLE_CATEGORY_TEMPORARY)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
@@ -8748,20 +8746,16 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
if (field->field_index == autoinc_index)
table->auto_increment_field_not_null= TRUE;
- if (unlikely(field->vcol_info) || (vers_sys_field && !ignore_errors))
+ if ((unlikely(field->vcol_info) || (vers_sys_field && !ignore_errors)) &&
+ !value->vcol_assignment_allowed_value() &&
+ table->s->table_category != TABLE_CATEGORY_TEMPORARY)
{
- Item::Type type= value->type();
- if (type != Item::DEFAULT_VALUE_ITEM &&
- type != Item::NULL_ITEM &&
- table->s->table_category != TABLE_CATEGORY_TEMPORARY)
- {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN,
- ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN),
- field->field_name.str, table->s->table_name.str);
- if (vers_sys_field)
- continue;
- }
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN,
+ ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN),
+ field->field_name.str, table->s->table_name.str);
+ if (vers_sys_field)
+ continue;
}
if (use_value)