summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2013-03-26 21:47:06 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2013-03-26 21:47:06 +0400
commit045c498691f77ac8e0d8c8b9b705325b3425c69d (patch)
treed1e64ca715c07e5cf1d93afb7de6e37858f7a03f /sql/item_geofunc.cc
parent51a707486433d3707ac38deb72c6ad7d3d7bb882 (diff)
downloadmariadb-git-045c498691f77ac8e0d8c8b9b705325b3425c69d.tar.gz
GEOMETRYCOLLECTION EMPTY handling fixed.
The get_mbr() method shouldn't return the error, rather an invalid MBR in this case.
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r--sql/item_geofunc.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 7d0f06d6237..1168813e275 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -559,8 +559,8 @@ longlong Item_func_spatial_mbr_rel::val_int()
args[1]->null_value ||
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
- g1->get_mbr(&mbr1, &dummy) ||
- g2->get_mbr(&mbr2, &dummy))))
+ g1->get_mbr(&mbr1, &dummy) || !mbr1.valid() ||
+ g2->get_mbr(&mbr2, &dummy) || !mbr2.valid())))
return 0;
switch (spatial_rel) {
@@ -686,8 +686,8 @@ longlong Item_func_spatial_rel::val_int()
(args[0]->null_value || args[1]->null_value ||
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
- g1->get_mbr(&mbr1, &c_end) ||
- g2->get_mbr(&mbr2, &c_end))))
+ g1->get_mbr(&mbr1, &c_end) || !mbr1.valid() ||
+ g2->get_mbr(&mbr2, &c_end) || !mbr2.valid())))
goto exit;
umbr= mbr1;
@@ -824,8 +824,8 @@ String *Item_func_spatial_operation::val_str(String *str_value)
(args[0]->null_value || args[1]->null_value ||
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
- g1->get_mbr(&mbr1, &c_end) ||
- g2->get_mbr(&mbr2, &c_end))))
+ g1->get_mbr(&mbr1, &c_end) || !mbr1.valid() ||
+ g2->get_mbr(&mbr2, &c_end) || !mbr2.valid())))
{
str_value= 0;
goto exit;