From 19da9a51ae174785806c87bcc8fa47406af9ed96 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Thu, 28 May 2020 22:22:20 +0300 Subject: MDEV-16937 Strict SQL with system versioned tables causes issues Respect system fields in NO_ZERO_DATE mode. This is the subject for refactoring in MDEV-19597 --- sql/unireg.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/unireg.cc') diff --git a/sql/unireg.cc b/sql/unireg.cc index fa30bab15a2..b7eb1cd3457 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -1086,6 +1086,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, null_count+= field->length & 7; if (field->default_value && !field->default_value->flags && + !field->vers_sys_field() && (!(field->flags & BLOB_FLAG) || field->real_field_type() == MYSQL_TYPE_GEOMETRY)) { @@ -1108,6 +1109,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, delete regfield; //To avoid memory leak } else if (regfield->real_type() == MYSQL_TYPE_ENUM && + !field->vers_sys_field() && (field->flags & NOT_NULL_FLAG)) { regfield->set_notnull(); -- cgit v1.2.1