Removed Item::is_fixed() and Item::has_subquery()
One should instead use Item::fixed() and Item::with_subquery() Removed Item::is_fixed() and has_subquery() and did the following replace: replace is_fixed() fixed() -- *.* replace 'has_subquery()' 'with_subquery()' -- *.*
This commit is contained in:
parent
9448548481
commit
7ca4e381f7
@ -480,7 +480,7 @@ Event_parse_data::report_bad_value(const char *item_name, Item *bad_item)
|
|||||||
{
|
{
|
||||||
char buff[120];
|
char buff[120];
|
||||||
String str(buff,(uint32) sizeof(buff), system_charset_info);
|
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");
|
my_error(ER_WRONG_VALUE, MYF(0), item_name, str2? str2->c_ptr_safe():"NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_read_set= sort_form->read_set;
|
||||||
MY_BITMAP *tmp_write_set= sort_form->write_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);
|
sort_form->column_bitmaps_set(save_read_set, save_write_set);
|
||||||
write_record= (select->skip_record(thd) > 0);
|
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);
|
sort_form->column_bitmaps_set(tmp_read_set, tmp_write_set);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
36
sql/item.cc
36
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)
|
my_decimal *Item::val_decimal_from_int(my_decimal *decimal_value)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
longlong nr= val_int();
|
longlong nr= val_int();
|
||||||
if (null_value)
|
if (null_value)
|
||||||
return 0;
|
return 0;
|
||||||
@ -566,7 +566,7 @@ void Item::cleanup()
|
|||||||
|
|
||||||
bool Item::cleanup_processor(void *arg)
|
bool Item::cleanup_processor(void *arg)
|
||||||
{
|
{
|
||||||
if (is_fixed())
|
if (fixed())
|
||||||
cleanup();
|
cleanup();
|
||||||
return FALSE;
|
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.
|
This hack in Item_outer_ref should probably be refactored eventually.
|
||||||
Discuss with Sanja.
|
Discuss with Sanja.
|
||||||
*/
|
*/
|
||||||
DBUG_ASSERT(is_fixed() || type() == REF_ITEM);
|
DBUG_ASSERT(fixed() || type() == REF_ITEM);
|
||||||
const Type_handler *handler= type_handler();
|
const Type_handler *handler= type_handler();
|
||||||
if (handler->is_scalar_type())
|
if (handler->is_scalar_type())
|
||||||
return false;
|
return false;
|
||||||
@ -1314,7 +1314,7 @@ Item *Item::const_charset_converter(THD *thd, CHARSET_INFO *tocs,
|
|||||||
const char *func_name)
|
const char *func_name)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(const_item());
|
DBUG_ASSERT(const_item());
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
StringBuffer<64>tmp;
|
StringBuffer<64>tmp;
|
||||||
String *s= val_str(&tmp);
|
String *s= val_str(&tmp);
|
||||||
MEM_ROOT *mem_root= thd->mem_root;
|
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() */
|
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;
|
max_length= it->max_length;
|
||||||
decimals= it->decimals;
|
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");
|
ref->name.str, "forward reference in item list");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
DBUG_ASSERT((*select_ref)->is_fixed());
|
DBUG_ASSERT((*select_ref)->fixed());
|
||||||
return &select->ref_pointer_array[counter];
|
return &select->ref_pointer_array[counter];
|
||||||
}
|
}
|
||||||
if (group_by_ref)
|
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). */
|
return -1; /* Some error occurred (e.g. ambiguous names). */
|
||||||
if (ref != not_found_item)
|
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);
|
prev_subselect_item->used_tables_and_const_cache_join(*ref);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5715,7 +5715,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
Item_ref *rf;
|
Item_ref *rf;
|
||||||
|
|
||||||
/* Should have been checked in resolve_ref_in_select_and_group(). */
|
/* 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
|
Here, a subset of actions performed by Item_ref::set_properties
|
||||||
is not enough. So we pass ptr to NULL into Item_[direct]_ref
|
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
|
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();
|
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
|
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();
|
set_properties();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7892,7 +7892,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
goto error; /* Some error occurred (e.g. ambiguous names). */
|
goto error; /* Some error occurred (e.g. ambiguous names). */
|
||||||
if (ref != not_found_item)
|
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);
|
prev_subselect_item->used_tables_and_const_cache_join(*ref);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -8016,7 +8016,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
/* Should be checked in resolve_ref_in_select_and_group(). */
|
/* 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,
|
mark_as_dependent(thd, last_checked_context->select_lex,
|
||||||
context->select_lex, this, this, false);
|
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 &&
|
(((*ref)->with_sum_func() && name.str &&
|
||||||
!(current_sel->get_linkage() != GLOBAL_OPTIONS_TYPE &&
|
!(current_sel->get_linkage() != GLOBAL_OPTIONS_TYPE &&
|
||||||
current_sel->having_fix_field)) ||
|
current_sel->having_fix_field)) ||
|
||||||
!(*ref)->is_fixed()))
|
!(*ref)->fixed()))
|
||||||
{
|
{
|
||||||
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
|
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
|
||||||
name.str, ((*ref)->with_sum_func() ?
|
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_cache_wrapper::Item_cache_wrapper(THD *thd, Item *item_arg):
|
||||||
Item_result_field(thd), orig_item(item_arg), expr_cache(NULL), expr_value(NULL)
|
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);
|
Type_std_attributes::set(orig_item);
|
||||||
|
|
||||||
flags|= ITEM_FLAG_FIXED |
|
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)),
|
bool Item_cache_wrapper::fix_fields(THD *thd __attribute__((unused)),
|
||||||
Item **it __attribute__((unused)))
|
Item **it __attribute__((unused)))
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(orig_item->is_fixed());
|
DBUG_ASSERT(orig_item->fixed());
|
||||||
DBUG_ASSERT(fixed());
|
DBUG_ASSERT(fixed());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -9007,7 +9007,7 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
/* view fild reference must be defined */
|
/* view fild reference must be defined */
|
||||||
DBUG_ASSERT(*ref);
|
DBUG_ASSERT(*ref);
|
||||||
/* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */
|
/* (*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();
|
Item *ref_item= (*ref)->real_item();
|
||||||
if (ref_item->type() == Item::FIELD_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);
|
DBUG_ASSERT(fixed() == 0);
|
||||||
/* We should only check that arg is in first table */
|
/* We should only check that arg is in first table */
|
||||||
if (!arg->is_fixed())
|
if (!arg->fixed())
|
||||||
{
|
{
|
||||||
bool res;
|
bool res;
|
||||||
TABLE_LIST *orig_next_table= context->last_name_resolution_table;
|
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)
|
Datetime Item_cache_timestamp::to_datetime(THD *thd)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed() == 1);
|
DBUG_ASSERT(fixed() == 1);
|
||||||
if (!has_value())
|
if (!has_value())
|
||||||
{
|
{
|
||||||
null_value= true;
|
null_value= true;
|
||||||
|
26
sql/item.h
26
sql/item.h
@ -812,7 +812,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
Field *tmp_table_field_from_field_type(MEM_ROOT *root, TABLE *table)
|
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);
|
const Type_handler *h= type_handler()->type_handler_for_tmp_table(this);
|
||||||
return h->make_and_init_table_field(root, &name,
|
return h->make_and_init_table_field(root, &name,
|
||||||
Record_addr(maybe_null()),
|
Record_addr(maybe_null()),
|
||||||
@ -852,21 +852,21 @@ protected:
|
|||||||
/* Helper methods, to get an Item value from another Item */
|
/* Helper methods, to get an Item value from another Item */
|
||||||
double val_real_from_item(Item *item)
|
double val_real_from_item(Item *item)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
double value= item->val_real();
|
double value= item->val_real();
|
||||||
null_value= item->null_value;
|
null_value= item->null_value;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
longlong val_int_from_item(Item *item)
|
longlong val_int_from_item(Item *item)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
longlong value= item->val_int();
|
longlong value= item->val_int();
|
||||||
null_value= item->null_value;
|
null_value= item->null_value;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
String *val_str_from_item(Item *item, String *str)
|
String *val_str_from_item(Item *item, String *str)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
String *res= item->val_str(str);
|
String *res= item->val_str(str);
|
||||||
if (res)
|
if (res)
|
||||||
res->set_charset(collation.collation);
|
res->set_charset(collation.collation);
|
||||||
@ -876,7 +876,7 @@ protected:
|
|||||||
}
|
}
|
||||||
bool val_native_from_item(THD *thd, Item *item, Native *to)
|
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);
|
null_value= item->val_native(thd, to);
|
||||||
DBUG_ASSERT(null_value == item->null_value);
|
DBUG_ASSERT(null_value == item->null_value);
|
||||||
return null_value;
|
return null_value;
|
||||||
@ -890,12 +890,12 @@ protected:
|
|||||||
bool val_native_with_conversion_from_item(THD *thd, Item *item, Native *to,
|
bool val_native_with_conversion_from_item(THD *thd, Item *item, Native *to,
|
||||||
const Type_handler *handler)
|
const Type_handler *handler)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
return (null_value= item->val_native_with_conversion(thd, to, handler));
|
return (null_value= item->val_native_with_conversion(thd, to, handler));
|
||||||
}
|
}
|
||||||
my_decimal *val_decimal_from_item(Item *item, my_decimal *decimal_value)
|
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);
|
my_decimal *value= item->val_decimal(decimal_value);
|
||||||
if ((null_value= item->null_value))
|
if ((null_value= item->null_value))
|
||||||
value= NULL;
|
value= NULL;
|
||||||
@ -973,7 +973,6 @@ public:
|
|||||||
inline bool with_window_func() const { return (flags & ITEM_FLAG_WITH_WINDOW_FUNC); }
|
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 with_field() const { return (flags & ITEM_FLAG_WITH_FIELD); }
|
||||||
inline bool fixed() const { return (flags & ITEM_FLAG_FIXED); }
|
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_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 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); }
|
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
|
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
|
But historically we allow fix_fields() to be called for Items
|
||||||
who return basic_const_item()==true.
|
who return basic_const_item()==true.
|
||||||
*/
|
*/
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
DBUG_ASSERT(basic_const_item());
|
DBUG_ASSERT(basic_const_item());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1563,7 +1562,7 @@ public:
|
|||||||
my_decimal *val_decimal_from_string(my_decimal *decimal_value);
|
my_decimal *val_decimal_from_string(my_decimal *decimal_value);
|
||||||
longlong val_int_from_real()
|
longlong val_int_from_real()
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(is_fixed());
|
DBUG_ASSERT(fixed());
|
||||||
return Converter_double_to_longlong_with_warn(val_real(), false).result();
|
return Converter_double_to_longlong_with_warn(val_real(), false).result();
|
||||||
}
|
}
|
||||||
longlong val_int_from_str(int *error);
|
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.
|
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; }
|
virtual bool is_outer_field() const { DBUG_ASSERT(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(); }
|
|
||||||
|
|
||||||
Item* set_expr_cache(THD *thd);
|
Item* set_expr_cache(THD *thd);
|
||||||
|
|
||||||
|
@ -4731,7 +4731,7 @@ class Func_handler_bit_or_int_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
Longlong_null a= item->arguments()[0]->to_longlong_null();
|
||||||
return a.is_null() ? a : a | item->arguments()[1]->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:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
Longlong_null to_longlong_null(Item_handled_func *item) const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
VDec a(item->arguments()[0]);
|
VDec a(item->arguments()[0]);
|
||||||
return a.is_null() ? Longlong_null() :
|
return a.is_null() ? Longlong_null() :
|
||||||
a.to_xlonglong_null() | VDec(item->arguments()[1]).to_xlonglong_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:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
Longlong_null a= item->arguments()[0]->to_longlong_null();
|
||||||
return a.is_null() ? a : a & item->arguments()[1]->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:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
Longlong_null to_longlong_null(Item_handled_func *item) const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
VDec a(item->arguments()[0]);
|
VDec a(item->arguments()[0]);
|
||||||
return a.is_null() ? Longlong_null() :
|
return a.is_null() ? Longlong_null() :
|
||||||
a.to_xlonglong_null() & VDec(item->arguments()[1]).to_xlonglong_null();
|
a.to_xlonglong_null() & VDec(item->arguments()[1]).to_xlonglong_null();
|
||||||
|
@ -375,7 +375,7 @@ Item_func::quick_fix_field()
|
|||||||
{
|
{
|
||||||
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
|
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
|
||||||
{
|
{
|
||||||
if (!(*arg)->is_fixed())
|
if (!(*arg)->fixed())
|
||||||
(*arg)->quick_fix_field();
|
(*arg)->quick_fix_field();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2167,7 +2167,7 @@ class Func_handler_shift_left_int_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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() <<
|
return item->arguments()[0]->to_longlong_null() <<
|
||||||
item->arguments()[1]->to_longlong_null();
|
item->arguments()[1]->to_longlong_null();
|
||||||
}
|
}
|
||||||
@ -2180,7 +2180,7 @@ class Func_handler_shift_left_decimal_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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() <<
|
return VDec(item->arguments()[0]).to_xlonglong_null() <<
|
||||||
item->arguments()[1]->to_longlong_null();
|
item->arguments()[1]->to_longlong_null();
|
||||||
}
|
}
|
||||||
@ -2214,7 +2214,7 @@ class Func_handler_shift_right_decimal_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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() >>
|
return VDec(item->arguments()[0]).to_xlonglong_null() >>
|
||||||
item->arguments()[1]->to_longlong_null();
|
item->arguments()[1]->to_longlong_null();
|
||||||
}
|
}
|
||||||
@ -2235,7 +2235,7 @@ class Func_handler_bit_neg_int_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
return ~ item->arguments()[0]->to_longlong_null();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2247,7 +2247,7 @@ class Func_handler_bit_neg_decimal_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
return ~ VDec(item->arguments()[0]).to_xlonglong_null();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -3400,7 +3400,7 @@ class Func_handler_bit_count_int_to_slong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
return item->arguments()[0]->to_longlong_null().bit_count();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -3412,7 +3412,7 @@ class Func_handler_bit_count_decimal_to_slong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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();
|
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)
|
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);
|
DBUG_ASSERT(thd->lex->exchange);
|
||||||
if (!(entry= get_variable(&thd->user_vars, &org_name, 1)))
|
if (!(entry= get_variable(&thd->user_vars, &org_name, 1)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -6453,7 +6453,7 @@ class Func_handler_bit_xor_int_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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() ^
|
return item->arguments()[0]->to_longlong_null() ^
|
||||||
item->arguments()[1]->to_longlong_null();
|
item->arguments()[1]->to_longlong_null();
|
||||||
}
|
}
|
||||||
@ -6466,7 +6466,7 @@ class Func_handler_bit_xor_dec_to_ulonglong:
|
|||||||
public:
|
public:
|
||||||
Longlong_null to_longlong_null(Item_handled_func *item) const
|
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() ^
|
return VDec(item->arguments()[0]).to_xlonglong_null() ^
|
||||||
VDec(item->arguments()[1]).to_xlonglong_null();
|
VDec(item->arguments()[1]).to_xlonglong_null();
|
||||||
}
|
}
|
||||||
|
@ -343,7 +343,7 @@ public:
|
|||||||
|
|
||||||
bool excl_dep_on_grouping_fields(st_select_lex *sel)
|
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 false;
|
||||||
return Item_args::excl_dep_on_grouping_fields(sel);
|
return Item_args::excl_dep_on_grouping_fields(sel);
|
||||||
}
|
}
|
||||||
@ -509,14 +509,14 @@ public:
|
|||||||
}
|
}
|
||||||
double val_real(Item_handled_func *item) const
|
double val_real(Item_handled_func *item) const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
StringBuffer<64> tmp;
|
StringBuffer<64> tmp;
|
||||||
String *res= item->val_str(&tmp);
|
String *res= item->val_str(&tmp);
|
||||||
return res ? item->double_from_string_with_check(res) : 0.0;
|
return res ? item->double_from_string_with_check(res) : 0.0;
|
||||||
}
|
}
|
||||||
longlong val_int(Item_handled_func *item) const
|
longlong val_int(Item_handled_func *item) const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
StringBuffer<22> tmp;
|
StringBuffer<22> tmp;
|
||||||
String *res= item->val_str(&tmp);
|
String *res= item->val_str(&tmp);
|
||||||
return res ? item->longlong_from_string_with_check(res) : 0;
|
return res ? item->longlong_from_string_with_check(res) : 0;
|
||||||
|
@ -535,7 +535,7 @@ public:
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
for (unsigned int i= 0; i < arg_count; ++i)
|
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;
|
String str;
|
||||||
args[i]->print(&str, QT_NO_DATA_EXPANSION);
|
args[i]->print(&str, QT_NO_DATA_EXPANSION);
|
||||||
|
@ -2226,7 +2226,7 @@ bool Item_in_subselect::fix_having(Item *having, SELECT_LEX *select_lex)
|
|||||||
{
|
{
|
||||||
bool fix_res= 0;
|
bool fix_res= 0;
|
||||||
DBUG_ASSERT(thd);
|
DBUG_ASSERT(thd);
|
||||||
if (!having->is_fixed())
|
if (!having->fixed())
|
||||||
{
|
{
|
||||||
select_lex->having_fix_field= 1;
|
select_lex->having_fix_field= 1;
|
||||||
fix_res= having->fix_fields(thd, 0);
|
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;
|
Item *item_having_part2= 0;
|
||||||
for (uint i= 0; i < cols_num; i++)
|
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 &&
|
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
|
||||||
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
||||||
Item_ref::OUTER_REF));
|
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++)
|
for (uint i= 0; i < cols_num; i++)
|
||||||
{
|
{
|
||||||
Item *item, *item_isnull;
|
Item *item, *item_isnull;
|
||||||
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 &&
|
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
|
||||||
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
||||||
Item_ref::OUTER_REF));
|
Item_ref::OUTER_REF));
|
||||||
|
@ -895,7 +895,7 @@ bool Aggregator_distinct::setup(THD *thd)
|
|||||||
item_sum->flags|= ITEM_FLAG_MAYBE_NULL;
|
item_sum->flags|= ITEM_FLAG_MAYBE_NULL;
|
||||||
item_sum->quick_group= 0;
|
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);
|
arg= item_sum->get_arg(0);
|
||||||
if (arg->const_item())
|
if (arg->const_item())
|
||||||
|
@ -1591,7 +1591,7 @@ public:
|
|||||||
bool get_date(THD *thd, Item_handled_func *item,
|
bool get_date(THD *thd, Item_handled_func *item,
|
||||||
MYSQL_TIME *to, date_mode_t fuzzy) const
|
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::Options opt(TIME_CONV_NONE, thd);
|
||||||
Datetime dt(thd, item->arguments()[0], opt);
|
Datetime dt(thd, item->arguments()[0], opt);
|
||||||
if (!dt.is_valid_datetime())
|
if (!dt.is_valid_datetime())
|
||||||
@ -1625,7 +1625,7 @@ public:
|
|||||||
bool get_date(THD *thd, Item_handled_func *item,
|
bool get_date(THD *thd, Item_handled_func *item,
|
||||||
MYSQL_TIME *to, date_mode_t fuzzy) const
|
MYSQL_TIME *to, date_mode_t fuzzy) const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
Time t(thd, item->arguments()[0]);
|
Time t(thd, item->arguments()[0]);
|
||||||
if (!t.is_valid_time())
|
if (!t.is_valid_time())
|
||||||
return (item->null_value= true);
|
return (item->null_value= true);
|
||||||
@ -1662,7 +1662,7 @@ public:
|
|||||||
bool get_date(THD *thd, Item_handled_func *item,
|
bool get_date(THD *thd, Item_handled_func *item,
|
||||||
MYSQL_TIME *to, date_mode_t fuzzy) const
|
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
|
// Detect a proper timestamp type based on the argument values
|
||||||
Temporal_hybrid l_time1(thd, item->arguments()[0],
|
Temporal_hybrid l_time1(thd, item->arguments()[0],
|
||||||
Temporal::Options(TIME_TIME_ONLY, thd));
|
Temporal::Options(TIME_TIME_ONLY, thd));
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
bool Item_func_history::val_bool()
|
bool Item_func_history::val_bool()
|
||||||
{
|
{
|
||||||
Item_field *f= static_cast<Item_field *>(args[0]);
|
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);
|
DBUG_ASSERT(f->field->flags & VERS_SYS_END_FLAG);
|
||||||
return !f->field->is_max();
|
return !f->field->is_max();
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
}
|
}
|
||||||
bool fix_length_and_dec()
|
bool fix_length_and_dec()
|
||||||
{
|
{
|
||||||
set_maybe_null(0);
|
flags|= ITEM_FLAG_MAYBE_NULL;
|
||||||
null_value= 0;
|
null_value= 0;
|
||||||
decimals= 0;
|
decimals= 0;
|
||||||
max_length= 1;
|
max_length= 1;
|
||||||
|
@ -852,7 +852,7 @@ bool subquery_types_allow_materialization(THD* thd, Item_in_subselect *in_subs)
|
|||||||
Item *left_exp= in_subs->left_exp();
|
Item *left_exp= in_subs->left_exp();
|
||||||
DBUG_ENTER("subquery_types_allow_materialization");
|
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);
|
List_iterator<Item> it(in_subs->unit->first_select()->item_list);
|
||||||
uint elements= in_subs->unit->first_select()->item_list.elements;
|
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.
|
We're going to finalize IN->EXISTS conversion.
|
||||||
Normally, IN->EXISTS conversion takes place inside the
|
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
|
fix_fields() haven't finished yet) and item_subselect->changed==FALSE (as
|
||||||
the conversion haven't been finalized)
|
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());
|
DBUG_ASSERT(item->fixed());
|
||||||
|
|
||||||
Item *substitute= item->substitution;
|
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
|
The Item_subselect has already been wrapped with Item_in_optimizer, so we
|
||||||
should search for item->optimizer, not 'item'.
|
should search for item->optimizer, not 'item'.
|
||||||
@ -1334,7 +1334,7 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
|
|||||||
DBUG_ASSERT(in_subq->fixed());
|
DBUG_ASSERT(in_subq->fixed());
|
||||||
|
|
||||||
Item *substitute= in_subq->substitution;
|
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)?
|
Item **tree= (in_subq->emb_on_expr_nest == NO_JOIN_NEST)?
|
||||||
&join->conds : &(in_subq->emb_on_expr_nest->on_expr);
|
&join->conds : &(in_subq->emb_on_expr_nest->on_expr);
|
||||||
Item *replace_me= in_subq->original_item();
|
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]);
|
subq_lex->ref_pointer_array[i]);
|
||||||
if (!item_eq)
|
if (!item_eq)
|
||||||
DBUG_RETURN(TRUE);
|
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) !=
|
if (left_exp_orig->element_index(i) !=
|
||||||
left_exp->element_index(i))
|
left_exp->element_index(i))
|
||||||
thd->change_item_tree(item_eq->arguments(),
|
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. */
|
/* A strategy must be chosen earlier. */
|
||||||
DBUG_ASSERT(in_subs->has_strategy());
|
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_having);
|
||||||
DBUG_ASSERT(!in_to_exists_where || in_to_exists_where->is_fixed());
|
DBUG_ASSERT(!in_to_exists_where || in_to_exists_where->fixed());
|
||||||
DBUG_ASSERT(!in_to_exists_having || in_to_exists_having->is_fixed());
|
DBUG_ASSERT(!in_to_exists_having || in_to_exists_having->fixed());
|
||||||
|
|
||||||
/* The original QEP of the subquery. */
|
/* The original QEP of the subquery. */
|
||||||
Join_plan_state save_qep(table_count);
|
Join_plan_state save_qep(table_count);
|
||||||
|
@ -628,7 +628,7 @@ void eliminate_tables(JOIN *join)
|
|||||||
List_iterator<Item> val_it(thd->lex->value_list);
|
List_iterator<Item> val_it(thd->lex->value_list);
|
||||||
while ((item= val_it++))
|
while ((item= val_it++))
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
used_tables |= item->used_tables();
|
used_tables |= item->used_tables();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2077,7 +2077,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
|
|||||||
for (arg_no= 0; arg_no < argcount; arg_no++)
|
for (arg_no= 0; arg_no < argcount; arg_no++)
|
||||||
{
|
{
|
||||||
/* Arguments must be fixed in Item_func_sp::fix_fields */
|
/* 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]))))
|
if ((err_status= (*func_ctx)->set_parameter(thd, arg_no, &(argp[arg_no]))))
|
||||||
goto err_with_cleanup;
|
goto err_with_cleanup;
|
||||||
|
@ -9014,7 +9014,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order)
|
|||||||
Item_func_match *ifm;
|
Item_func_match *ifm;
|
||||||
|
|
||||||
while ((ifm=li++))
|
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
|
it mean that clause where was FT function was removed, so we have
|
||||||
to remove the function from the list.
|
to remove the function from the list.
|
||||||
|
@ -1963,7 +1963,7 @@ JOIN::optimize_inner()
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Item_cond_and can't be fixed after creation, so we do not check
|
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->fix_fields(thd, &conds);
|
||||||
conds->change_ref_to_fields(thd, tables_list);
|
conds->change_ref_to_fields(thd, tables_list);
|
||||||
@ -2016,10 +2016,10 @@ JOIN::optimize_inner()
|
|||||||
if (optimize_constant_subqueries())
|
if (optimize_constant_subqueries())
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
if (conds && conds->has_subquery())
|
if (conds && conds->with_subquery())
|
||||||
(void) conds->walk(&Item::cleanup_is_expensive_cache_processor,
|
(void) conds->walk(&Item::cleanup_is_expensive_cache_processor,
|
||||||
0, (void *) 0);
|
0, (void *) 0);
|
||||||
if (having && having->has_subquery())
|
if (having && having->with_subquery())
|
||||||
(void) having->walk(&Item::cleanup_is_expensive_cache_processor,
|
(void) having->walk(&Item::cleanup_is_expensive_cache_processor,
|
||||||
0, (void *) 0);
|
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.
|
Yet attributes of the just built condition are not needed.
|
||||||
Thus we call sel->cond->quick_fix_field for safety.
|
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();
|
sel->cond->quick_fix_field();
|
||||||
|
|
||||||
if (sel->test_quick_select(thd, tab->keys,
|
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
|
return join->join_tab + join->table_count - 1 == this && // 1
|
||||||
type != JT_EQ_REF && type != JT_CONST && type != JT_SYSTEM && // 2
|
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
|
*simple_order=0; // Must do a temp table to sort
|
||||||
else if (!(order_tables & not_const_tables))
|
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
|
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= and_conds(join->thd, conds, table->on_expr);
|
||||||
conds->top_level_item();
|
conds->top_level_item();
|
||||||
/* conds is always a new item as both cond and on_expr existed */
|
/* 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);
|
conds->fix_fields(join->thd, &conds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -17882,7 +17882,7 @@ Item_func_isnull::remove_eq_conds(THD *thd, Item::cond_result *cond_value,
|
|||||||
cond= new_cond;
|
cond= new_cond;
|
||||||
/*
|
/*
|
||||||
Item_func_eq can't be fixed after creation so we do not check
|
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.
|
argument.
|
||||||
*/
|
*/
|
||||||
cond->fix_fields(thd, &cond);
|
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)
|
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);
|
DBUG_ASSERT(value->cols() == s->fields);
|
||||||
for (uint i= 0; i < value->cols(); i++)
|
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
|
inspite of that fix_fields() calls find_item_in_list() one more
|
||||||
time.
|
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.
|
arguments for which fix_fields already was called.
|
||||||
*/
|
*/
|
||||||
if (order_item->fix_fields_if_needed_for_order_by(thd, order->item) ||
|
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))
|
if (unlikely(thd->is_fatal_error))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
if (!cond->is_fixed())
|
if (!cond->fixed())
|
||||||
{
|
{
|
||||||
Item *tmp_item= (Item*) cond;
|
Item *tmp_item= (Item*) cond;
|
||||||
cond->fix_fields(thd, &tmp_item);
|
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
|
for such queries, we'll get here before having called
|
||||||
subquery_expr->fix_fields(), which will cause failure to
|
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;
|
Item *ref= unit->item;
|
||||||
if (unit->item->fix_fields(thd, &ref))
|
if (unit->item->fix_fields(thd, &ref))
|
||||||
|
@ -324,7 +324,7 @@ end:
|
|||||||
set= m_set_signal_information.m_item[i];
|
set= m_set_signal_information.m_item[i];
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
if (set->is_fixed())
|
if (set->fixed())
|
||||||
set->cleanup();
|
set->cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ bool get_type_attributes_for_tvc(THD *thd,
|
|||||||
Item *item;
|
Item *item;
|
||||||
for (uint holder_pos= 0 ; (item= it++); holder_pos++)
|
for (uint holder_pos= 0 ; (item= it++); holder_pos++)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
holders[holder_pos].add_argument(item);
|
holders[holder_pos].add_argument(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7059,7 +7059,7 @@ Item_temporal_precision(THD *thd, Item *item, bool is_time) const
|
|||||||
StringBuffer<64> buf;
|
StringBuffer<64> buf;
|
||||||
String *tmp;
|
String *tmp;
|
||||||
MYSQL_TIME_STATUS status;
|
MYSQL_TIME_STATUS status;
|
||||||
DBUG_ASSERT(item->is_fixed());
|
DBUG_ASSERT(item->fixed());
|
||||||
// Nanosecond rounding is not needed here, for performance purposes
|
// Nanosecond rounding is not needed here, for performance purposes
|
||||||
if ((tmp= item->val_str(&buf)) &&
|
if ((tmp= item->val_str(&buf)) &&
|
||||||
(is_time ?
|
(is_time ?
|
||||||
|
@ -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
|
been fixed yet. An Item_type_holder must be created based on a fixed
|
||||||
Item, so use the inner Item instead.
|
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_tmp->type() == Item::REF_ITEM &&
|
||||||
((Item_ref *)(item_tmp))->ref_type() ==
|
((Item_ref *)(item_tmp))->ref_type() ==
|
||||||
Item_ref::OUTER_REF));
|
Item_ref::OUTER_REF));
|
||||||
if (!item_tmp->is_fixed())
|
if (!item_tmp->fixed())
|
||||||
item_tmp= item_tmp->real_item();
|
item_tmp= item_tmp->real_item();
|
||||||
holders[holder_pos].add_argument(item_tmp);
|
holders[holder_pos].add_argument(item_tmp);
|
||||||
}
|
}
|
||||||
|
10
sql/table.cc
10
sql/table.cc
@ -3605,7 +3605,7 @@ bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol)
|
|||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
vcol->expr->walk(&Item::cleanup_excluding_fields_processor, 0, 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));
|
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_PRINT("info", ("vcol: %p", vcol));
|
||||||
DBUG_ASSERT(func_expr);
|
DBUG_ASSERT(func_expr);
|
||||||
|
|
||||||
if (func_expr->is_fixed())
|
if (func_expr->fixed())
|
||||||
DBUG_RETURN(0); // nothing to do
|
DBUG_RETURN(0); // nothing to do
|
||||||
|
|
||||||
if (fix_vcol_expr(thd, vcol))
|
if (fix_vcol_expr(thd, vcol))
|
||||||
@ -5792,7 +5792,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
|
|||||||
|
|
||||||
if (where)
|
if (where)
|
||||||
{
|
{
|
||||||
if (where->is_fixed())
|
if (where->fixed())
|
||||||
where->update_used_tables();
|
where->update_used_tables();
|
||||||
else if (where->fix_fields(thd, &where))
|
else if (where->fix_fields(thd, &where))
|
||||||
DBUG_RETURN(TRUE);
|
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
|
('mysql_schema_table' function). So we can return directly the
|
||||||
field. This case happens only for 'show & where' commands.
|
field. This case happens only for 'show & where' commands.
|
||||||
*/
|
*/
|
||||||
DBUG_ASSERT(field && field->is_fixed());
|
DBUG_ASSERT(field && field->fixed());
|
||||||
DBUG_RETURN(field);
|
DBUG_RETURN(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_ASSERT(field);
|
DBUG_ASSERT(field);
|
||||||
thd->lex->current_select->no_wrap_view_item= TRUE;
|
thd->lex->current_select->no_wrap_view_item= TRUE;
|
||||||
if (!field->is_fixed())
|
if (!field->fixed())
|
||||||
{
|
{
|
||||||
if (field->fix_fields(thd, field_ref))
|
if (field->fix_fields(thd, field_ref))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user