~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Brian Aker
  • Date: 2011-02-05 10:54:10 UTC
  • mfrom: (2141.3.3 test)
  • Revision ID: brian@tangent.org-20110205105410-j3wih60hfx5aq75j
Merge in VJ

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
namespace drizzled
69
69
{
70
 
 
71
70
extern plugin::StorageEngine *heap_engine;
72
71
 
73
72
/** Declarations of static functions used in this source file. */
4506
4505
      /* Ignore sj-nests: */
4507
4506
      if (!embedding->on_expr)
4508
4507
        continue;
4509
 
      nested_join_st *nested_join= embedding->getNestedJoin();
 
4508
      NestedJoin *nested_join= embedding->getNestedJoin();
4510
4509
      if (!nested_join->counter_)
4511
4510
      {
4512
4511
        /*
5246
5245
static COND *simplify_joins(Join *join, List<TableList> *join_list, COND *conds, bool top)
5247
5246
{
5248
5247
  TableList *table;
5249
 
  nested_join_st *nested_join;
 
5248
  NestedJoin *nested_join;
5250
5249
  TableList *prev_table= 0;
5251
5250
  List_iterator<TableList> li(*join_list);
5252
5251
 
5584
5583
      s->embedding_map.reset();
5585
5584
      do
5586
5585
      {
5587
 
        nested_join_st *nested_join= embedding->getNestedJoin();
 
5586
        NestedJoin *nested_join= embedding->getNestedJoin();
5588
5587
        s->embedding_map|= nested_join->nj_map;
5589
5588
        s->dependent|= embedding->getDepTables();
5590
5589
        embedding= embedding->getEmbedding();
5668
5667
    s= p_pos->getJoinTable();
5669
5668
    s->type= AM_SYSTEM;
5670
5669
    join->const_table_map|=s->table->map;
5671
 
    if ((tmp= join_read_const_table(s, p_pos)))
 
5670
    if ((tmp= s->joinReadConstTable(p_pos)))
5672
5671
    {
5673
5672
      if (tmp > 0)
5674
5673
        return 1;                       // Fatal error
5742
5741
          join->const_table_map|=table->map;
5743
5742
          set_position(join, const_count++, s, (optimizer::KeyUse*) 0);
5744
5743
          partial_pos= join->getSpecificPosInPartialPlan(const_count - 1);
5745
 
          if ((tmp= join_read_const_table(s, partial_pos)))
 
5744
          if ((tmp= s->joinReadConstTable(partial_pos)))
5746
5745
          {
5747
5746
            if (tmp > 0)
5748
5747
              return 1;                 // Fatal error
5794
5793
                if (create_ref_for_key(join, s, start_keyuse, found_const_table_map))
5795
5794
                  return 1;
5796
5795
                partial_pos= join->getSpecificPosInPartialPlan(const_count - 1);
5797
 
                if ((tmp=join_read_const_table(s, partial_pos)))
 
5796
                if ((tmp=s->joinReadConstTable(partial_pos)))
5798
5797
                {
5799
5798
                  if (tmp > 0)
5800
5799
                    return 1;                   // Fatal error
5959
5958
  TableList *table;
5960
5959
  while ((table= li++))
5961
5960
  {
5962
 
    nested_join_st *nested_join;
 
5961
    NestedJoin *nested_join;
5963
5962
    if ((nested_join= table->getNestedJoin()))
5964
5963
    {
5965
5964
      /*
6016
6015
}
6017
6016
 
6018
6017
/**
6019
 
  Set nested_join_st::counter=0 in all nested joins in passed list.
 
6018
  Set NestedJoin::counter=0 in all nested joins in passed list.
6020
6019
 
6021
 
    Recursively set nested_join_st::counter=0 for all nested joins contained in
 
6020
    Recursively set NestedJoin::counter=0 for all nested joins contained in
6022
6021
    the passed join_list.
6023
6022
 
6024
6023
  @param join_list  List of nested joins to process. It may also contain base
6030
6029
  TableList *table;
6031
6030
  while ((table= li++))
6032
6031
  {
6033
 
    nested_join_st *nested_join;
 
6032
    NestedJoin *nested_join;
6034
6033
    if ((nested_join= table->getNestedJoin()))
6035
6034
    {
6036
6035
      nested_join->counter_= 0;
6116
6115
  Join *join= last->join;
6117
6116
  for (;last_emb != NULL; last_emb= last_emb->getEmbedding())
6118
6117
  {
6119
 
    nested_join_st *nest= last_emb->getNestedJoin();
 
6118
    NestedJoin *nest= last_emb->getNestedJoin();
6120
6119
    
6121
6120
    bool was_fully_covered= nest->is_fully_covered();
6122
6121