summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2014-02-18 17:15:25 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2014-02-18 17:15:25 +0400
commit820b1a66870639951cdf7f1cbfef14c3ba889615 (patch)
tree6805bf0739b460beab3dd0da1d06565b92138e40 /sql/spatial.cc
parentccb54beb6dca11bc4cc438c00366acf35b35f815 (diff)
downloadmariadb-git-820b1a66870639951cdf7f1cbfef14c3ba889615.tar.gz
MDEV-5615 crash in Gcalc_function::add_operation.
The result is EMPTY for a buffer(line, -1), but we still need one FALSE operation to be stored in the condition. And we actually add it but forgot to alloc memory to store it.
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 8f74d4fa4a7..551c79d4d90 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -298,7 +298,8 @@ int Geometry::create_from_opresult(Geometry_buffer *g_buf,
res->q_append((char) wkb_ndr);
res->q_append(geom_type);
- return obj->init_from_opresult(res, rr.result(), rr.length());
+ return obj->init_from_opresult(res, rr.result(), rr.length()) == 0 &&
+ rr.length();
}