~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-28 03:17:05 UTC
  • mto: (1112.1.3 merge)
  • mto: This revision was merged to the branch mainline in revision 1113.
  • Revision ID: osullivan.padraig@gmail.com-20090728031705-1ndvsfi2nu48w1mk
Modified the nested_join_map typedef to be std::bitset instead of uint64_t.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3512
3512
  uint32_t prune_level=  join->session->variables.optimizer_prune_level;
3513
3513
  bool straight_join= test(join->select_options & SELECT_STRAIGHT_JOIN);
3514
3514
 
3515
 
  join->cur_embedding_map= 0;
 
3515
  join->cur_embedding_map.reset();
3516
3516
  reset_nj_counters(join->join_list);
3517
3517
  /*
3518
3518
    if (SELECT_STRAIGHT_JOIN option is set)
6002
6002
        continue;
6003
6003
      }
6004
6004
      outer_join|= table->map;
6005
 
      s->embedding_map= 0;
 
6005
      s->embedding_map.reset();
6006
6006
      for (;embedding; embedding= embedding->embedding)
6007
6007
        s->embedding_map|= embedding->nested_join->nj_map;
6008
6008
      continue;
6010
6010
    if (embedding && !(embedding->sj_on_expr && ! embedding->embedding))
6011
6011
    {
6012
6012
      /* s belongs to a nested join, maybe to several embedded joins */
6013
 
      s->embedding_map= 0;
 
6013
      s->embedding_map.reset();
6014
6014
      do
6015
6015
      {
6016
6016
        nested_join_st *nested_join= embedding->nested_join;
6017
 
        s->embedding_map|=nested_join->nj_map;
 
6017
        s->embedding_map|= nested_join->nj_map;
6018
6018
        s->dependent|= embedding->dep_tables;
6019
6019
        embedding= embedding->embedding;
6020
6020
        outer_join|= nested_join->used_tables;
6114
6114
        substitution of a const table the key value happens to be null
6115
6115
        then we can state that there are no matches for this equi-join.
6116
6116
      */
6117
 
      if ((keyuse= s->keyuse) && *s->on_expr_ref && !s->embedding_map)
 
6117
      if ((keyuse= s->keyuse) && *s->on_expr_ref && s->embedding_map.none())
6118
6118
      {
6119
6119
        /*
6120
6120
          When performing an outer join operation if there are no matching rows
6384
6384
      {
6385
6385
        /* Don't assign bits to sj-nests */
6386
6386
        if (table->on_expr)
6387
 
          nested_join->nj_map= (nested_join_map) 1 << first_unused++;
 
6387
          nested_join->nj_map.set(first_unused++);
6388
6388
        first_unused= build_bitmap_for_nested_joins(&nested_join->join_list,
6389
6389
                                                    first_unused);
6390
6390
      }