summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-02-07 19:42:03 +0200
committerunknown <monty@mysql.com>2005-02-07 19:42:03 +0200
commitf9e0e5a7c5f01e6aa49a2925efb55bdc4f88d495 (patch)
tree5c11adf8670fa1044233b655ddda407c614e763a /sql/item_row.cc
parentbb05eab8e9aa1a25e46063af3ee510d4169de9e4 (diff)
parentedae64f4cb319562bc9f6ea0a20b6cfe174fdaff (diff)
downloadmariadb-git-f9e0e5a7c5f01e6aa49a2925efb55bdc4f88d495.tar.gz
Merge with 4.1 to get bug fix
mysql-test/r/group_by.result: Auto merged mysql-test/r/user_var.result: Auto merged sql/item_row.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/unireg.h: Auto merged sql/item_cmpfunc.cc: manual merge sql/item_func.cc: no changes
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 62f31186b09..a5a430785d6 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -84,15 +84,20 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
return FALSE;
}
+
void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array,
List<Item> &fields)
{
Item **arg, **arg_end;
for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++)
{
- if ((*arg)->with_sum_func && (*arg)->type() != SUM_FUNC_ITEM)
- (*arg)->split_sum_func(thd, ref_pointer_array, fields);
- else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM)
+ Item *item= *arg;
+ 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->type() == SUM_FUNC_ITEM ||
+ (item->used_tables() && item->type() != REF_ITEM))
{
uint el= fields.elements;
ref_pointer_array[el]=*arg;