summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-11-18 17:36:51 +0100
committerSergei Golubchik <sergii@pisem.net>2014-11-18 17:36:51 +0100
commit84fc27fbef5e12cec28efd5bb0b13c207fe3b681 (patch)
treed0351ae0af9f2fbca7fb36a5c20108314050c3a7 /sql/spatial.cc
parentf3a800ef6edf8f2c1fa367aefbe7b6567c68a919 (diff)
parentc9742ceac5bd682e24a435c36524305eecca7950 (diff)
downloadmariadb-git-84fc27fbef5e12cec28efd5bb0b13c207fe3b681.tar.gz
5.3 merge
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 34d2417f632..c5dc0c2140c 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1237,11 +1237,15 @@ int Gis_polygon::store_shapes(Gcalc_shape_transporter *trn) const
trn->start_ring();
get_point(&first_x, &first_y, data);
data+= POINT_DATA_SIZE;
- n_points--;
+
prev_x= first_x;
prev_y= first_y;
if (trn->add_point(first_x, first_y))
return 1;
+
+ if (--n_points == 0)
+ goto single_point_ring;
+
while (--n_points)
{
double x, y;
@@ -1266,6 +1270,8 @@ int Gis_polygon::store_shapes(Gcalc_shape_transporter *trn) const
return 1;
}
data+= POINT_DATA_SIZE;
+
+single_point_ring:
trn->complete_ring();
}