summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2003-10-22 20:52:47 +0300
committerbell@sanja.is.com.ua <>2003-10-22 20:52:47 +0300
commit934fa2a10420bee1e2893cb6772c584678999603 (patch)
tree094f3d63a932eeaa346520cc5605255beab9debe /sql/item_sum.cc
parent2918e5d529502f0c10c720f1360ab39d6d83bb48 (diff)
parent1db5484577ec1ac079ee5a995589f670eef45f40 (diff)
downloadmariadb-git-934fa2a10420bee1e2893cb6772c584678999603.tar.gz
Merge
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 672126a2664..c26ed45d0cb 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>
@@ -1959,3 +1967,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("\')");
+}