Commit 14641772 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

func_test.result, item_cmpfunc.cc:

  Fixed bug #6187: a wrong initial setting for const_item_cache
  in Item_cond::fix_fields.
parent 7f884c1f
...@@ -77,9 +77,9 @@ select * from t1 where 1 xor 1; ...@@ -77,9 +77,9 @@ select * from t1 where 1 xor 1;
a a
explain extended select * from t1 where 1 xor 1; explain extended select * from t1 where 1 xor 1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings: Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (1 xor 1) Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1`
select - a from t1; select - a from t1;
- a - a
-1 -1
......
...@@ -1956,7 +1956,7 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -1956,7 +1956,7 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
char buff[sizeof(char*)]; // Max local vars in function char buff[sizeof(char*)]; // Max local vars in function
#endif #endif
not_null_tables_cache= used_tables_cache= 0; not_null_tables_cache= used_tables_cache= 0;
const_item_cache= 0; const_item_cache= 1;
/* /*
and_table_cache is the value that Item_cond_or() returns for and_table_cache is the value that Item_cond_or() returns for
not_null_tables() not_null_tables()
...@@ -2013,7 +2013,7 @@ void Item_cond::split_sum_func(Item **ref_pointer_array, List<Item> &fields) ...@@ -2013,7 +2013,7 @@ void Item_cond::split_sum_func(Item **ref_pointer_array, List<Item> &fields)
List_iterator<Item> li(list); List_iterator<Item> li(list);
Item *item; Item *item;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=0; const_item_cache=1;
while ((item=li++)) while ((item=li++))
{ {
if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) if (item->with_sum_func && item->type() != SUM_FUNC_ITEM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment