~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Lee Bieber
  • Date: 2011-03-13 16:37:38 UTC
  • mfrom: (2227.4.18 session2)
  • Revision ID: kalebral@gmail.com-20110313163738-7ti21zk40o2xi3ew
Merge Olaf - Refactor Session

Show diffs side-by-side

added added

removed removed

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