summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-22 14:45:55 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-22 14:45:55 +0300
commit455cf6196c8c73f5a50004ac7f31a9be8ac14bbe (patch)
tree2d9d696bba2590c63278fee0047a046f58b51a31 /sql/item.cc
parent42af2b1d8b8a8508c5aac5c2e0bcf4554c5200ce (diff)
parente52a36d37be2fa8a2da8a987cb38cb0bb65233f4 (diff)
downloadmariadb-git-455cf6196c8c73f5a50004ac7f31a9be8ac14bbe.tar.gz
Merge 10.2 into 10.3
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 30e83d26a0c..bf0a8e0e754 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -9349,8 +9349,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)
{
@@ -9378,6 +9380,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)
{