diff options
-rw-r--r-- | sql/event_parse_data.cc | 2 | ||||
-rw-r--r-- | sql/filesort.cc | 4 | ||||
-rw-r--r-- | sql/item.cc | 36 | ||||
-rw-r--r-- | sql/item.h | 26 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 8 | ||||
-rw-r--r-- | sql/item_func.cc | 22 | ||||
-rw-r--r-- | sql/item_func.h | 6 | ||||
-rw-r--r-- | sql/item_geofunc.h | 2 | ||||
-rw-r--r-- | sql/item_subselect.cc | 10 | ||||
-rw-r--r-- | sql/item_sum.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.h | 6 | ||||
-rw-r--r-- | sql/item_vers.cc | 2 | ||||
-rw-r--r-- | sql/item_vers.h | 2 | ||||
-rw-r--r-- | sql/opt_subselect.cc | 14 | ||||
-rw-r--r-- | sql/opt_table_elimination.cc | 2 | ||||
-rw-r--r-- | sql/sp_head.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 24 | ||||
-rw-r--r-- | sql/sql_signal.cc | 2 | ||||
-rw-r--r-- | sql/sql_tvc.cc | 2 | ||||
-rw-r--r-- | sql/sql_type.cc | 2 | ||||
-rw-r--r-- | sql/sql_union.cc | 4 | ||||
-rw-r--r-- | sql/table.cc | 10 |
23 files changed, 94 insertions, 98 deletions
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc index d2a168e538e..80d2f9c9fe4 100644 --- a/sql/event_parse_data.cc +++ b/sql/event_parse_data.cc @@ -480,7 +480,7 @@ Event_parse_data::report_bad_value(const char *item_name, Item *bad_item) { char buff[120]; String str(buff,(uint32) sizeof(buff), system_charset_info); - String *str2= bad_item->is_fixed() ? bad_item->val_str(&str) : NULL; + String *str2= bad_item->fixed() ? bad_item->val_str(&str) : NULL; my_error(ER_WRONG_VALUE, MYF(0), item_name, str2? str2->c_ptr_safe():"NULL"); } diff --git a/sql/filesort.cc b/sql/filesort.cc index 4d100980580..16ecb542ea1 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -936,10 +936,10 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, MY_BITMAP *tmp_read_set= sort_form->read_set; MY_BITMAP *tmp_write_set= sort_form->write_set; - if (select->cond->has_subquery()) + if (select->cond->with_subquery()) sort_form->column_bitmaps_set(save_read_set, save_write_set); write_record= (select->skip_record(thd) > 0); - if (select->cond->has_subquery()) + if (select->cond->with_subquery()) sort_form->column_bitmaps_set(tmp_read_set, tmp_write_set); } else diff --git a/sql/item.cc b/sql/item.cc index 37c3e0b817f..d4e41b0ca21 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -337,7 +337,7 @@ my_decimal *Item::val_decimal_from_real(my_decimal *decimal_value) my_decimal *Item::val_decimal_from_int(my_decimal *decimal_value) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); longlong nr= val_int(); if (null_value) return 0; @@ -566,7 +566,7 @@ void Item::cleanup() bool Item::cleanup_processor(void *arg) { - if (is_fixed()) + if (fixed()) cleanup(); return FALSE; } @@ -1115,7 +1115,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(is_fixed() || type() == REF_ITEM); + DBUG_ASSERT(fixed() || type() == REF_ITEM); const Type_handler *handler= type_handler(); if (handler->is_scalar_type()) return false; @@ -1314,7 +1314,7 @@ Item *Item::const_charset_converter(THD *thd, CHARSET_INFO *tocs, const char *func_name) { DBUG_ASSERT(const_item()); - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); StringBuffer<64>tmp; String *s= val_str(&tmp); MEM_ROOT *mem_root= thd->mem_root; @@ -1594,7 +1594,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->is_fixed()); + DBUG_ASSERT(it->fixed()); max_length= it->max_length; decimals= it->decimals; @@ -5392,7 +5392,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)->is_fixed()); + DBUG_ASSERT((*select_ref)->fixed()); return &select->ref_pointer_array[counter]; } if (group_by_ref) @@ -5672,7 +5672,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)->is_fixed()); + DBUG_ASSERT(*ref && (*ref)->fixed()); prev_subselect_item->used_tables_and_const_cache_join(*ref); break; } @@ -5715,7 +5715,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)->is_fixed()); + DBUG_ASSERT(*ref && (*ref)->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 @@ -7717,7 +7717,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)->is_fixed()))) + if ((set_properties_only= (ref && *ref && (*ref)->fixed()))) set_properties(); } @@ -7766,7 +7766,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)->is_fixed()))) + if ((set_properties_only= (ref && *ref && (*ref)->fixed()))) set_properties(); } @@ -7892,7 +7892,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)->is_fixed()); + DBUG_ASSERT(*ref && (*ref)->fixed()); prev_subselect_item->used_tables_and_const_cache_join(*ref); break; } @@ -8016,7 +8016,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)->is_fixed()); + DBUG_ASSERT(*ref && (*ref)->fixed()); mark_as_dependent(thd, last_checked_context->select_lex, context->select_lex, this, this, false); /* @@ -8044,7 +8044,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) (((*ref)->with_sum_func() && name.str && !(current_sel->get_linkage() != GLOBAL_OPTIONS_TYPE && current_sel->having_fix_field)) || - !(*ref)->is_fixed())) + !(*ref)->fixed())) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name.str, ((*ref)->with_sum_func() ? @@ -8560,7 +8560,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->is_fixed()); + DBUG_ASSERT(orig_item->fixed()); Type_std_attributes::set(orig_item); flags|= ITEM_FLAG_FIXED | @@ -8624,7 +8624,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->is_fixed()); + DBUG_ASSERT(orig_item->fixed()); DBUG_ASSERT(fixed()); return FALSE; } @@ -9007,7 +9007,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)->is_fixed()) + if ((*ref)->fixed()) { Item *ref_item= (*ref)->real_item(); if (ref_item->type() == Item::FIELD_ITEM) @@ -9609,7 +9609,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->is_fixed()) + if (!arg->fixed()) { bool res; TABLE_LIST *orig_next_table= context->last_name_resolution_table; @@ -10129,7 +10129,7 @@ bool Item_cache_timestamp::val_native(THD *thd, Native *to) Datetime Item_cache_timestamp::to_datetime(THD *thd) { - DBUG_ASSERT(is_fixed() == 1); + DBUG_ASSERT(fixed() == 1); if (!has_value()) { null_value= true; diff --git a/sql/item.h b/sql/item.h index 6c590ace6d4..fef5b2d2e04 100644 --- a/sql/item.h +++ b/sql/item.h @@ -812,7 +812,7 @@ protected: */ Field *tmp_table_field_from_field_type(MEM_ROOT *root, TABLE *table) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); const Type_handler *h= type_handler()->type_handler_for_tmp_table(this); return h->make_and_init_table_field(root, &name, Record_addr(maybe_null()), @@ -852,21 +852,21 @@ protected: /* Helper methods, to get an Item value from another Item */ double val_real_from_item(Item *item) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); double value= item->val_real(); null_value= item->null_value; return value; } longlong val_int_from_item(Item *item) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); longlong value= item->val_int(); null_value= item->null_value; return value; } String *val_str_from_item(Item *item, String *str) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); String *res= item->val_str(str); if (res) res->set_charset(collation.collation); @@ -876,7 +876,7 @@ protected: } bool val_native_from_item(THD *thd, Item *item, Native *to) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); null_value= item->val_native(thd, to); DBUG_ASSERT(null_value == item->null_value); return null_value; @@ -890,12 +890,12 @@ protected: bool val_native_with_conversion_from_item(THD *thd, Item *item, Native *to, const Type_handler *handler) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); return (null_value= item->val_native_with_conversion(thd, to, handler)); } my_decimal *val_decimal_from_item(Item *item, my_decimal *decimal_value) { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); my_decimal *value= item->val_decimal(decimal_value); if ((null_value= item->null_value)) value= NULL; @@ -973,7 +973,6 @@ public: inline bool with_window_func() const { return (flags & ITEM_FLAG_WITH_WINDOW_FUNC); } inline bool with_field() const { return (flags & ITEM_FLAG_WITH_FIELD); } inline bool fixed() const { return (flags & ITEM_FLAG_FIXED); } - inline bool is_fixed() const { return fixed(); } /* Legacy function */ inline bool is_autogenerated_name() const { return (flags & ITEM_FLAG_IS_AUTOGENERATED_NAME); } inline bool is_in_with_cycle() const { return (flags & ITEM_FLAG_IS_IN_WITH_CYCLE); } inline bool with_sum_func() const { return (flags & ITEM_FLAG_WITH_SUM_FUNC); } @@ -1046,11 +1045,11 @@ public: { /* This should not normally be called, because usually before - fix_fields() we check is_fixed() to be false. + fix_fields() we check fixed() to be false. But historically we allow fix_fields() to be called for Items who return basic_const_item()==true. */ - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); DBUG_ASSERT(basic_const_item()); return false; } @@ -1563,7 +1562,7 @@ public: my_decimal *val_decimal_from_string(my_decimal *decimal_value); longlong val_int_from_real() { - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(fixed()); return Converter_double_to_longlong_with_warn(val_real(), false).result(); } longlong val_int_from_str(int *error); @@ -2440,10 +2439,7 @@ public: /* Return TRUE if the item points to a column of an outer-joined table. */ - virtual bool is_outer_field() const { DBUG_ASSERT(is_fixed()); return FALSE; } - - /** Checks if this item or any of its decendents contains a subquery */ - bool has_subquery() const { DBUG_ASSERT(is_fixed()); return with_subquery(); } + virtual bool is_outer_field() const { DBUG_ASSERT(fixed()); return FALSE; } Item* set_expr_cache(THD *thd); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 972ebb44054..56b8791dabf 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4731,7 +4731,7 @@ class Func_handler_bit_or_int_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); Longlong_null a= item->arguments()[0]->to_longlong_null(); return a.is_null() ? a : a | item->arguments()[1]->to_longlong_null(); } @@ -4744,7 +4744,7 @@ class Func_handler_bit_or_dec_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); VDec a(item->arguments()[0]); return a.is_null() ? Longlong_null() : a.to_xlonglong_null() | VDec(item->arguments()[1]).to_xlonglong_null(); @@ -4766,7 +4766,7 @@ class Func_handler_bit_and_int_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); Longlong_null a= item->arguments()[0]->to_longlong_null(); return a.is_null() ? a : a & item->arguments()[1]->to_longlong_null(); } @@ -4779,7 +4779,7 @@ class Func_handler_bit_and_dec_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); VDec a(item->arguments()[0]); return a.is_null() ? Longlong_null() : a.to_xlonglong_null() & VDec(item->arguments()[1]).to_xlonglong_null(); diff --git a/sql/item_func.cc b/sql/item_func.cc index f22544d8334..67251b73faf 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -375,7 +375,7 @@ Item_func::quick_fix_field() { for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++) { - if (!(*arg)->is_fixed()) + if (!(*arg)->fixed()) (*arg)->quick_fix_field(); } } @@ -2167,7 +2167,7 @@ class Func_handler_shift_left_int_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null() << item->arguments()[1]->to_longlong_null(); } @@ -2180,7 +2180,7 @@ class Func_handler_shift_left_decimal_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() << item->arguments()[1]->to_longlong_null(); } @@ -2214,7 +2214,7 @@ class Func_handler_shift_right_decimal_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() >> item->arguments()[1]->to_longlong_null(); } @@ -2235,7 +2235,7 @@ class Func_handler_bit_neg_int_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return ~ item->arguments()[0]->to_longlong_null(); } }; @@ -2247,7 +2247,7 @@ class Func_handler_bit_neg_decimal_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return ~ VDec(item->arguments()[0]).to_xlonglong_null(); } }; @@ -3400,7 +3400,7 @@ class Func_handler_bit_count_int_to_slong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null().bit_count(); } }; @@ -3412,7 +3412,7 @@ class Func_handler_bit_count_decimal_to_slong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null().bit_count(); } }; @@ -5748,7 +5748,7 @@ bool Item_func_get_user_var::set_value(THD *thd, bool Item_user_var_as_out_param::fix_fields(THD *thd, Item **ref) { - DBUG_ASSERT(!is_fixed()); + DBUG_ASSERT(!fixed()); DBUG_ASSERT(thd->lex->exchange); if (!(entry= get_variable(&thd->user_vars, &org_name, 1))) return TRUE; @@ -6453,7 +6453,7 @@ class Func_handler_bit_xor_int_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null() ^ item->arguments()[1]->to_longlong_null(); } @@ -6466,7 +6466,7 @@ class Func_handler_bit_xor_dec_to_ulonglong: public: Longlong_null to_longlong_null(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() ^ VDec(item->arguments()[1]).to_xlonglong_null(); } diff --git a/sql/item_func.h b/sql/item_func.h index 7bef1f0d3dd..bac2b8d0f94 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -343,7 +343,7 @@ public: bool excl_dep_on_grouping_fields(st_select_lex *sel) { - if (has_rand_bit() || has_subquery()) + if (has_rand_bit() || with_subquery()) return false; return Item_args::excl_dep_on_grouping_fields(sel); } @@ -509,14 +509,14 @@ public: } double val_real(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); StringBuffer<64> tmp; String *res= item->val_str(&tmp); return res ? item->double_from_string_with_check(res) : 0.0; } longlong val_int(Item_handled_func *item) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); StringBuffer<22> tmp; String *res= item->val_str(&tmp); return res ? item->longlong_from_string_with_check(res) : 0; diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index d351b66ff50..bafd666789e 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -535,7 +535,7 @@ public: return TRUE; for (unsigned int i= 0; i < arg_count; ++i) { - if (args[i]->is_fixed() && args[i]->field_type() != MYSQL_TYPE_GEOMETRY) + if (args[i]->fixed() && args[i]->field_type() != MYSQL_TYPE_GEOMETRY) { String str; args[i]->print(&str, QT_NO_DATA_EXPANSION); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index d64f93e917c..bab4ed9b94b 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2226,7 +2226,7 @@ bool Item_in_subselect::fix_having(Item *having, SELECT_LEX *select_lex) { bool fix_res= 0; DBUG_ASSERT(thd); - if (!having->is_fixed()) + if (!having->fixed()) { select_lex->having_fix_field= 1; fix_res= having->fix_fields(thd, 0); @@ -2566,9 +2566,9 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, Item *item_having_part2= 0; for (uint i= 0; i < cols_num; i++) { - DBUG_ASSERT((left_expr->is_fixed() && + DBUG_ASSERT((left_expr->fixed() && - select_lex->ref_pointer_array[i]->is_fixed()) || + select_lex->ref_pointer_array[i]->fixed()) || (select_lex->ref_pointer_array[i]->type() == REF_ITEM && ((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() == Item_ref::OUTER_REF)); @@ -2637,8 +2637,8 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, for (uint i= 0; i < cols_num; i++) { Item *item, *item_isnull; - DBUG_ASSERT((left_expr->is_fixed() && - select_lex->ref_pointer_array[i]->is_fixed()) || + DBUG_ASSERT((left_expr->fixed() && + select_lex->ref_pointer_array[i]->fixed()) || (select_lex->ref_pointer_array[i]->type() == REF_ITEM && ((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() == Item_ref::OUTER_REF)); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e86327e22e5..a3d15db4e5e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -895,7 +895,7 @@ bool Aggregator_distinct::setup(THD *thd) item_sum->flags|= ITEM_FLAG_MAYBE_NULL; item_sum->quick_group= 0; - DBUG_ASSERT(item_sum->get_arg(0)->is_fixed()); + DBUG_ASSERT(item_sum->get_arg(0)->fixed()); arg= item_sum->get_arg(0); if (arg->const_item()) diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 83ed1ea5e8c..26501dbd077 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -1591,7 +1591,7 @@ public: bool get_date(THD *thd, Item_handled_func *item, MYSQL_TIME *to, date_mode_t fuzzy) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); Datetime::Options opt(TIME_CONV_NONE, thd); Datetime dt(thd, item->arguments()[0], opt); if (!dt.is_valid_datetime()) @@ -1625,7 +1625,7 @@ public: bool get_date(THD *thd, Item_handled_func *item, MYSQL_TIME *to, date_mode_t fuzzy) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); Time t(thd, item->arguments()[0]); if (!t.is_valid_time()) return (item->null_value= true); @@ -1662,7 +1662,7 @@ public: bool get_date(THD *thd, Item_handled_func *item, MYSQL_TIME *to, date_mode_t fuzzy) const { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); // Detect a proper timestamp type based on the argument values Temporal_hybrid l_time1(thd, item->arguments()[0], Temporal::Options(TIME_TIME_ONLY, thd)); diff --git a/sql/item_vers.cc b/sql/item_vers.cc index aa505f2111d..c431cfb3c4e 100644 --- a/sql/item_vers.cc +++ b/sql/item_vers.cc @@ -29,7 +29,7 @@ bool Item_func_history::val_bool() { Item_field *f= static_cast<Item_field *>(args[0]); - DBUG_ASSERT(is_fixed()); + DBUG_ASSERT(f->fixed()); DBUG_ASSERT(f->field->flags & VERS_SYS_END_FLAG); return !f->field->is_max(); } diff --git a/sql/item_vers.h b/sql/item_vers.h index 99cc4e2d024..2981c56aac1 100644 --- a/sql/item_vers.h +++ b/sql/item_vers.h @@ -40,7 +40,7 @@ public: } bool fix_length_and_dec() { - set_maybe_null(0); + flags|= ITEM_FLAG_MAYBE_NULL; null_value= 0; decimals= 0; max_length= 1; diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index ec1954bd3bd..b850e88ac6d 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -852,7 +852,7 @@ bool subquery_types_allow_materialization(THD* thd, Item_in_subselect *in_subs) Item *left_exp= in_subs->left_exp(); DBUG_ENTER("subquery_types_allow_materialization"); - DBUG_ASSERT(left_exp->is_fixed()); + DBUG_ASSERT(left_exp->fixed()); List_iterator<Item> it(in_subs->unit->first_select()->item_list); uint elements= in_subs->unit->first_select()->item_list.elements; @@ -955,7 +955,7 @@ bool make_in_exists_conversion(THD *thd, JOIN *join, Item_in_subselect *item) /* We're going to finalize IN->EXISTS conversion. Normally, IN->EXISTS conversion takes place inside the - Item_subselect::fix_fields() call, where item_subselect->is_fixed()==FALSE (as + Item_subselect::fix_fields() call, where item_subselect->fixed()==FALSE (as fix_fields() haven't finished yet) and item_subselect->changed==FALSE (as the conversion haven't been finalized) @@ -982,7 +982,7 @@ bool make_in_exists_conversion(THD *thd, JOIN *join, Item_in_subselect *item) DBUG_ASSERT(item->fixed()); Item *substitute= item->substitution; - bool do_fix_fields= !item->substitution->is_fixed(); + bool do_fix_fields= !item->substitution->fixed(); /* The Item_subselect has already been wrapped with Item_in_optimizer, so we should search for item->optimizer, not 'item'. @@ -1334,7 +1334,7 @@ bool convert_join_subqueries_to_semijoins(JOIN *join) DBUG_ASSERT(in_subq->fixed()); Item *substitute= in_subq->substitution; - bool do_fix_fields= !in_subq->substitution->is_fixed(); + bool do_fix_fields= !in_subq->substitution->fixed(); Item **tree= (in_subq->emb_on_expr_nest == NO_JOIN_NEST)? &join->conds : &(in_subq->emb_on_expr_nest->on_expr); Item *replace_me= in_subq->original_item(); @@ -1885,7 +1885,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) subq_lex->ref_pointer_array[i]); if (!item_eq) DBUG_RETURN(TRUE); - DBUG_ASSERT(left_exp->element_index(i)->is_fixed()); + DBUG_ASSERT(left_exp->element_index(i)->fixed()); if (left_exp_orig->element_index(i) != left_exp->element_index(i)) thd->change_item_tree(item_eq->arguments(), @@ -6440,8 +6440,8 @@ bool JOIN::choose_subquery_plan(table_map join_tables) /* A strategy must be chosen earlier. */ DBUG_ASSERT(in_subs->has_strategy()); DBUG_ASSERT(in_to_exists_where || in_to_exists_having); - DBUG_ASSERT(!in_to_exists_where || in_to_exists_where->is_fixed()); - DBUG_ASSERT(!in_to_exists_having || in_to_exists_having->is_fixed()); + DBUG_ASSERT(!in_to_exists_where || in_to_exists_where->fixed()); + DBUG_ASSERT(!in_to_exists_having || in_to_exists_having->fixed()); /* The original QEP of the subquery. */ Join_plan_state save_qep(table_count); diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index d5d60f8c0aa..a6f0ac24719 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -628,7 +628,7 @@ void eliminate_tables(JOIN *join) List_iterator<Item> val_it(thd->lex->value_list); while ((item= val_it++)) { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); used_tables |= item->used_tables(); } } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 50670c126f2..980bf4eaf10 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2077,7 +2077,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, for (arg_no= 0; arg_no < argcount; arg_no++) { /* Arguments must be fixed in Item_func_sp::fix_fields */ - DBUG_ASSERT(argp[arg_no]->is_fixed()); + DBUG_ASSERT(argp[arg_no]->fixed()); if ((err_status= (*func_ctx)->set_parameter(thd, arg_no, &(argp[arg_no])))) goto err_with_cleanup; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index b35c8fe21db..c7f741793ec 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -9014,7 +9014,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order) Item_func_match *ifm; while ((ifm=li++)) - if (unlikely(!ifm->is_fixed())) + if (unlikely(!ifm->fixed())) /* it mean that clause where was FT function was removed, so we have to remove the function from the list. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fa20e2a8d0d..0a7a981a73e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1963,7 +1963,7 @@ JOIN::optimize_inner() { /* Item_cond_and can't be fixed after creation, so we do not check - conds->is_fixed() + conds->fixed() */ conds->fix_fields(thd, &conds); conds->change_ref_to_fields(thd, tables_list); @@ -2016,10 +2016,10 @@ JOIN::optimize_inner() if (optimize_constant_subqueries()) DBUG_RETURN(1); - if (conds && conds->has_subquery()) + if (conds && conds->with_subquery()) (void) conds->walk(&Item::cleanup_is_expensive_cache_processor, 0, (void *) 0); - if (having && having->has_subquery()) + if (having && having->with_subquery()) (void) having->walk(&Item::cleanup_is_expensive_cache_processor, 0, (void *) 0); @@ -11906,7 +11906,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) Yet attributes of the just built condition are not needed. Thus we call sel->cond->quick_fix_field for safety. */ - if (sel->cond && !sel->cond->is_fixed()) + if (sel->cond && !sel->cond->fixed()) sel->cond->quick_fix_field(); if (sel->test_quick_select(thd, tab->keys, @@ -13834,7 +13834,7 @@ bool JOIN_TAB::pfs_batch_update(JOIN *join) return join->join_tab + join->table_count - 1 == this && // 1 type != JT_EQ_REF && type != JT_CONST && type != JT_SYSTEM && // 2 - (!select_cond || !select_cond->has_subquery()); // 3 + (!select_cond || !select_cond->with_subquery()); // 3 } @@ -14415,7 +14415,7 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, *simple_order=0; // Must do a temp table to sort else if (!(order_tables & not_const_tables)) { - if (order->item[0]->has_subquery()) + if (order->item[0]->with_subquery()) { /* Delay the evaluation of constant ORDER and/or GROUP expressions that @@ -16679,7 +16679,7 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top, conds= and_conds(join->thd, conds, table->on_expr); conds->top_level_item(); /* conds is always a new item as both cond and on_expr existed */ - DBUG_ASSERT(!conds->is_fixed()); + DBUG_ASSERT(!conds->fixed()); conds->fix_fields(join->thd, &conds); } else @@ -17882,7 +17882,7 @@ Item_func_isnull::remove_eq_conds(THD *thd, Item::cond_result *cond_value, cond= new_cond; /* Item_func_eq can't be fixed after creation so we do not check - cond->is_fixed(), also it do not need tables so we use 0 as second + cond->fixed(), also it do not need tables so we use 0 as second argument. */ cond->fix_fields(thd, &cond); @@ -19594,7 +19594,7 @@ bool Virtual_tmp_table::sp_set_all_fields_from_item_list(THD *thd, bool Virtual_tmp_table::sp_set_all_fields_from_item(THD *thd, Item *value) { - DBUG_ASSERT(value->is_fixed()); + DBUG_ASSERT(value->fixed()); DBUG_ASSERT(value->cols() == s->fields); for (uint i= 0; i < value->cols(); i++) { @@ -24726,7 +24726,7 @@ find_order_in_list(THD *thd, Ref_ptr_array ref_pointer_array, inspite of that fix_fields() calls find_item_in_list() one more time. - We check order_item->is_fixed() because Item_func_group_concat can put + We check order_item->fixed() because Item_func_group_concat can put arguments for which fix_fields already was called. */ if (order_item->fix_fields_if_needed_for_order_by(thd, order->item) || @@ -26061,7 +26061,7 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab) } if (unlikely(thd->is_fatal_error)) DBUG_RETURN(TRUE); - if (!cond->is_fixed()) + if (!cond->fixed()) { Item *tmp_item= (Item*) cond; cond->fix_fields(thd, &tmp_item); @@ -27474,7 +27474,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, for such queries, we'll get here before having called subquery_expr->fix_fields(), which will cause failure to */ - if (unit->item && !unit->item->is_fixed()) + if (unit->item && !unit->item->fixed()) { Item *ref= unit->item; if (unit->item->fix_fields(thd, &ref)) diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc index 115f5fa4347..8e973f9b0b3 100644 --- a/sql/sql_signal.cc +++ b/sql/sql_signal.cc @@ -324,7 +324,7 @@ end: set= m_set_signal_information.m_item[i]; if (set) { - if (set->is_fixed()) + if (set->fixed()) set->cleanup(); } } diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index cfd46336d07..52bb1b99be5 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -212,7 +212,7 @@ bool get_type_attributes_for_tvc(THD *thd, Item *item; for (uint holder_pos= 0 ; (item= it++); holder_pos++) { - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); holders[holder_pos].add_argument(item); } } diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 7c60bf09ae9..760dc5ed68f 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -7059,7 +7059,7 @@ Item_temporal_precision(THD *thd, Item *item, bool is_time) const StringBuffer<64> buf; String *tmp; MYSQL_TIME_STATUS status; - DBUG_ASSERT(item->is_fixed()); + DBUG_ASSERT(item->fixed()); // Nanosecond rounding is not needed here, for performance purposes if ((tmp= item->val_str(&buf)) && (is_time ? diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 2049dfe3ea1..c76dea02196 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1184,11 +1184,11 @@ bool st_select_lex_unit::join_union_type_attributes(THD *thd_arg, been fixed yet. An Item_type_holder must be created based on a fixed Item, so use the inner Item instead. */ - DBUG_ASSERT(item_tmp->is_fixed() || + DBUG_ASSERT(item_tmp->fixed() || (item_tmp->type() == Item::REF_ITEM && ((Item_ref *)(item_tmp))->ref_type() == Item_ref::OUTER_REF)); - if (!item_tmp->is_fixed()) + if (!item_tmp->fixed()) item_tmp= item_tmp->real_item(); holders[holder_pos].add_argument(item_tmp); } diff --git a/sql/table.cc b/sql/table.cc index 91009d9f3ec..39b8a8f1900 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3605,7 +3605,7 @@ bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol) DBUG_RETURN(0); vcol->expr->walk(&Item::cleanup_excluding_fields_processor, 0, 0); - DBUG_ASSERT(!vcol->expr->is_fixed()); + DBUG_ASSERT(!vcol->expr->fixed()); DBUG_RETURN(fix_vcol_expr(thd, vcol)); } @@ -3660,7 +3660,7 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, DBUG_PRINT("info", ("vcol: %p", vcol)); DBUG_ASSERT(func_expr); - if (func_expr->is_fixed()) + if (func_expr->fixed()) DBUG_RETURN(0); // nothing to do if (fix_vcol_expr(thd, vcol)) @@ -5792,7 +5792,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds, if (where) { - if (where->is_fixed()) + if (where->fixed()) where->update_used_tables(); else if (where->fix_fields(thd, &where)) DBUG_RETURN(TRUE); @@ -6821,13 +6821,13 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, ('mysql_schema_table' function). So we can return directly the field. This case happens only for 'show & where' commands. */ - DBUG_ASSERT(field && field->is_fixed()); + DBUG_ASSERT(field && field->fixed()); DBUG_RETURN(field); } DBUG_ASSERT(field); thd->lex->current_select->no_wrap_view_item= TRUE; - if (!field->is_fixed()) + if (!field->fixed()) { if (field->fix_fields(thd, field_ref)) { |