summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2012-08-31 19:50:45 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2012-08-31 19:50:45 +0500
commit589c62fefec759a467b6dec1badb2cd283564845 (patch)
treeda5dfea16b6d6aa9c348daa31237bc923a4591e0 /sql/item_geofunc.cc
parent51e14492e9410718056b0c6d9d4dabd4a96e8070 (diff)
downloadmariadb-git-589c62fefec759a467b6dec1badb2cd283564845.tar.gz
Bug #1043845 st_distance() results are incorrect depending on variable order.
Autointersections of an object were treated as nodes, so the wrong result. per-file comments: mysql-test/r/gis.result Bug #1043845 st_distance() results are incorrect depending on variable order. test result updated. mysql-test/t/gis.test Bug #1043845 st_distance() results are incorrect depending on variable order. test case added. sql/item.cc small fix to make compilers happy. sql/item_geofunc.cc Bug #1043845 st_distance() results are incorrect depending on variable order. Skip intersection points when calculate distance.
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r--sql/item_geofunc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 172e0cbcd1f..522be28558f 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -1693,7 +1693,8 @@ count_distance:
for (dist_point= collector.get_first(); dist_point; dist_point= dist_point->get_next())
{
/* We only check vertices of object 2 */
- if (dist_point->shape < obj2_si)
+ if (dist_point->type != Gcalc_heap::nt_shape_node ||
+ dist_point->shape < obj2_si)
continue;
/* if we have an edge to check */