~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/quick_ror_intersect_select.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 11:44:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623114430-no355yypk4y3icqb
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
int optimizer::QuickRorIntersectSelect::reset()
127
127
{
128
128
  if (! scans_inited && init_ror_merged_scan(true))
129
 
  {
130
129
    return 0;
131
 
  }
132
130
  scans_inited= true;
133
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
134
 
       it != quick_selects.end();
135
 
       ++it)
136
 
  {
137
 
    (*it)->reset();
138
 
  }
 
131
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
 
132
    it->reset();
139
133
  return 0;
140
134
}
141
135
 
240
234
{
241
235
  bool first= true;
242
236
  str->append("intersect(");
243
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
244
 
       it != quick_selects.end();
245
 
       ++it)
 
237
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
246
238
  {
247
 
    KeyInfo *key_info= head->key_info + (*it)->index;
 
239
    KeyInfo *key_info= head->key_info + it->index;
248
240
    if (! first)
249
241
      str->append(",");
250
242
    else
267
259
  char buf[64];
268
260
  uint32_t length;
269
261
  bool first= true;
270
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
271
 
       it != quick_selects.end();
272
 
       ++it)
 
262
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
273
263
  {
274
 
    KeyInfo *key_info= head->key_info + (*it)->index;
 
264
    KeyInfo *key_info= head->key_info + it->index;
275
265
    if (first)
276
266
    {
277
267
      first= false;
282
272
      used_lengths->append(",");
283
273
    }
284
274
    key_names->append(key_info->name);
285
 
    length= internal::int64_t2str((*it)->max_used_key_length, buf, 10) - buf;
 
275
    length= internal::int64_t2str(it->max_used_key_length, buf, 10) - buf;
286
276
    used_lengths->append(buf, length);
287
277
  }
288
278