summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-10-11 11:57:26 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-10-11 11:57:26 +0400
commitfe0d2e1a2b8069b0d8f0560aacb2cc9543b3951b (patch)
tree65f56f1063823ec278768ed0c77c9993367c45e6 /sql/unireg.cc
parentdd85ec6f28b9b5f94188e4a1b907e3a17d6b647c (diff)
downloadmariadb-git-fe0d2e1a2b8069b0d8f0560aacb2cc9543b3951b.tar.gz
MDEV-13923 Assertion `!is_set() || (m_status == DA_OK_BULK &&
is_bulk_op())' failed upon altering table with geometry field. Check for the validity of the DEFAULT value for the geometry field.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 06151d9318b..899b612bd89 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -979,13 +979,17 @@ 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->sql_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)
{
@@ -994,6 +998,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))