~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-27 15:10:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2351.
  • Revision ID: olafvdspek@gmail.com-20110627151059-ubjo6jgjm6lcx5vr
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
    if (cmp >= 0 && tmp->cmp_min_to_min(key2) < 0)
349
349
    {                                           // tmp.min <= x < key2.min
350
350
      optimizer::SEL_ARG *new_arg= tmp->clone_first(key2);
351
 
      if (! new_arg)
352
 
        return 0;                               // OOM
353
351
      if ((new_arg->next_key_part= key1->next_key_part))
354
352
        new_arg->increment_use_count(key1->use_count+1);
355
353
      tmp->copy_min_to_min(key2);
363
361
      if (tmp->cmp_min_to_min(&key) > 0)
364
362
      {                                         // key.min <= x < tmp.min
365
363
        optimizer::SEL_ARG *new_arg= key.clone_first(tmp);
366
 
        if (! new_arg)
367
 
          return 0;                             // OOM
368
364
        if ((new_arg->next_key_part=key.next_key_part))
369
365
          new_arg->increment_use_count(key1->use_count+1);
370
366
        key1= key1->insert(new_arg);
398
394
      else
399
395
      {
400
396
        optimizer::SEL_ARG *new_arg= tmp->clone_last(&key); // tmp.min <= x <= key.max
401
 
        if (! new_arg)
402
 
          return 0;                             // OOM
403
397
        tmp->copy_max_to_min(&key);
404
398
        tmp->increment_use_count(key1->use_count+1);
405
399
        /* Increment key count as it may be used for next loop */