summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-08-03 23:09:43 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-08-03 23:09:43 +0300
commit9a5787db51ef571e2beaeda1402cf7578c95eaf6 (patch)
tree3dc0e3cfc17077929d701b1e3701c7c9f92f7aa7 /sql/item_sum.cc
parent4188ba9c1e0ea195adf00d9e6d11b29ef18b2109 (diff)
parent96badb16afcf8a6ae3d03918419fc51ace4be236 (diff)
downloadmariadb-git-9a5787db51ef571e2beaeda1402cf7578c95eaf6.tar.gz
Merge commit '96badb16afcf' into 10.0
Conflicts: client/mysql_upgrade.c mysql-test/r/func_misc.result mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result mysql-test/suite/innodb/r/innodb-fk.result mysql-test/t/subselect_sj_mat.test sql/item.cc sql/item_func.cc sql/log.cc sql/log_event.cc sql/rpl_utility.cc sql/slave.cc sql/sql_class.cc sql/sql_class.h sql/sql_select.cc storage/innobase/dict/dict0crea.c storage/innobase/dict/dict0dict.c storage/innobase/handler/ha_innodb.cc storage/xtradb/dict/dict0crea.c storage/xtradb/dict/dict0dict.c storage/xtradb/handler/ha_innodb.cc vio/viosslfactories.c
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;