diff options
author | monty@mysql.com <> | 2005-02-07 19:42:03 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2005-02-07 19:42:03 +0200 |
commit | dcb7865548bacc0e2ffd929f964c496cd2e29b16 (patch) | |
tree | 5c11adf8670fa1044233b655ddda407c614e763a /sql/item_row.cc | |
parent | c926d8a0be2649d73d14b622cbc8919bd5a54499 (diff) | |
parent | 3fe60486e4d56138e8e9e1ffbc91a4c221eb6102 (diff) | |
download | mariadb-git-dcb7865548bacc0e2ffd929f964c496cd2e29b16.tar.gz |
Merge with 4.1 to get bug fix
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 11 |
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; |