~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/sel_tree.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 18:35:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622183535-uuhkg09yvcl4fstx
Refactir

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
     other Error
94
94
 */
95
95
 
96
 
static int imerge_list_or_tree(optimizer::RangeParameter *param, List<optimizer::SEL_IMERGE> *im1, optimizer::SEL_TREE *tree)
 
96
static int imerge_list_or_tree(optimizer::RangeParameter& param, List<optimizer::SEL_IMERGE>& im1, optimizer::SEL_TREE& tree)
97
97
{
98
 
  List_iterator<optimizer::SEL_IMERGE> it(im1->begin());
 
98
  List_iterator<optimizer::SEL_IMERGE> it(im1.begin());
99
99
  while (optimizer::SEL_IMERGE* imerge= it++)
100
100
  {
101
 
    if (imerge->or_sel_tree_with_checks(*param, *tree))
 
101
    if (imerge->or_sel_tree_with_checks(param, tree))
102
102
      it.remove();
103
103
  }
104
 
  return im1->is_empty();
 
104
  return im1.is_empty();
105
105
}
106
106
 
107
107
 
197
197
      if (param->remove_jump_scans && optimizer::remove_nonrange_trees(param, tree2))
198
198
         return(new optimizer::SEL_TREE(optimizer::SEL_TREE::ALWAYS));
199
199
      /* add tree2 to tree1->merges, checking if it collapses to ALWAYS */
200
 
      if (imerge_list_or_tree(param, &tree1->merges, tree2))
 
200
      if (imerge_list_or_tree(*param, tree1->merges, *tree2))
201
201
        result= new optimizer::SEL_TREE(optimizer::SEL_TREE::ALWAYS);
202
202
      else
203
203
        result= tree1;