diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2011-07-12 11:21:20 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2011-07-12 11:21:20 +0500 |
commit | e7c9f52fd960440614c30c3f852bf74f1febe6b3 (patch) | |
tree | dcc91ea14246ff163baf7f51f5448531f96e7c02 /sql/gcalc_tools.cc | |
parent | 67e937095cec8aa922ff3ea971204d59ee3047ff (diff) | |
download | mariadb-git-e7c9f52fd960440614c30c3f852bf74f1febe6b3.tar.gz |
Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple.
We cannot cut a line from a polygon. So if the polygon fits the condition, and
the intersection of a line and the polygon doesn't, we just skip the line.
That rule wasn't applied if the line start was inside the polygon, which leaded
to the assertion.
per-file comments:
mysql-test/r/gis-precise.result
Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple.
test result updated.
mysql-test/t/gis-precise.test
Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple.
test case added.
sql/gcalc_tools.cc
Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple.
Don't mark the line as a border if it's inside a polygon that fits the result condition.
Diffstat (limited to 'sql/gcalc_tools.cc')
-rw-r--r-- | sql/gcalc_tools.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc index 2a9090a04a1..d89385fa78c 100644 --- a/sql/gcalc_tools.cc +++ b/sql/gcalc_tools.cc @@ -879,7 +879,7 @@ int Gcalc_operation_reducer::count_slice(Gcalc_scan_iterator *si) if (!new_t) return 1; m_fn->invert_state(pi.get_shape()); - new_t->result_range= prev_state ^ m_fn->count(); + new_t->result_range= ~prev_state & m_fn->count(); new_t->next= *at_hook; *at_hook= new_t; if (new_t->result_range && @@ -891,12 +891,17 @@ int Gcalc_operation_reducer::count_slice(Gcalc_scan_iterator *si) { active_thread *new_t0, *new_t1; int fn_result; + const Gcalc_heap::Info *p= pi.get_pi(); + bool line= m_fn->get_shape_kind(p->shape) == Gcalc_function::shape_line; if (!(new_t0= new_active_thread()) || !(new_t1= new_active_thread())) return 1; m_fn->invert_state(pi.get_shape()); fn_result= m_fn->count(); - new_t0->result_range= new_t1->result_range= prev_state ^ fn_result; + if (line) + new_t0->result_range= new_t1->result_range= ~prev_state & fn_result; + else + new_t0->result_range= new_t1->result_range= prev_state ^ fn_result; new_t1->next= *at_hook; new_t0->next= new_t1; *at_hook= new_t0; |