diff options
author | igor@olga.mysql.com <> | 2007-03-22 14:51:20 -0700 |
---|---|---|
committer | igor@olga.mysql.com <> | 2007-03-22 14:51:20 -0700 |
commit | 92d1d7403744cb2ba95a7214995667b751bfabcc (patch) | |
tree | 0d24121ec48ddec3cd794682db92f748ccab9429 /sql/item.cc | |
parent | a2219567a14907da2bf2d89153736924cbe69086 (diff) | |
parent | 8f9178e857195e9d7858e5f74938dd94925cd636 (diff) | |
download | mariadb-git-92d1d7403744cb2ba95a7214995667b751bfabcc.tar.gz |
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27229
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index 96fde4eb704..808e7925729 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1261,15 +1261,18 @@ void Item::split_sum_func2(THD *thd, Item **ref_pointer_array, Exception is Item_direct_view_ref which we need to convert to Item_ref to allow fields from view being stored in tmp table. */ + Item_aggregate_ref *item_ref; uint el= fields.elements; - Item *new_item, *real_itm= real_item(); + Item *real_itm= real_item(); ref_pointer_array[el]= real_itm; - if (!(new_item= new Item_aggregate_ref(&thd->lex->current_select->context, + if (!(item_ref= new Item_aggregate_ref(&thd->lex->current_select->context, ref_pointer_array + el, 0, name))) return; // fatal_error is set + if (type() == SUM_FUNC_ITEM) + item_ref->depended_from= ((Item_sum *) this)->depended_from(); fields.push_front(real_itm); - thd->change_item_tree(ref, new_item); + thd->change_item_tree(ref, item_ref); } } |