#At file:///home/hf/work/mysql_common/wrk41481/
2655 Alexey Botchkov 2008-12-24
Bug#41481 Buffer function never returns, cpu 100%, system locks up
some cases were inproperly handled in the 'slicescan' alorithm
modified:
sql/gcalc_slicescan.cc
sql/item_geofunc.cc
modified:
sql/gcalc_slicescan.cc
sql/item_geofunc.cc
=== modified file 'sql/gcalc_slicescan.cc'
--- a/sql/gcalc_slicescan.cc 2007-11-22 16:17:17 +0000
+++ b/sql/gcalc_slicescan.cc 2008-12-24 16:54:44 +0000
@@ -538,7 +538,7 @@ int gcalc_scan_iterator::handle_intersec
m_sav_slice= m_slice1;
m_sav_y= m_y1;
- m_slice1= new_slice(m_slice0);
+ m_slice1= new_slice(m_sav_slice);
m_cur_intersection= m_intersections;
m_pre_intersection_hook= NULL;
@@ -632,7 +632,7 @@ redo_loop:
if (next_s0->thread != m_cur_intersection->thread_b)
{
/* It's really rare case - sometimes happen when
- there's two intersection with the same Y
+ there's two intersections with the same Y
Move suitable one to the beginning of the list
*/
pop_suitable_intersection();
@@ -661,6 +661,12 @@ redo_loop:
psp1= (point **)&sp1->next;
}
+ if (*psp1)
+ {
+ free_list(*psp1);
+ *psp1= NULL;
+ }
+
return 0;
}
=== modified file 'sql/item_geofunc.cc'
--- a/sql/item_geofunc.cc 2008-01-28 15:32:34 +0000
+++ b/sql/item_geofunc.cc 2008-12-24 16:54:44 +0000
@@ -698,7 +698,6 @@ String *Item_func_spatial_operation::val
String *res2= args[1]->val_str(&tmp_value2);
Geometry_buffer buffer1, buffer2;
Geometry *g1, *g2;
- int result;
uint32 srid= 0;
if (func.reserve_op_buffer(1))
@@ -1029,7 +1028,7 @@ int Item_func_buffer::add_line_buffer(gc
return 0;
}
- if (!p_next->left) /* Line consists of two points */
+ if (p_next->left == p1) /* Line consists of two points */
{
if (add_edge_buffer(p_cur, p_next, p_next->left, d, true, true))
return 1;
@@ -1044,7 +1043,7 @@ int Item_func_buffer::add_line_buffer(gc
p_cur= p_next;
p_next= p_next->left;
- while (p_next->left)
+ while (p_next->left != p_cur)
{
if (add_edge_buffer(p_cur, p_next, p_next->left, d, false, false))
return 1;
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (holyfoot:2655) Bug#41481 | Alexey Botchkov | 24 Dec |