automatic merge with 5.3

This commit is contained in:
Michael Widenius 2011-05-28 05:58:16 +03:00
commit 2894d50e3e
22 changed files with 325 additions and 230 deletions

View file

@ -419,14 +419,12 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
/*
Store the value of the field/constant if it references an outer field
because the call to save_in_field below overrides that value.
Don't save field value if no data has been read yet.
Outer constant values are always saved.
Store the value of the field/constant because the call to save_in_field
below overrides that value. Don't save field value if no data has been
read yet.
*/
bool save_field_value= (field_item->depended_from &&
(field_item->const_item() ||
!(field->table->status & STATUS_NO_RECORD)));
bool save_field_value= (field_item->const_item() ||
!(field->table->status & STATUS_NO_RECORD));
if (save_field_value)
orig_field_val= field->val_int();
if (!(*item)->is_null() && !(*item)->save_in_field(field, 1))
@ -1483,7 +1481,10 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
with_sum_func= args[0]->with_sum_func;
with_field= args[0]->with_field;
if ((const_item_cache= args[0]->const_item()))
{
cache->store(args[0]);
cache->cache_value();
}
return 0;
}
@ -1835,13 +1836,14 @@ Item *Item_in_optimizer::transform(Item_transformer transformer, uchar *argument
bool Item_in_optimizer::is_expensive_processor(uchar *arg)
{
return args[1]->is_expensive_processor(arg);
return args[0]->is_expensive_processor(arg) ||
args[1]->is_expensive_processor(arg);
}
bool Item_in_optimizer::is_expensive()
{
return args[1]->is_expensive();
return args[0]->is_expensive() || args[1]->is_expensive();
}
@ -5540,7 +5542,7 @@ void Item_equal::update_const()
Item *item;
while ((item= it++))
{
if (item->const_item())
if (item->const_item() && !item->is_expensive())
{
if (item == equal_items.head())
with_const= TRUE;