summaryrefslogtreecommitdiff
path: root/sql/gcalc_tools.h
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2011-09-21 00:04:41 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2011-09-21 00:04:41 +0500
commit0249413a6ae4a5900b51f434b361b9efa6133ad1 (patch)
treece34c73e2d9ad3d7b9d08612c35b65141b55821a /sql/gcalc_tools.h
parent5a04ac7bf0ee359fb36f4ebc00f0aebc142d36b7 (diff)
downloadmariadb-git-0249413a6ae4a5900b51f434b361b9efa6133ad1.tar.gz
several bugs fixed here.
849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 849791 Fourth assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos 849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis per-file comments: mysql-test/r/gis-precise.result test result updated. mysql-test/r/gis.result test result updated. sql/gcalc_slicescan.cc bugfixes. sql/gcalc_slicescan.h bugfixes. sql/gcalc_tools.cc bugfixes. sql/gcalc_tools.h bugfixes. sql/item_geofunc.cc bugfixes. sql/spatial.cc bugfixes.
Diffstat (limited to 'sql/gcalc_tools.h')
-rw-r--r--sql/gcalc_tools.h83
1 files changed, 28 insertions, 55 deletions
diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h
index da7be1d9fa7..39704dfeb56 100644
--- a/sql/gcalc_tools.h
+++ b/sql/gcalc_tools.h
@@ -206,26 +206,37 @@ public:
int get_result(Gcalc_result_receiver *storage);
void reset();
+#ifndef DBUG_OFF
+ int n_res_points;
+#endif /*DBUG_OFF*/
class res_point : public Gcalc_dyn_list::Item
{
public:
- bool intersection_point;
- double x,y;
- res_point *up;
- res_point *down;
- res_point *glue;
- Gcalc_function::shape_type type;
+ int intersection_point;
union
{
const Gcalc_heap::Info *pi;
+ const Gcalc_heap::Intersection_info *ii;
res_point *first_poly_node;
};
+#ifdef TMP_BLOCK
union
{
+#endif /*TMP_BLOCK*/
res_point *outer_poly;
uint32 poly_position;
+#ifdef TMP_BLOCK
};
+#endif /*TMP_BLOCK*/
+ res_point *up;
+ res_point *down;
+ res_point *glue;
+ Gcalc_function::shape_type type;
Gcalc_dyn_list::Item **prev_hook;
+#ifndef DBUG_OFF
+ int point_n;
+#endif /*DBUG_OFF*/
+ void set(const Gcalc_scan_iterator *si);
res_point *get_next() { return (res_point *)next; }
};
@@ -233,9 +244,9 @@ public:
{
public:
res_point *rp;
- int horiz_dir;
- double dx_dy;
res_point *thread_start;
+
+ const Gcalc_heap::Info *p1, *p2;
res_point *enabled() { return rp; }
active_thread *get_next() { return (active_thread *)next; }
};
@@ -273,33 +284,9 @@ public:
line *new_line() { return (line *) new_item(); }
poly_border *new_poly_border() { return (poly_border *) new_item(); }
int add_line(int incoming, active_thread *t,
- const Gcalc_scan_iterator::point *p)
- {
- line *l= new_line();
- if (!l)
- return 1;
- l->incoming= incoming;
- l->t= t;
- l->p= p;
- *m_lines_hook= l;
- m_lines_hook= &l->next;
- return 0;
- }
-
+ const Gcalc_scan_iterator::point *p);
int add_poly_border(int incoming, active_thread *t, int prev_state,
- const Gcalc_scan_iterator::point *p)
- {
- poly_border *b= new_poly_border();
- if (!b)
- return 1;
- b->incoming= incoming;
- b->t= t;
- b->prev_state= prev_state;
- b->p= p;
- *m_poly_borders_hook= b;
- m_poly_borders_hook= &b->next;
- return 0;
- }
+ const Gcalc_scan_iterator::point *p);
protected:
Gcalc_function *m_fn;
@@ -310,43 +297,29 @@ protected:
res_point *result_heap;
active_thread *m_first_active_thread;
- res_point *add_res_point(Gcalc_function::shape_type type)
- {
- res_point *result= (res_point *)new_item();
- *m_res_hook= result;
- result->prev_hook= m_res_hook;
- m_res_hook= &result->next;
- result->type= type;
- return result;
- }
-
+ res_point *add_res_point(Gcalc_function::shape_type type);
active_thread *new_active_thread() { return (active_thread *)new_item(); }
poly_instance *new_poly() { return (poly_instance *) new_item(); }
private:
int start_line(active_thread *t, const Gcalc_scan_iterator::point *p,
- const Gcalc_heap::Info *ev_p, const Gcalc_scan_iterator *si);
- int end_line(active_thread *t, const Gcalc_heap::Info *ev_p,
- const Gcalc_scan_iterator *si);
+ const Gcalc_scan_iterator *si);
+ int end_line(active_thread *t, const Gcalc_scan_iterator *si);
int connect_threads(int incoming_a, int incoming_b,
active_thread *ta, active_thread *tb,
const Gcalc_scan_iterator::point *pa,
const Gcalc_scan_iterator::point *pb,
active_thread *prev_range,
- const Gcalc_heap::Info *ev_p,
const Gcalc_scan_iterator *si,
Gcalc_function::shape_type s_t);
- int add_single_point(const Gcalc_heap::Info *p,
- const Gcalc_scan_iterator *si);
+ int add_single_point(const Gcalc_scan_iterator *si);
poly_border *get_pair_border(poly_border *b1);
int continue_range(active_thread *t, const Gcalc_heap::Info *p,
- int horiz_dir, double dx_dy);
- int continue_i_range(active_thread *t, double x, double y,
- int horiz_dir, double dx_dy);
+ const Gcalc_heap::Info *p_next);
+ int continue_i_range(active_thread *t,
+ const Gcalc_heap::Intersection_info *ii);
int end_couple(active_thread *t0, active_thread *t1, const Gcalc_heap::Info *p);
- int add_single_point(const Gcalc_heap::Info *p);
-
int get_single_result(res_point *res, Gcalc_result_receiver *storage);
int get_result_thread(res_point *cur, Gcalc_result_receiver *storage,
int move_upward, res_point *first_poly_node);