diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-11-18 17:36:51 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-11-18 17:36:51 +0100 |
commit | 84fc27fbef5e12cec28efd5bb0b13c207fe3b681 (patch) | |
tree | d0351ae0af9f2fbca7fb36a5c20108314050c3a7 /sql/spatial.cc | |
parent | f3a800ef6edf8f2c1fa367aefbe7b6567c68a919 (diff) | |
parent | c9742ceac5bd682e24a435c36524305eecca7950 (diff) | |
download | mariadb-git-84fc27fbef5e12cec28efd5bb0b13c207fe3b681.tar.gz |
5.3 merge
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r-- | sql/spatial.cc | 8 |
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(); } |