~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Brian Aker
  • Date: 2011-02-21 18:33:47 UTC
  • mto: (2187.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2188.
  • Revision ID: brian@tangent.org-20110221183347-37lw0bf0eizv0gxm
getLex() usage and fix for table_name creation during admin commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
  */
497
497
  Name_resolution_context *last_checked_context= context;
498
498
  Item **ref= (Item **) not_found_item;
499
 
  Select_Lex *current_sel= (Select_Lex *) session->lex->current_select;
 
499
  Select_Lex *current_sel= (Select_Lex *) session->getLex()->current_select;
500
500
  Name_resolution_context *outer_context= 0;
501
501
  Select_Lex *select= 0;
502
502
  /* Currently derived tables cannot be correlated */
562
562
              return -1;
563
563
            session->change_item_tree(reference, rf);
564
564
            select->inner_refs_list.push_back(rf);
565
 
            rf->in_sum_func= session->lex->in_sum_func;
 
565
            rf->in_sum_func= session->getLex()->in_sum_func;
566
566
          }
567
567
          /*
568
568
            A reference is resolved to a nest level that's outer or the same as
569
569
            the nest level of the enclosing set function : adjust the value of
570
570
            max_arg_level for the function if it's needed.
571
571
          */
572
 
          if (session->lex->in_sum_func &&
573
 
              session->lex->in_sum_func->nest_level >= select->nest_level)
 
572
          if (session->getLex()->in_sum_func &&
 
573
              session->getLex()->in_sum_func->nest_level >= select->nest_level)
574
574
          {
575
575
            Item::Type ref_type= (*reference)->type();
576
 
            set_if_bigger(session->lex->in_sum_func->max_arg_level,
 
576
            set_if_bigger(session->getLex()->in_sum_func->max_arg_level,
577
577
                          select->nest_level);
578
578
            set_field(*from_field);
579
579
            fixed= 1;
682
682
    if (place != IN_HAVING && select->group_list.elements)
683
683
    {
684
684
      outer_context->select_lex->inner_refs_list.push_back((Item_outer_ref*)rf);
685
 
      ((Item_outer_ref*)rf)->in_sum_func= session->lex->in_sum_func;
 
685
      ((Item_outer_ref*)rf)->in_sum_func= session->getLex()->in_sum_func;
686
686
    }
687
687
    session->change_item_tree(reference, rf);
688
688
    /*
788
788
                                          context->first_name_resolution_table,
789
789
                                          context->last_name_resolution_table,
790
790
                                          reference,
791
 
                                          session->lex->use_only_table_context ?
 
791
                                          session->getLex()->use_only_table_context ?
792
792
                                            REPORT_ALL_ERRORS :
793
793
                                            IGNORE_EXCEPT_NON_UNIQUE, true)) ==
794
794
        not_found_field)
795
795
    {
796
796
      int ret;
797
797
      /* Look up in current select's item_list to find aliased fields */
798
 
      if (session->lex->current_select->is_item_list_lookup)
 
798
      if (session->getLex()->current_select->is_item_list_lookup)
799
799
      {
800
800
        uint32_t counter;
801
801
        enum_resolution_type resolution;
802
802
        Item** res= find_item_in_list(session,
803
 
                                      this, session->lex->current_select->item_list,
 
803
                                      this, session->getLex()->current_select->item_list,
804
804
                                      &counter, REPORT_EXCEPT_NOT_FOUND,
805
805
                                      &resolution);
806
806
        if (!res)
888
888
      return false;
889
889
 
890
890
    set_field(from_field);
891
 
    if (session->lex->in_sum_func &&
892
 
        session->lex->in_sum_func->nest_level ==
893
 
        session->lex->current_select->nest_level)
 
891
    if (session->getLex()->in_sum_func &&
 
892
        session->getLex()->in_sum_func->nest_level ==
 
893
        session->getLex()->current_select->nest_level)
894
894
    {
895
 
      set_if_bigger(session->lex->in_sum_func->max_arg_level,
896
 
                    session->lex->current_select->nest_level);
 
895
      set_if_bigger(session->getLex()->in_sum_func->max_arg_level,
 
896
                    session->getLex()->current_select->nest_level);
897
897
    }
898
898
  }
899
899
  else if (session->mark_used_columns != MARK_COLUMNS_NONE)