~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-06-28 16:57:19 UTC
  • mfrom: (1637.2.9 convert-TableList)
  • Revision ID: brian@gaz-20100628165719-rpgaxo0hk055r5ct
Merge in VJ

Show diffs side-by-side

added added

removed removed

Lines of Context:
1389
1389
    /* Free cache if too big */
1390
1390
    unused_tables.cull();
1391
1391
 
1392
 
    if (table_list->create)
 
1392
    if (table_list->isCreate())
1393
1393
    {
1394
1394
      TableIdentifier  lock_table_identifier(table_list->db, table_list->table_name, message::Table::STANDARD);
1395
1395
 
2658
2658
    TODO-> Ensure that table_name, db_name and tables->db always points to something !
2659
2659
  */
2660
2660
  if (/* Exclude nested joins. */
2661
 
      (!table_list->nested_join) &&
 
2661
      (!table_list->getNestedJoin()) &&
2662
2662
      /* Include merge views and information schema tables. */
2663
2663
      /*
2664
2664
        Test if the field qualifiers match the table reference we plan
2672
2672
 
2673
2673
  *actual_table= NULL;
2674
2674
 
2675
 
  if (!table_list->nested_join)
 
2675
  if (!table_list->getNestedJoin())
2676
2676
  {
2677
2677
    /* 'table_list' is a stored table. */
2678
2678
    assert(table_list->table);
2692
2692
    */
2693
2693
    if (table_name && table_name[0])
2694
2694
    {
2695
 
      List_iterator<TableList> it(table_list->nested_join->join_list);
 
2695
      List_iterator<TableList> it(table_list->getNestedJoin()->join_list);
2696
2696
      TableList *table;
2697
2697
      while ((table= it++))
2698
2698
      {
3284
3284
    Leaf table references to which new natural join columns are added
3285
3285
    if the leaves are != NULL.
3286
3286
  */
3287
 
  TableList *leaf_1= (table_ref_1->nested_join &&
3288
 
                      !table_ref_1->is_natural_join) ?
 
3287
  TableList *leaf_1= (table_ref_1->getNestedJoin() &&
 
3288
                      ! table_ref_1->is_natural_join) ?
3289
3289
    NULL : table_ref_1;
3290
 
  TableList *leaf_2= (table_ref_2->nested_join &&
3291
 
                      !table_ref_2->is_natural_join) ?
 
3290
  TableList *leaf_2= (table_ref_2->getNestedJoin() &&
 
3291
                      ! table_ref_2->is_natural_join) ?
3292
3292
    NULL : table_ref_2;
3293
3293
 
3294
3294
  *found_using_fields= 0;
3613
3613
  bool result= true;
3614
3614
 
3615
3615
  /* Call the procedure recursively for each nested table reference. */
3616
 
  if (table_ref->nested_join)
 
3616
  if (table_ref->getNestedJoin())
3617
3617
  {
3618
 
    List_iterator_fast<TableList> nested_it(table_ref->nested_join->join_list);
 
3618
    List_iterator_fast<TableList> nested_it(table_ref->getNestedJoin()->join_list);
3619
3619
    TableList *same_level_left_neighbor= nested_it++;
3620
3620
    TableList *same_level_right_neighbor= NULL;
3621
3621
    /* Left/right-most neighbors, possibly at higher levels in the join tree. */
3640
3640
          cur_table_ref->outer_join & JOIN_TYPE_RIGHT)
3641
3641
      {
3642
3642
        /* This can happen only for JOIN ... ON. */
3643
 
        assert(table_ref->nested_join->join_list.elements == 2);
 
3643
        assert(table_ref->getNestedJoin()->join_list.elements == 2);
3644
3644
        std::swap(same_level_left_neighbor, cur_table_ref);
3645
3645
      }
3646
3646
 
3653
3653
      real_right_neighbor= (same_level_right_neighbor) ?
3654
3654
        same_level_right_neighbor : right_neighbor;
3655
3655
 
3656
 
      if (cur_table_ref->nested_join &&
 
3656
      if (cur_table_ref->getNestedJoin() &&
3657
3657
          store_top_level_join_columns(session, cur_table_ref,
3658
3658
                                       real_left_neighbor, real_right_neighbor))
3659
3659
        goto err;
3667
3667
  */
3668
3668
  if (table_ref->is_natural_join)
3669
3669
  {
3670
 
    assert(table_ref->nested_join &&
3671
 
           table_ref->nested_join->join_list.elements == 2);
3672
 
    List_iterator_fast<TableList> operand_it(table_ref->nested_join->join_list);
 
3670
    assert(table_ref->getNestedJoin() &&
 
3671
           table_ref->getNestedJoin()->join_list.elements == 2);
 
3672
    List_iterator_fast<TableList> operand_it(table_ref->getNestedJoin()->join_list);
3673
3673
    /*
3674
3674
      Notice that the order of join operands depends on whether table_ref
3675
3675
      represents a LEFT or a RIGHT join. In a RIGHT join, the operands are
4299
4299
          goto err_no_arena;
4300
4300
        select_lex->cond_count++;
4301
4301
      }
4302
 
      embedding= embedded->embedding;
 
4302
      embedding= embedded->getEmbedding();
4303
4303
    }
4304
4304
    while (embedding &&
4305
 
           embedding->nested_join->join_list.head() == embedded);
 
4305
           embedding->getNestedJoin()->join_list.head() == embedded);
4306
4306
 
4307
4307
  }
4308
4308
  session->session_marker= save_session_marker;