summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index ab415d9af10..0668dd2faab 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -15,6 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
+
+#ifdef HAVE_SPATIAL
+
#define MAX_DIGITS_IN_DOUBLE 16
/***************************** Gis_class_info *******************************/
@@ -395,7 +398,7 @@ bool Gis_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
if (trs->skip_char(',')) // Didn't find ','
break;
}
- if (n_points < 2)
+ if (n_points < 1)
{
trs->set_error_msg("Too few points in LINESTRING");
return 1;
@@ -484,6 +487,11 @@ int Gis_line_string::is_closed(int *closed) const
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
+ if (n_points == 1)
+ {
+ *closed=1;
+ return 0;
+ }
data+= 4;
if (no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
return 1;
@@ -1652,3 +1660,4 @@ const Geometry::Class_info *Gis_geometry_collection::get_class_info() const
return &geometrycollection_class;
}
+#endif /*HAVE_SPATIAL*/