diff options
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 4746a6057c6..15927c4b11e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2827,6 +2827,7 @@ String *Item_sum_udf_str::val_str(String *str) @retval 1 : key1 > key2 */ +extern "C" int group_concat_key_cmp_with_distinct(void* arg, const void* key1, const void* key2) { @@ -2861,6 +2862,7 @@ int group_concat_key_cmp_with_distinct(void* arg, const void* key1, function of sort for syntax: GROUP_CONCAT(expr,... ORDER BY col,... ) */ +extern "C" int group_concat_key_cmp_with_order(void* arg, const void* key1, const void* key2) { @@ -2905,13 +2907,16 @@ int group_concat_key_cmp_with_order(void* arg, const void* key1, Append data from current leaf to item->result. */ -int dump_leaf_key(uchar* key, element_count count __attribute__((unused)), - Item_func_group_concat *item) +extern "C" +int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)), + void* item_arg) { + Item_func_group_concat *item= (Item_func_group_concat *) item_arg; TABLE *table= item->table; String tmp((char *)table->record[1], table->s->reclength, default_charset_info); String tmp2; + uchar *key= (uchar *) key_arg; String *result= &item->result; Item **arg= item->args, **arg_end= item->args + item->arg_count_field; uint old_length= result->length(); @@ -3385,8 +3390,7 @@ String* Item_func_group_concat::val_str(String* str) return 0; if (no_appended && tree) /* Tree is used for sorting as in ORDER BY */ - tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this, - left_root_right); + tree_walk(tree, &dump_leaf_key, this, left_root_right); return &result; } @@ -3411,7 +3415,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type) { if (i) str->append(','); - (*order[i]->item)->print(str, query_type); + pargs[i + arg_count_field]->print(str, query_type); if (order[i]->asc) str->append(STRING_WITH_LEN(" ASC")); else |