diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-26 21:47:06 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-26 21:47:06 +0400 |
commit | 045c498691f77ac8e0d8c8b9b705325b3425c69d (patch) | |
tree | d1e64ca715c07e5cf1d93afb7de6e37858f7a03f /sql/item_geofunc.cc | |
parent | 51a707486433d3707ac38deb72c6ad7d3d7bb882 (diff) | |
download | mariadb-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.cc | 12 |
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; |