~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/quick_ror_intersect_select.cc

  • Committer: Mark Atwood
  • Date: 2011-06-24 02:13:02 UTC
  • mfrom: (2318.6.56 rf)
  • Revision ID: me@mark.atwood.name-20110624021302-y9oiksid220xan9s
mergeĀ lp:~olafvdspek/drizzle/refactor14

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    memset(&alloc, 0, sizeof(memory::Root));
57
57
  }
58
58
 
59
 
  if (parent_alloc)
60
 
  {
61
 
    last_rowid= (unsigned char*) parent_alloc->alloc_root(head->cursor->ref_length);
62
 
  }
63
 
  else
64
 
  {
65
 
    last_rowid= (unsigned char*) alloc.alloc_root(head->cursor->ref_length);
66
 
  }
 
59
  last_rowid= parent_alloc
 
60
    ? parent_alloc->alloc(head->cursor->ref_length)
 
61
    : alloc.alloc(head->cursor->ref_length);
67
62
}
68
63
 
69
64
 
145
140
}
146
141
 
147
142
 
148
 
bool
149
 
optimizer::QuickRorIntersectSelect::push_quick_back(optimizer::QuickRangeSelect *quick)
 
143
void optimizer::QuickRorIntersectSelect::push_quick_back(optimizer::QuickRangeSelect *quick)
150
144
{
151
145
  quick_selects.push_back(quick);
152
 
  return false;
153
146
}
154
147
 
155
148
 
156
149
bool optimizer::QuickRorIntersectSelect::is_keys_used(const boost::dynamic_bitset<>& fields)
157
150
{
158
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
159
 
       it != quick_selects.end();
160
 
       ++it)
 
151
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
161
152
  {
162
 
    if (is_key_used(head, (*it)->index, fields))
163
 
    {
 
153
    if (is_key_used(head, it->index, fields))
164
154
      return 1;
165
 
    }
166
155
  }
167
156
  return 0;
168
157
}