summaryrefslogtreecommitdiff
path: root/sql/gcalc_tools.h
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2011-07-05 19:42:35 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2011-07-05 19:42:35 +0500
commitf3b850a7b52b5947eb694b5a1f73d0425de5bb0e (patch)
tree8a211b1bb2d3b9502b2bb05309285832c6a9d8a8 /sql/gcalc_tools.h
parent7f55ea121191131723c99889943f8a278c5a7b4b (diff)
downloadmariadb-git-f3b850a7b52b5947eb694b5a1f73d0425de5bb0e.tar.gz
bug #804305 Crash in wkb_get_double with ST_INTERSECTION.
That crash happened with the complicated topology of the result. If we found a hole in a polygon whose outside border was already found, we need to paste the hole right after it and respectively shift polygons after it. Also we need to update poly_position fields in these polygons. That last thing wasn't properly done that led to the crash. To fix that we keep the list of the found polygons and update the poly_positions that are bigger or equal to where we placed the next hole. per-file comments: mysql-test/r/gis-precise.result bug #804305 Crash in wkb_get_double with ST_INTERSECTION. test result updated. mysql-test/t/gis-precise.test bug #804305 Crash in wkb_get_double with ST_INTERSECTION. test result added. sql/gcalc_tools.cc bug #804305 Crash in wkb_get_double with ST_INTERSECTION. keep the list of the found polygons and update their poly_position fields respectively. sql/gcalc_tools.h bug #804305 Crash in wkb_get_double with ST_INTERSECTION. Gcalc_result_receiver::move_hole interface changed.
Diffstat (limited to 'sql/gcalc_tools.h')
-rw-r--r--sql/gcalc_tools.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h
index 7df236618fb..32835d68666 100644
--- a/sql/gcalc_tools.h
+++ b/sql/gcalc_tools.h
@@ -170,7 +170,7 @@ public:
int get_result_typeid();
uint32 position() { return buffer.length(); }
int move_hole(uint32 dest_position, uint32 source_position,
- uint32 *new_dest_position);
+ uint32 *position_shift);
};
@@ -233,6 +233,13 @@ public:
active_thread *get_next() { return (active_thread *)next; }
};
+ class poly_instance : public Gcalc_dyn_list::Item
+ {
+ public:
+ uint32 *after_poly_position;
+ poly_instance *get_next() { return (poly_instance *)next; }
+ };
+
protected:
Gcalc_function *m_fn;
Gcalc_dyn_list::Item **m_res_hook;
@@ -253,6 +260,8 @@ protected:
active_thread *new_active_thread() { return (active_thread *)new_item(); }
+ poly_instance *new_poly() { return (poly_instance *) new_item(); }
+
private:
int continue_range(active_thread *t, const Gcalc_heap::Info *p);
int continue_i_range(active_thread *t, const Gcalc_heap::Info *p,