summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-02-07 19:42:03 +0200
committermonty@mysql.com <>2005-02-07 19:42:03 +0200
commitdcb7865548bacc0e2ffd929f964c496cd2e29b16 (patch)
tree5c11adf8670fa1044233b655ddda407c614e763a /sql/item_func.cc
parentc926d8a0be2649d73d14b622cbc8919bd5a54499 (diff)
parent3fe60486e4d56138e8e9e1ffbc91a4c221eb6102 (diff)
downloadmariadb-git-dcb7865548bacc0e2ffd929f964c496cd2e29b16.tar.gz
Merge with 4.1 to get bug fix
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 7731ccee773..e1d81b2a37d 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -356,6 +356,7 @@ bool Item_func::walk (Item_processor processor, byte *argument)
}
+
/*
Transform an Item_func object with a transformer callback function
@@ -402,9 +403,12 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array,
for (arg= args, arg_end= args+arg_count; arg != arg_end ; arg++)
{
Item *item=* arg;
- if (item->with_sum_func && item->type() != SUM_FUNC_ITEM)
+ if (item->type() != SUM_FUNC_ITEM &&
+ (item->with_sum_func ||
+ (item->used_tables() & PSEUDO_TABLE_BITS)))
item->split_sum_func(thd, ref_pointer_array, fields);
- else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
+ else if (item->type() == SUM_FUNC_ITEM ||
+ (item->used_tables() && item->type() != REF_ITEM))
{
uint el= fields.elements;
ref_pointer_array[el]= item;