~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/sel_imerge.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 18:04:33 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622180433-gcivyj08ars8iu95
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
{}
40
40
 
41
41
 
42
 
int optimizer::SEL_IMERGE::or_sel_tree(optimizer::RangeParameter *param, optimizer::SEL_TREE *tree)
 
42
void optimizer::SEL_IMERGE::or_sel_tree(optimizer::RangeParameter *param, optimizer::SEL_TREE *tree)
43
43
{
44
44
  if (trees_next == trees_end)
45
45
  {
54
54
    trees_end= trees + old_elements * realloc_ratio;
55
55
  }
56
56
  *(trees_next++)= tree;
57
 
  return 0; // return void
58
57
}
59
58
 
60
59
 
61
60
int optimizer::SEL_IMERGE::or_sel_tree_with_checks(optimizer::RangeParameter *param, optimizer::SEL_TREE *new_tree)
62
61
{
63
 
  for (optimizer::SEL_TREE** tree = trees;
64
 
       tree != trees_next;
65
 
       tree++)
 
62
  for (optimizer::SEL_TREE** tree = trees; tree != trees_next; tree++)
66
63
  {
67
64
    if (sel_trees_can_be_ored(*tree, new_tree, param))
68
65
    {
78
75
  }
79
76
 
80
77
  /* New tree cannot be combined with any of existing trees. */
81
 
  return or_sel_tree(param, new_tree);
 
78
  or_sel_tree(param, new_tree);
 
79
  return 0;
82
80
}
83
81
 
84
82