~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Prafulla Tekawade
  • Date: 2010-07-06 15:51:58 UTC
  • mfrom: (1643 rollup)
  • mto: (1662.1.4 rollup)
  • mto: This revision was merged to the branch mainline in revision 1664.
  • Revision ID: prafulla_t@users.sourceforge.net-20100706155158-yf8f947vbwlyai77
Merger from main branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
  {
456
456
    if (table->on_expr)
457
457
      table->on_expr->fix_after_pullout(new_parent, &table->on_expr);
458
 
    if (table->nested_join)
459
 
      fix_list_after_tbl_changes(new_parent, &table->nested_join->join_list);
 
458
    if (table->getNestedJoin())
 
459
      fix_list_after_tbl_changes(new_parent, &table->getNestedJoin()->join_list);
460
460
  }
461
461
}
462
462
 
625
625
    TableList *table;
626
626
    while ((table= li++))
627
627
    {
628
 
      if (table->nested_join)
 
628
      if (table->getNestedJoin())
629
629
        add_key_fields_for_nj(join_tab->join, table, &end, &and_level,
630
630
                              sargables);
631
631
    }
2266
2266
    {
2267
2267
      if (table->on_expr)
2268
2268
      {
2269
 
        List<TableList> *nested_join_list= table->nested_join ?
2270
 
          &table->nested_join->join_list : NULL;
 
2269
        List<TableList> *nested_join_list= table->getNestedJoin() ?
 
2270
          &table->getNestedJoin()->join_list : NULL;
2271
2271
        /*
2272
2272
          We can modify table->on_expr because its old value will
2273
2273
          be restored before re-execution of PS/SP.
2858
2858
*/
2859
2859
bool check_interleaving_with_nj(JoinTable *last_tab, JoinTable *next_tab)
2860
2860
{
2861
 
  TableList *next_emb= next_tab->table->pos_in_table_list->embedding;
 
2861
  TableList *next_emb= next_tab->table->pos_in_table_list->getEmbedding();
2862
2862
  Join *join= last_tab->join;
2863
2863
 
2864
2864
  if ((join->cur_embedding_map & ~next_tab->embedding_map).any())
2874
2874
    Do update counters for "pairs of brackets" that we've left (marked as
2875
2875
    X,Y,Z in the above picture)
2876
2876
  */
2877
 
  for (;next_emb; next_emb= next_emb->embedding)
 
2877
  for (;next_emb; next_emb= next_emb->getEmbedding())
2878
2878
  {
2879
 
    next_emb->nested_join->counter_++;
2880
 
    if (next_emb->nested_join->counter_ == 1)
 
2879
    next_emb->getNestedJoin()->counter_++;
 
2880
    if (next_emb->getNestedJoin()->counter_ == 1)
2881
2881
    {
2882
2882
      /*
2883
2883
        next_emb is the first table inside a nested join we've "entered". In
2884
2884
        the picture above, we're looking at the 'X' bracket. Don't exit yet as
2885
2885
        X bracket might have Y pair bracket.
2886
2886
      */
2887
 
      join->cur_embedding_map |= next_emb->nested_join->nj_map;
 
2887
      join->cur_embedding_map |= next_emb->getNestedJoin()->nj_map;
2888
2888
    }
2889
2889
 
2890
 
    if (next_emb->nested_join->join_list.elements !=
2891
 
        next_emb->nested_join->counter_)
 
2890
    if (next_emb->getNestedJoin()->join_list.elements !=
 
2891
        next_emb->getNestedJoin()->counter_)
2892
2892
      break;
2893
2893
 
2894
2894
    /*
2895
2895
      We're currently at Y or Z-bracket as depicted in the above picture.
2896
2896
      Mark that we've left it and continue walking up the brackets hierarchy.
2897
2897
    */
2898
 
    join->cur_embedding_map &= ~next_emb->nested_join->nj_map;
 
2898
    join->cur_embedding_map &= ~next_emb->getNestedJoin()->nj_map;
2899
2899
  }
2900
2900
  return false;
2901
2901
}
3664
3664
      embedded= embedding;
3665
3665
      if (embedded->on_expr)
3666
3666
         update_const_equal_items(embedded->on_expr, tab);
3667
 
      embedding= embedded->embedding;
 
3667
      embedding= embedded->getEmbedding();
3668
3668
    }
3669
3669
    while (embedding &&
3670
 
           embedding->nested_join->join_list.head() == embedded);
 
3670
           embedding->getNestedJoin()->join_list.head() == embedded);
3671
3671
  }
3672
3672
 
3673
3673
  return(0);