From 1d17fd7d51f7100038eaa5fb4cb372c785a44010 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 12 Oct 2003 17:56:05 +0300 Subject: fixed printability of Items (all items except subselects) (SCRUM) (WL#1274) sql/item.cc: fixed printability of Items sql/item.h: fixed printability of Items sql/item_cmpfunc.cc: fixed printability of Items sql/item_cmpfunc.h: fixed printability of Items sql/item_func.cc: fixed printability of Items sql/item_func.h: fixed printability of Items sql/item_geofunc.h: added DBUG_ASSERT to catch error in debuging timw sql/item_row.cc: fixed printability of Items sql/item_row.h: fixed printability of Items sql/item_strfunc.cc: fixed printability of Items sql/item_strfunc.h: fixed printability of Items sql/item_sum.cc: fixed printability of Items sql/item_sum.h: fixed printability of Items sql/item_timefunc.cc: fixed printability of Items sql/item_timefunc.h: layout fixed fixed printability of Items sql/item_uniq.h: fixed printability of Items sql/sql_yacc.yy: layout fixed correct convertion to String --- sql/item_sum.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'sql/item_sum.cc') diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 967abbc5ab8..b61c19f994d 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1343,6 +1343,14 @@ longlong Item_sum_count_distinct::val_int() return table->file->records; } + +void Item_sum_count_distinct::print(String *str) +{ + str->append("count(distinct "); + args[0]->print(str); + str->append(')'); +} + /**************************************************************************** ** Functions to handle dynamic loadable aggregates ** Original source by: Alexis Mikhailov @@ -1936,3 +1944,28 @@ String* Item_func_group_concat::val_str(String* str) } return &result; } + +void Item_func_group_concat::print(String *str) +{ + str->append("group concat("); + if (distinct) + str->append(" distinct "); + for (uint i= 0; i < arg_count; i++) + { + if (i) + str->append(','); + args[i]->print(str); + } + if (arg_count_order) + { + for (uint i= 0 ; i < arg_count_order ; i++) + { + if (i) + str->append(','); + (*order[i]->item)->print(str); + } + } + str->append(" seperator \'"); + str->append(*separator); + str->append("\')"); +} -- cgit v1.2.1