~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 20:05:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622200558-oq3jb987di9yj70r
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
2192
2192
  Item *item;
2193
2193
 
2194
2194
  if (*sum_funcs && !recompute)
2195
 
    return(false); /* We have already initialized sum_funcs. */
 
2195
    return false; /* We have already initialized sum_funcs. */
2196
2196
 
2197
2197
  func= sum_funcs;
2198
2198
  while ((item=it++))
2214
2214
      sum_funcs_end[i]= func;
2215
2215
  }
2216
2216
  else if (rollup.getState() == Rollup::STATE_READY)
2217
 
    return(false);                         // Don't put end marker
 
2217
    return false;                         // Don't put end marker
2218
2218
  *func=0;          // End marker
2219
 
  return(false);
 
2219
  return false;
2220
2220
}
2221
2221
 
2222
2222
/** Allocate memory needed for other rollup functions. */
2564
2564
  result= res;
2565
2565
  if (result->prepare(fields_list, select_lex->master_unit()))
2566
2566
  {
2567
 
    return(true);
 
2567
    return true;
2568
2568
  }
2569
 
  return(false);
 
2569
  return false;
2570
2570
}
2571
2571
 
2572
2572
/**
3399
3399
        join->full_join=1;
3400
3400
    }
3401
3401
    else if (create_ref_for_key(join, j, keyuse, used_tables))
3402
 
      return(true);                        // Something went wrong
 
3402
      return true;                        // Something went wrong
3403
3403
  }
3404
3404
 
3405
3405
  for (i=0 ; i < table_count ; i++)
3491
3491
  */
3492
3492
  if (join->session->lex().is_single_level_stmt())
3493
3493
    join->session->status_var.last_query_cost= join->best_read;
3494
 
  return(false);
 
3494
  return false;
3495
3495
}
3496
3496
 
3497
3497
/**
4179
4179
    join->best_read= DBL_MAX;
4180
4180
    if (best_extension_by_limited_search(join, remaining_tables, idx, record_count,
4181
4181
                                         read_time, search_depth, prune_level))
4182
 
      return(true);
 
4182
      return true;
4183
4183
 
4184
4184
    if (size_remain <= search_depth)
4185
4185
    {
4187
4187
        'join->best_positions' contains a complete optimal extension of the
4188
4188
        current partial QEP.
4189
4189
      */
4190
 
      return(false);
 
4190
      return false;
4191
4191
    }
4192
4192
 
4193
4193
    /* select the first table in the optimal extension as most promising */
4356
4356
{
4357
4357
  Session *session= join->session;
4358
4358
  if (session->getKilled())  // Abort
4359
 
    return(true);
 
4359
    return true;
4360
4360
 
4361
4361
  /*
4362
4362
     'join' is a partial plan with lower cost than the best plan so far,
4436
4436
                                             current_read_time,
4437
4437
                                             search_depth - 1,
4438
4438
                                             prune_level))
4439
 
          return(true);
 
4439
          return true;
4440
4440
        std::swap(join->best_ref[idx], *pos);
4441
4441
      }
4442
4442
      else
4459
4459
      restore_prev_nj_state(s);
4460
4460
    }
4461
4461
  }
4462
 
  return(false);
 
4462
  return false;
4463
4463
}
4464
4464
 
4465
4465
/**
6222
6222
static bool add_ref_to_table_cond(Session *session, JoinTable *join_tab)
6223
6223
{
6224
6224
  if (!join_tab->ref.key_parts)
6225
 
    return(false);
 
6225
    return false;
6226
6226
 
6227
6227
  Item_cond_and *cond=new Item_cond_and();
6228
6228
  Table *table=join_tab->table;
6234
6234
    cond->add(new Item_func_equal(new Item_field(field), value));
6235
6235
  }
6236
6236
  if (session->is_fatal_error)
6237
 
    return(true);
 
6237
    return true;
6238
6238
 
6239
6239
  if (!cond->fixed)
6240
6240
    cond->fix_fields(session, (Item**)&cond);