summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
authorhf@deer.(none) <>2004-10-22 20:32:02 +0500
committerhf@deer.(none) <>2004-10-22 20:32:02 +0500
commit497fe7f71ed60f3af92f0f915a5cbd42d24de8ac (patch)
tree1bd495ce807d46d5040d6f93c81d63b24e0e3f57 /sql/spatial.cc
parentbaeecbd6e48de49b8d2a8e43a9b3bd299fed031f (diff)
downloadmariadb-git-497fe7f71ed60f3af92f0f915a5cbd42d24de8ac.tar.gz
Fix for bug #6117 (Centroid() crashes server)
I learned that one shouldn't use String::set in val_str() methods...
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 0668dd2faab..bcfefd9dde8 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -828,9 +828,7 @@ int Gis_polygon::centroid_xy(double *x, double *y) const
if (!first_loop)
{
- double d_area= res_area - cur_area;
- if (d_area <= 0)
- return 1;
+ double d_area= fabs(res_area - cur_area);
res_cx= (res_area * res_cx - cur_area * cur_cx) / d_area;
res_cy= (res_area * res_cy - cur_area * cur_cy) / d_area;
}