summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-08-05 00:02:46 +0200
committerSergei Golubchik <serg@mariadb.org>2015-08-05 00:02:46 +0200
commit1610c4285aa2a3421cca9983360ff33e86936479 (patch)
tree9b37ec3191f3c151bb3010cefb5c0104a6e3e16d /sql/item_sum.cc
parent0785b2d55d97207a00b2fb406f8da4aa4bfc9edf (diff)
parent006ffca56e0638f14152f4ba97ecfc7bfe08d773 (diff)
downloadmariadb-git-1610c4285aa2a3421cca9983360ff33e86936479.tar.gz
Merge branch 'bb-10.0-jan' into 10.0
5.5 with our InnoDB changes
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 1c5682417a5..29dc94eb5af 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3527,9 +3527,16 @@ bool Item_func_group_concat::setup(THD *thd)
"all_fields". The resulting field list is used as input to create
tmp table columns.
*/
- if (arg_count_order &&
- setup_order(thd, args, context->table_list, list, all_fields, *order))
- DBUG_RETURN(TRUE);
+ if (arg_count_order)
+ {
+ uint n_elems= arg_count_order + all_fields.elements;
+ ref_pointer_array= static_cast<Item**>(thd->alloc(sizeof(Item*) * n_elems));
+ memcpy(ref_pointer_array, args, arg_count * sizeof(Item*));
+ if (!ref_pointer_array ||
+ setup_order(thd, ref_pointer_array, context->table_list, list,
+ all_fields, *order))
+ DBUG_RETURN(TRUE);
+ }
count_field_types(select_lex, tmp_table_param, all_fields, 0);
tmp_table_param->force_copy_fields= force_copy_fields;