~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 22:41:26 UTC
  • mto: (656.1.8 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206224126-lw8opdmpioz77o1p
trailing whitespace fixup

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
  if (field->table == table || !table)
108
108
    bitmap_set_bit(field->table->read_set, field->field_index);
109
109
  if (field->vcol_info && field->vcol_info->expr_item)
110
 
    return field->vcol_info->expr_item->walk(&Item::register_field_in_read_map, 
 
110
    return field->vcol_info->expr_item->walk(&Item::register_field_in_read_map,
111
111
                                             1, arg);
112
112
  return 0;
113
113
}
660
660
    /*
661
661
      Here, a subset of actions performed by Item_ref::set_properties
662
662
      is not enough. So we pass ptr to NULL into Item_[direct]_ref
663
 
      constructor, so no initialization is performed, and call 
 
663
      constructor, so no initialization is performed, and call
664
664
      fix_fields() below.
665
665
    */
666
666
    save= *ref;
787
787
                                          context->last_name_resolution_table,
788
788
                                          reference,
789
789
                                          session->lex->use_only_table_context ?
790
 
                                            REPORT_ALL_ERRORS : 
 
790
                                            REPORT_ALL_ERRORS :
791
791
                                            IGNORE_EXCEPT_NON_UNIQUE,
792
792
                                          !any_privileges,
793
793
                                          true)) ==
822
822
            if (new_field == NULL)
823
823
            {
824
824
              /* The column to which we link isn't valid. */
825
 
              my_error(ER_BAD_FIELD_ERROR, MYF(0), (*res)->name, 
 
825
              my_error(ER_BAD_FIELD_ERROR, MYF(0), (*res)->name,
826
826
                       current_session->where);
827
827
              return(1);
828
828
            }
842
842
              return 1;
843
843
            session->change_item_tree(reference, rf);
844
844
            /*
845
 
              Because Item_ref never substitutes itself with other items 
846
 
              in Item_ref::fix_fields(), we can safely use the original 
 
845
              Because Item_ref never substitutes itself with other items
 
846
              in Item_ref::fix_fields(), we can safely use the original
847
847
              pointer to it even after fix_fields()
848
848
             */
849
849
            return rf->fix_fields(session, reference) ||  rf->check_cols(1);
888
888
 
889
889
    set_field(from_field);
890
890
    if (session->lex->in_sum_func &&
891
 
        session->lex->in_sum_func->nest_level == 
 
891
        session->lex->in_sum_func->nest_level ==
892
892
        session->lex->current_select->nest_level)
893
893
      set_if_bigger(session->lex->in_sum_func->max_arg_level,
894
894
                    session->lex->current_select->nest_level);
962
962
  of the current level (in the cond_equal->current_level list).
963
963
  If it fails, it continues searching in upper levels accessed
964
964
  through a pointer cond_equal->upper_levels.
965
 
  The search terminates as soon as a multiple equality containing 
966
 
  the field is found. 
 
965
  The search terminates as soon as a multiple equality containing
 
966
  the field is found.
967
967
 
968
968
  @param cond_equal   reference to list of multiple equalities where
969
969
                      the field (this object) is to be looked for
984
984
      if (item->contains(field))
985
985
        return item;
986
986
    }
987
 
    /* 
 
987
    /*
988
988
      The field is not found in any of the multiple equalities
989
989
      of the current level. Look for it in upper levels
990
990
    */
1068
1068
    the same as (Item_hex_string->val_str() in BINARY column)->val_int().
1069
1069
    We cannot simply disable the replacement in a particular context (
1070
1070
    e.g. <bin_col> = <int_col> AND <bin_col> = <hex_string>) since
1071
 
    Items don't know the context they are in and there are functions like 
 
1071
    Items don't know the context they are in and there are functions like
1072
1072
    IF (<hex_string>, 'yes', 'no').
1073
1073
    The same problem occurs when comparing a DATE/TIME field with a
1074
1074
    DATE/TIME represented as an int and as a string.
1102
1102
  The function returns a pointer to an item that is taken from
1103
1103
  the very beginning of the item_equal list which the Item_field
1104
1104
  object refers to (belongs to) unless item_equal contains  a constant
1105
 
  item. In this case the function returns this constant item, 
1106
 
  (if the substitution does not require conversion).   
 
1105
  item. In this case the function returns this constant item,
 
1106
  (if the substitution does not require conversion).
1107
1107
  If the Item_field object does not refer any Item_equal object
1108
1108
  'this' is returned .
1109
1109