diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2011-07-04 16:03:36 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2011-07-04 16:03:36 +0500 |
commit | 0e6c889c83bcf6c37526e3a3fee192bb59cab92e (patch) | |
tree | df83f696c25331e8fe04874a9a22ebe3483a96fd /sql/item_geofunc.h | |
parent | a9a6597d598c735ba6b8a136864b888d8d626b70 (diff) | |
download | mariadb-git-0e6c889c83bcf6c37526e3a3fee192bb59cab92e.tar.gz |
bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
Collections were treated mistakenly, so the counter for the final UNION operation
received the wrong value.
As a fix we implement Item_func_buffer::Transporter::start_collection() method,
where we set the proper operation and the operand counter.
start_poly() and start_line() were also modified to function correctly for the
polygon as a part of a collection.
per-file comments:
mysql-test/r/gis-precise.result
bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
test result updated.
mysql-test/t/gis-precise.test
bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
test case added.
sql/item_geofunc.cc
bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
start_collection() implemented.
sql/item_geofunc.h
bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
Item_func_buffer::Transporter::start_collection() defined.
Diffstat (limited to 'sql/item_geofunc.h')
-rw-r--r-- | sql/item_geofunc.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 1838a3783e8..d5ed2c1f764 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -26,6 +26,7 @@ #endif #include "gcalc_slicescan.h" +#include "gcalc_tools.h" class Item_geometry_func: public Item_str_func { @@ -298,18 +299,28 @@ protected: int add_last_edge_buffer(); int add_point_buffer(double x, double y); int complete(); - public: int m_nshapes; + Gcalc_function::op_type buffer_op; + int last_shape_pos; + bool skip_line; + + public: Transporter(Gcalc_function *fn, Gcalc_heap *heap, double d) : - Gcalc_operation_transporter(fn, heap), m_npoints(0), m_d(d), m_nshapes(0) + Gcalc_operation_transporter(fn, heap), m_npoints(0), m_d(d), + m_nshapes(0), buffer_op((d > 0.0) ? Gcalc_function::op_union : + Gcalc_function::op_difference), + skip_line(FALSE) {} int single_point(double x, double y); int start_line(); int complete_line(); int start_poly(); + int complete_poly(); int start_ring(); int complete_ring(); int add_point(double x, double y); + + int start_collection(int n_objects); }; Gcalc_heap collector; Gcalc_function func; |