summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-22 18:18:51 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-22 18:18:51 +0300
commit88cf6f1c7ff5d56138c8b53a5adaca4c61752f86 (patch)
treeeee8eed7e9388a575de4d9c948b0706e2356d694 /sql/item.cc
parent498c5e2be1021569c1d5554bcb91f45090e30d4b (diff)
parent455cf6196c8c73f5a50004ac7f31a9be8ac14bbe (diff)
downloadmariadb-git-88cf6f1c7ff5d56138c8b53a5adaca4c61752f86.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 0d5c39086a6..69524cf8116 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -9245,8 +9245,10 @@ bool Item_default_value::fix_fields(THD *thd, Item **items)
}
if (!(def_field= (Field*) thd->alloc(field_arg->field->size_of())))
goto error;
+ cached_field= def_field;
memcpy((void *)def_field, (void *)field_arg->field,
field_arg->field->size_of());
+ def_field->reset_fields();
// If non-constant default value expression
if (def_field->default_value && def_field->default_value->flags)
{
@@ -9274,6 +9276,12 @@ error:
return TRUE;
}
+void Item_default_value::cleanup()
+{
+ delete cached_field; // Free cached blob data
+ cached_field= 0;
+ Item_field::cleanup();
+}
void Item_default_value::print(String *str, enum_query_type query_type)
{