From fc9d34cabf06038f930db356d53ed76dab5fdf0d Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 8 Dec 2011 16:29:45 +0400 Subject: bug #901655 ST_BUFFER asserts with a coplicated shape. Coinciding nodes can appear as a result of DOUBLE inaccuracy. We should test that before we start the loop. Also the spatial relations can be calculated faster if we check MBR relations first. And we do have the shape's MBR-s now. per-file comments: sql/gcalc_slicescan.cc set_extent() method added. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_slicescan.h set_extent() method declared. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_tools.cc bug #901655 ST_BUFFER asserts with a coplicated shape. checks for equal nodes added. sql/item_geofunc.cc bug #901655 ST_BUFFER asserts with a coplicated shape. MBR for the shapes calculated, and MBR checks added before we start the heavy calculations. sql/spatial.h bug #901655 ST_BUFFER asserts with a coplicated shape. MBR::buffer() method implemented. --- sql/gcalc_slicescan.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql/gcalc_slicescan.h') diff --git a/sql/gcalc_slicescan.h b/sql/gcalc_slicescan.h index 9fc4cea5199..55de497f1ee 100644 --- a/sql/gcalc_slicescan.h +++ b/sql/gcalc_slicescan.h @@ -229,7 +229,9 @@ public: Gcalc_dyn_list(blk_size, sizeof(Info)), m_hook(&m_first), m_n_points(0) {} + void set_extent(double xmin, double xmax, double ymin, double ymax); Info *new_point_info(double x, double y, gcalc_shape_info shape); + void free_point_info(Info *i, Gcalc_dyn_list::Item **i_hook); Info *new_intersection(const Info *p1, const Info *p2, const Info *p3, const Info *p4); void prepare_operation(); @@ -242,6 +244,8 @@ public: long double get_double(const Gcalc_internal_coord *c) const; #endif /*GCALC_CHECK_WITH_FLOAT*/ double coord_extent; + Gcalc_dyn_list::Item **get_cur_hook() { return m_hook; } + private: Gcalc_dyn_list::Item *m_first; Gcalc_dyn_list::Item **m_hook; @@ -269,6 +273,7 @@ class Gcalc_shape_transporter private: Gcalc_heap::Info *m_first; Gcalc_heap::Info *m_prev; + Gcalc_dyn_list::Item **m_prev_hook; int m_shape_started; void int_complete(); protected: -- cgit v1.2.1