summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-30 20:47:39 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-30 20:47:39 +0400
commit835cbbcc7b797188a89671019f2b2844e1a14e0c (patch)
tree010dd112f16b88bb655c32abb6b93987fe5c6c99 /sql/unireg.cc
parentfe8cf8fdf1c4c0a9ec60690a8d2738fd255c8dd5 (diff)
parent003cb2f42477772ae43228c0bc0f8492246b9340 (diff)
downloadmariadb-git-835cbbcc7b797188a89671019f2b2844e1a14e0c.tar.gz
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
TODO: enable MDEV-13049 optimization for 10.3
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 49724a3f47e..1ca0233552e 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -981,13 +981,18 @@ 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->flags & BLOB_FLAG))
+ (!(field->flags & BLOB_FLAG) ||
+ field->real_field_type() == MYSQL_TYPE_GEOMETRY))
{
Item *expr= field->default_value->expr;
+
int res= !expr->fixed && // may be already fixed if ALTER TABLE
expr->fix_fields(thd, &expr);
if (!res)
res= expr->save_in_field(regfield, 1);
+ if (!res && (field->flags & BLOB_FLAG))
+ regfield->reset();
+
/* If not ok or warning of level 'note' */
if (res != 0 && res != 3)
{
@@ -996,6 +1001,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
delete regfield; //To avoid memory leak
goto err;
}
+ delete regfield; //To avoid memory leak
}
else if (regfield->real_type() == MYSQL_TYPE_ENUM &&
(field->flags & NOT_NULL_FLAG))