summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2020-05-29 11:45:19 +0300
committerAleksey Midenkov <midenok@gmail.com>2020-05-29 11:45:19 +0300
commit57f7b4866f1347ebf3ee67fe61de3871e56e23cc (patch)
tree458e73627087c589987e3b13f57f9ee288c02e24 /sql/unireg.cc
parent278facee7c7a028d642f3b5f23a42bcf099d86f3 (diff)
downloadmariadb-git-57f7b4866f1347ebf3ee67fe61de3871e56e23cc.tar.gz
MDEV-16937 Strict SQL with system versioned tables causes issues (10.4)
Respect system fields in NO_ZERO_DATE mode. This is the subject for refactoring in MDEV-19597 Conflict resolution from 7d5223310789f967106d86ce193ef31b315ecff0
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index f646d62d221..2b162e9a374 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -991,9 +991,10 @@ static bool pack_fields(uchar **buff_arg, List<Create_field> &create_fields,
static bool make_empty_rec_store_default(THD *thd, Field *regfield,
- Virtual_column_info *default_value)
+ Create_field *field)
{
- if (default_value && !default_value->flags)
+ Virtual_column_info *default_value= field->default_value;
+ if (!field->vers_sys_field() && default_value && !default_value->flags)
{
Item *expr= default_value->expr;
// may be already fixed if ALTER TABLE
@@ -1075,7 +1076,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
!f_bit_as_char(field->pack_flag))
null_count+= field->length & 7;
- error= make_empty_rec_store_default(thd, regfield, field->default_value);
+ error= make_empty_rec_store_default(thd, regfield, field);
delete regfield; // Avoid memory leaks
if (error)
goto err;