summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-10-28 12:45:37 +0200
committerunknown <bell@sanja.is.com.ua>2003-10-28 12:45:37 +0200
commit683dcaae6bfc101d352755f834ecda48f4ea4700 (patch)
tree1088bf30fb5febda5000cffc7db8982c9e5d1257 /sql/item_sum.cc
parent87eb9ea2b10e5ae9d251444e9f3372b958f6a7ea (diff)
parent47f3a4fd4aa4ac7f2944c85aa20333fa0259ac77 (diff)
downloadmariadb-git-683dcaae6bfc101d352755f834ecda48f4ea4700.tar.gz
merge
sql/item.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_sum.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 9da1b21db72..1a5df9e8ccc 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1366,6 +1366,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 <root@medinf.chuvashia.su>
@@ -1960,3 +1968,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("\')");
+}