diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 127 |
1 files changed, 28 insertions, 99 deletions
diff --git a/sql/item.cc b/sql/item.cc index 0a7972b6617..9852053f925 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -368,7 +368,7 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value) my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) { - DBUG_ASSERT(fixed == 1); + DBUG_ASSERT(is_fixed()); MYSQL_TIME ltime; if (get_temporal_with_sql_mode(<ime)) { @@ -382,7 +382,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value) { - DBUG_ASSERT(fixed == 1); + DBUG_ASSERT(is_fixed()); MYSQL_TIME ltime; if (get_time(<ime)) { @@ -395,7 +395,7 @@ my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value) longlong Item::val_int_from_date() { - DBUG_ASSERT(fixed == 1); + DBUG_ASSERT(is_fixed()); MYSQL_TIME ltime; if (get_temporal_with_sql_mode(<ime)) return 0; @@ -406,7 +406,7 @@ longlong Item::val_int_from_date() double Item::val_real_from_date() { - DBUG_ASSERT(fixed == 1); + DBUG_ASSERT(is_fixed()); MYSQL_TIME ltime; if (get_temporal_with_sql_mode(<ime)) return 0; @@ -502,7 +502,7 @@ int Item::save_str_value_in_field(Field *field, String *result) Item::Item(THD *thd): is_expensive_cache(-1), rsize(0), name(null_clex_str), orig_name(0), - fixed(0), is_autogenerated_name(TRUE) + is_autogenerated_name(TRUE) { DBUG_ASSERT(thd); marker= 0; @@ -554,7 +554,6 @@ Item::Item(THD *thd, Item *item): with_param(item->with_param), with_window_func(item->with_window_func), with_field(item->with_field), - fixed(item->fixed), is_autogenerated_name(item->is_autogenerated_name) { next= thd->free_list; // Put in free list @@ -624,7 +623,6 @@ void Item::cleanup() { DBUG_ENTER("Item::cleanup"); DBUG_PRINT("enter", ("this: %p", this)); - fixed= 0; marker= 0; join_tab_idx= MAX_TABLES; if (orig_name) @@ -644,7 +642,7 @@ void Item::cleanup() bool Item::cleanup_processor(void *arg) { - if (fixed) + if (is_fixed()) cleanup(); return FALSE; } @@ -1166,7 +1164,7 @@ bool Item::check_type_scalar(const char *opname) const This hack in Item_outer_ref should probably be refactored eventually. Discuss with Sanja. */ - DBUG_ASSERT(fixed || type() == REF_ITEM); + DBUG_ASSERT(is_fixed() || type() == REF_ITEM); const Type_handler *handler= type_handler(); if (handler->is_scalar_type()) return false; @@ -1315,7 +1313,6 @@ Item *Item_cache::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) unlikely(!(cache= new (thd->mem_root) Item_cache_str(thd, conv)))) return NULL; // Safe conversion is not possible, or OEM cache->setup(thd, conv); - cache->fixed= false; // Make Item::fix_fields() happy return cache; } @@ -1366,7 +1363,7 @@ Item *Item::const_charset_converter(THD *thd, CHARSET_INFO *tocs, const char *func_name) { DBUG_ASSERT(const_item()); - DBUG_ASSERT(fixed); + DBUG_ASSERT(is_fixed()); StringBuffer<64>tmp; String *s= val_str(&tmp); MEM_ROOT *mem_root= thd->mem_root; @@ -1676,7 +1673,7 @@ Query_fragment::Query_fragment(THD *thd, sp_head *sphead, *****************************************************************************/ Item_sp_variable::Item_sp_variable(THD *thd, const LEX_CSTRING *sp_var_name) - :Item(thd), m_thd(0), m_name(*sp_var_name) + :Item_fixed_hybrid(thd), m_thd(0), m_name(*sp_var_name) #ifndef DBUG_OFF , m_sp(0) #endif @@ -1688,7 +1685,7 @@ bool Item_sp_variable::fix_fields_from_item(THD *thd, Item **, const Item *it) { m_thd= thd; /* NOTE: this must be set before any this_xxx() */ - DBUG_ASSERT(it->fixed); + DBUG_ASSERT(it->is_fixed()); max_length= it->max_length; decimals= it->decimals; @@ -2165,7 +2162,7 @@ bool Item_name_const::is_null() Item_name_const::Item_name_const(THD *thd, Item *name_arg, Item *val): - Item(thd), value_item(val), name_item(name_arg) + Item_fixed_hybrid(thd), value_item(val), name_item(name_arg) { Item::maybe_null= TRUE; valid_args= true; @@ -2737,7 +2734,7 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll, else thd->change_item_tree(arg, conv); - if (conv->fix_fields(thd, arg)) + if (conv->fix_fields_if_needed(thd, arg)) { res= TRUE; break; // we cannot return here, we need to restore "arena". @@ -3653,7 +3650,6 @@ Item_int::Item_int(THD *thd, const char *str_arg, size_t length): the field name. */ name.length= !str_arg[max_length] ? max_length : strlen(str_arg); - fixed= 1; } @@ -3665,8 +3661,6 @@ my_decimal *Item_int::val_decimal(my_decimal *decimal_value) String *Item_int::val_str(String *str) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); str->set_int(value, unsigned_flag, collation.collation); return str; } @@ -3703,8 +3697,6 @@ Item_uint::Item_uint(THD *thd, const char *str_arg, longlong i, uint length): String *Item_uint::val_str(String *str) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); str->set((ulonglong) value, collation.collation); return str; } @@ -3726,7 +3718,6 @@ Item_decimal::Item_decimal(THD *thd, const char *str_arg, size_t length, name.str= str_arg; name.length= safe_strlen(str_arg); decimals= (uint8) decimal_value.frac; - fixed= 1; max_length= my_decimal_precision_to_length_no_truncation(decimal_value.intg + decimals, decimals, @@ -3738,7 +3729,6 @@ Item_decimal::Item_decimal(THD *thd, longlong val, bool unsig): { int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value); decimals= (uint8) decimal_value.frac; - fixed= 1; max_length= my_decimal_precision_to_length_no_truncation(decimal_value.intg + decimals, decimals, @@ -3751,7 +3741,6 @@ Item_decimal::Item_decimal(THD *thd, double val, int precision, int scale): { double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value); decimals= (uint8) decimal_value.frac; - fixed= 1; max_length= my_decimal_precision_to_length_no_truncation(decimal_value.intg + decimals, decimals, @@ -3768,7 +3757,6 @@ Item_decimal::Item_decimal(THD *thd, const char *str, const my_decimal *val_arg, name.length= safe_strlen(str); decimals= (uint8) decimal_par; max_length= length; - fixed= 1; } @@ -3777,7 +3765,6 @@ Item_decimal::Item_decimal(THD *thd, my_decimal *value_par): { my_decimal2decimal(value_par, &decimal_value); decimals= (uint8) decimal_value.frac; - fixed= 1; max_length= my_decimal_precision_to_length_no_truncation(decimal_value.intg + decimals, decimals, @@ -3791,7 +3778,6 @@ Item_decimal::Item_decimal(THD *thd, const uchar *bin, int precision, int scale) binary2my_decimal(E_DEC_FATAL_ERROR, bin, &decimal_value, precision, scale); decimals= (uint8) decimal_value.frac; - fixed= 1; max_length= my_decimal_precision_to_length_no_truncation(precision, decimals, unsigned_flag); } @@ -3864,8 +3850,6 @@ Item *Item_decimal::clone_item(THD *thd) String *Item_float::val_str(String *str) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); str->set_real(value, decimals, &my_charset_numeric); return str; } @@ -3873,8 +3857,6 @@ String *Item_float::val_str(String *str) my_decimal *Item_float::val_decimal(my_decimal *decimal_value) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); double2my_decimal(E_DEC_FATAL_ERROR, value, decimal_value); return (decimal_value); } @@ -3935,7 +3917,6 @@ void Item_string::print(String *str, enum_query_type query_type) double Item_string::val_real() { - DBUG_ASSERT(fixed == 1); return double_from_string_with_check(&str_value); } @@ -3946,7 +3927,6 @@ double Item_string::val_real() */ longlong Item_string::val_int() { - DBUG_ASSERT(fixed == 1); return longlong_from_string_with_check(&str_value); } @@ -3959,23 +3939,17 @@ my_decimal *Item_string::val_decimal(my_decimal *decimal_value) double Item_null::val_real() { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; } longlong Item_null::val_int() { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); null_value=1; return 0; } /* ARGSUSED */ String *Item_null::val_str(String *str) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); null_value=1; return 0; } @@ -3988,8 +3962,6 @@ my_decimal *Item_null::val_decimal(my_decimal *decimal_value) bool Item_null::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); make_zero_date(ltime, fuzzydate); return (null_value= true); } @@ -4393,7 +4365,6 @@ void Item_param::reset() state= NO_VALUE; maybe_null= 1; null_value= 0; - fixed= false; /* Don't reset item_type to PARAM_ITEM: it's only needed to guard us from item optimizations at prepare stage, when item doesn't yet @@ -4441,6 +4412,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions) bool Item_param::can_return_value() const { + DBUG_ASSERT(has_valid_state()); // There's no "default". See comments in Item_param::save_in_field(). switch (state) { case SHORT_DATA_VALUE: @@ -4724,7 +4696,7 @@ bool Item_param::convert_str_value(THD *thd) bool Item_param::basic_const_item() const { - DBUG_ASSERT(fixed || state == NO_VALUE); + DBUG_ASSERT(has_valid_state()); if (state == NO_VALUE || (state == SHORT_DATA_VALUE && type_handler()->cmp_type() == TIME_RESULT)) return FALSE; @@ -4889,7 +4861,6 @@ Item_param::set_param_type_and_swap_value(Item_param *src) maybe_null= src->maybe_null; null_value= src->null_value; state= src->state; - fixed= src->fixed; value.swap(src->value); } @@ -4899,7 +4870,6 @@ void Item_param::set_default() { m_is_settable_routine_parameter= false; state= DEFAULT_VALUE; - fixed= true; /* When Item_param is set to DEFAULT_VALUE: - its val_str() and val_decimal() return NULL @@ -4915,7 +4885,6 @@ void Item_param::set_ignore() { m_is_settable_routine_parameter= false; state= IGNORE_VALUE; - fixed= true; null_value= true; } @@ -5266,17 +5235,6 @@ void Item_copy_decimal::copy() Functions to convert item to field (for send_result_set_metadata) */ -/* ARGSUSED */ -bool Item::fix_fields(THD *thd, Item **ref) -{ - - // We do not check fields which are fixed during construction - DBUG_ASSERT(fixed == 0 || basic_const_item()); - fixed= 1; - return FALSE; -} - - void Item_ref_null_helper::save_val(Field *to) { DBUG_ASSERT(fixed == 1); @@ -5664,7 +5622,7 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select) ref->name.str, "forward reference in item list"); return NULL; } - DBUG_ASSERT((*select_ref)->fixed); + DBUG_ASSERT((*select_ref)->is_fixed()); return &select->ref_pointer_array[counter]; } if (group_by_ref) @@ -5941,7 +5899,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) return -1; /* Some error occurred (e.g. ambiguous names). */ if (ref != not_found_item) { - DBUG_ASSERT(*ref && (*ref)->fixed); + DBUG_ASSERT(*ref && (*ref)->is_fixed()); prev_subselect_item->used_tables_and_const_cache_join(*ref); break; } @@ -5983,7 +5941,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) Item_ref *rf; /* Should have been checked in resolve_ref_in_select_and_group(). */ - DBUG_ASSERT(*ref && (*ref)->fixed); + DBUG_ASSERT(*ref && (*ref)->is_fixed()); /* Here, a subset of actions performed by Item_ref::set_properties is not enough. So we pass ptr to NULL into Item_[direct]_ref @@ -7213,7 +7171,6 @@ Item_float::Item_float(THD *thd, const char *str_arg, size_t length): name.length= strlen(str_arg); decimals=(uint8) nr_of_decimals(str_arg, str_arg+length); max_length=(uint32)length; - fixed= 1; } @@ -7269,7 +7226,6 @@ void Item_hex_constant::hex_string_init(THD *thd, const char *str, size_t str_le } *ptr=0; // Keep purify happy collation.set(&my_charset_bin, DERIVATION_COERCIBLE); - fixed= 1; unsigned_flag= 1; } @@ -7348,7 +7304,6 @@ Item_bin_string::Item_bin_string(THD *thd, const char *str, size_t str_length): ptr[0]= 0; collation.set(&my_charset_bin, DERIVATION_COERCIBLE); - fixed= 1; } @@ -7379,7 +7334,6 @@ Item *Item_date_literal::clone_item(THD *thd) bool Item_date_literal::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { - DBUG_ASSERT(fixed); fuzzy_date |= sql_mode_for_dates(current_thd); *ltime= cached_time; return (null_value= check_date_with_warn(ltime, fuzzy_date, @@ -7405,7 +7359,6 @@ Item *Item_datetime_literal::clone_item(THD *thd) bool Item_datetime_literal::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { - DBUG_ASSERT(fixed); fuzzy_date |= sql_mode_for_dates(current_thd); *ltime= cached_time; return (null_value= check_date_with_warn(ltime, fuzzy_date, @@ -7431,7 +7384,6 @@ Item *Item_time_literal::clone_item(THD *thd) bool Item_time_literal::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { - DBUG_ASSERT(fixed); *ltime= cached_time; if (fuzzy_date & TIME_TIME_ONLY) return (null_value= false); @@ -8034,7 +7986,7 @@ Item_ref::Item_ref(THD *thd, Name_resolution_context *context_arg, /* This constructor used to create some internals references over fixed items */ - if ((set_properties_only= (ref && *ref && (*ref)->fixed))) + if ((set_properties_only= (ref && *ref && (*ref)->is_fixed()))) set_properties(); } @@ -8083,7 +8035,7 @@ Item_ref::Item_ref(THD *thd, TABLE_LIST *view_arg, Item **item, /* This constructor is used to create some internal references over fixed items */ - if ((set_properties_only= (ref && *ref && (*ref)->fixed))) + if ((set_properties_only= (ref && *ref && (*ref)->is_fixed()))) set_properties(); } @@ -8209,7 +8161,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) goto error; /* Some error occurred (e.g. ambiguous names). */ if (ref != not_found_item) { - DBUG_ASSERT(*ref && (*ref)->fixed); + DBUG_ASSERT(*ref && (*ref)->is_fixed()); prev_subselect_item->used_tables_and_const_cache_join(*ref); break; } @@ -8332,7 +8284,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) goto error; } /* Should be checked in resolve_ref_in_select_and_group(). */ - DBUG_ASSERT(*ref && (*ref)->fixed); + DBUG_ASSERT(*ref && (*ref)->is_fixed()); mark_as_dependent(thd, last_checked_context->select_lex, context->select_lex, this, this); /* @@ -8360,7 +8312,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) (((*ref)->with_sum_func && name.str && !(current_sel->linkage != GLOBAL_OPTIONS_TYPE && current_sel->having_fix_field)) || - !(*ref)->fixed)) + !(*ref)->is_fixed())) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name.str, ((*ref)->with_sum_func? @@ -8812,7 +8764,7 @@ Item_cache_wrapper::~Item_cache_wrapper() Item_cache_wrapper::Item_cache_wrapper(THD *thd, Item *item_arg): Item_result_field(thd), orig_item(item_arg), expr_cache(NULL), expr_value(NULL) { - DBUG_ASSERT(orig_item->fixed); + DBUG_ASSERT(orig_item->is_fixed()); Type_std_attributes::set(orig_item); maybe_null= orig_item->maybe_null; with_sum_func= orig_item->with_sum_func; @@ -8874,7 +8826,7 @@ void Item_cache_wrapper::print(String *str, enum_query_type query_type) bool Item_cache_wrapper::fix_fields(THD *thd __attribute__((unused)), Item **it __attribute__((unused))) { - DBUG_ASSERT(orig_item->fixed); + DBUG_ASSERT(orig_item->is_fixed()); DBUG_ASSERT(fixed); return FALSE; } @@ -9234,7 +9186,7 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference) /* view fild reference must be defined */ DBUG_ASSERT(*ref); /* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */ - if ((*ref)->fixed) + if ((*ref)->is_fixed()) { Item *ref_item= (*ref)->real_item(); if (ref_item->type() == Item::FIELD_ITEM) @@ -9520,7 +9472,6 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) if (arg->fix_fields_if_needed(thd, &arg)) goto error; - real_arg= arg->real_item(); if (real_arg->type() != FIELD_ITEM) { @@ -9736,7 +9687,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) { DBUG_ASSERT(fixed == 0); /* We should only check that arg is in first table */ - if (!arg->fixed) + if (!arg->is_fixed()) { bool res; TABLE_LIST *orig_next_table= context->last_name_resolution_table; @@ -9948,7 +9899,7 @@ void Item_trigger_field::cleanup() Since special nature of Item_trigger_field we should not do most of things from Item_field::cleanup() or Item_ident::cleanup() here. */ - Item::cleanup(); + Item_fixed_hybrid::cleanup(); } @@ -10138,7 +10089,6 @@ bool Item_cache_int::cache_value() String *Item_cache_int::val_str(String *str) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; str->set_int(value, unsigned_flag, default_charset()); @@ -10148,7 +10098,6 @@ String *Item_cache_int::val_str(String *str) my_decimal *Item_cache_int::val_decimal(my_decimal *decimal_val) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; int2my_decimal(E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_val); @@ -10157,7 +10106,6 @@ my_decimal *Item_cache_int::val_decimal(my_decimal *decimal_val) double Item_cache_int::val_real() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0.0; return (double) value; @@ -10165,7 +10113,6 @@ double Item_cache_int::val_real() longlong Item_cache_int::val_int() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0; return value; @@ -10207,7 +10154,6 @@ Item_cache_temporal::Item_cache_temporal(THD *thd, const Type_handler *handler) longlong Item_cache_temporal::val_datetime_packed() { - DBUG_ASSERT(fixed == 1); if (Item_cache_temporal::field_type() == MYSQL_TYPE_TIME) return Item::val_datetime_packed(); // TIME-to-DATETIME conversion needed if ((!value_cached && !cache_value()) || null_value) @@ -10221,7 +10167,6 @@ longlong Item_cache_temporal::val_datetime_packed() longlong Item_cache_temporal::val_time_packed() { - DBUG_ASSERT(fixed == 1); if (Item_cache_temporal::field_type() != MYSQL_TYPE_TIME) return Item::val_time_packed(); // DATETIME-to-TIME conversion needed if ((!value_cached && !cache_value()) || null_value) @@ -10235,7 +10180,6 @@ longlong Item_cache_temporal::val_time_packed() String *Item_cache_temporal::val_str(String *str) { - DBUG_ASSERT(fixed == 1); if (!has_value()) { null_value= true; @@ -10247,7 +10191,6 @@ String *Item_cache_temporal::val_str(String *str) my_decimal *Item_cache_temporal::val_decimal(my_decimal *decimal_value) { - DBUG_ASSERT(fixed == 1); if ((!value_cached && !cache_value()) || null_value) { null_value= true; @@ -10259,7 +10202,6 @@ my_decimal *Item_cache_temporal::val_decimal(my_decimal *decimal_value) longlong Item_cache_temporal::val_int() { - DBUG_ASSERT(fixed == 1); if ((!value_cached && !cache_value()) || null_value) { null_value= true; @@ -10271,7 +10213,6 @@ longlong Item_cache_temporal::val_int() double Item_cache_temporal::val_real() { - DBUG_ASSERT(fixed == 1); if ((!value_cached && !cache_value()) || null_value) { null_value= true; @@ -10395,7 +10336,6 @@ bool Item_cache_real::cache_value() double Item_cache_real::val_real() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0.0; return value; @@ -10403,7 +10343,6 @@ double Item_cache_real::val_real() longlong Item_cache_real::val_int() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0; return (longlong) rint(value); @@ -10412,7 +10351,6 @@ longlong Item_cache_real::val_int() String* Item_cache_real::val_str(String *str) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; str->set_real(value, decimals, default_charset()); @@ -10422,7 +10360,6 @@ String* Item_cache_real::val_str(String *str) my_decimal *Item_cache_real::val_decimal(my_decimal *decimal_val) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; double2my_decimal(E_DEC_FATAL_ERROR, value, decimal_val); @@ -10457,7 +10394,6 @@ bool Item_cache_decimal::cache_value() double Item_cache_decimal::val_real() { - DBUG_ASSERT(fixed); double res; if (!has_value()) return 0.0; @@ -10467,7 +10403,6 @@ double Item_cache_decimal::val_real() longlong Item_cache_decimal::val_int() { - DBUG_ASSERT(fixed); longlong res; if (!has_value()) return 0; @@ -10477,7 +10412,6 @@ longlong Item_cache_decimal::val_int() String* Item_cache_decimal::val_str(String *str) { - DBUG_ASSERT(fixed); if (!has_value()) return NULL; my_decimal_round(E_DEC_FATAL_ERROR, &decimal_value, decimals, FALSE, @@ -10488,7 +10422,6 @@ String* Item_cache_decimal::val_str(String *str) my_decimal *Item_cache_decimal::val_decimal(my_decimal *val) { - DBUG_ASSERT(fixed); if (!has_value()) return NULL; return &decimal_value; @@ -10540,7 +10473,6 @@ bool Item_cache_str::cache_value() double Item_cache_str::val_real() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0.0; return value ? double_from_string_with_check(value) : 0.0; @@ -10549,7 +10481,6 @@ double Item_cache_str::val_real() longlong Item_cache_str::val_int() { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0; return value ? longlong_from_string_with_check(value) : 0; @@ -10558,7 +10489,6 @@ longlong Item_cache_str::val_int() String* Item_cache_str::val_str(String *str) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return 0; return value; @@ -10567,7 +10497,6 @@ String* Item_cache_str::val_str(String *str) my_decimal *Item_cache_str::val_decimal(my_decimal *decimal_val) { - DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; return value ? decimal_from_string_with_check(decimal_val, value) : 0; @@ -10760,7 +10689,7 @@ bool Item_type_holder::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) void Item_result_field::cleanup() { DBUG_ENTER("Item_result_field::cleanup()"); - Item::cleanup(); + Item_fixed_hybrid::cleanup(); result_field= 0; DBUG_VOID_RETURN; } |