summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorbell@laptop.sanja.is.com.ua <>2003-10-12 17:56:05 +0300
committerbell@laptop.sanja.is.com.ua <>2003-10-12 17:56:05 +0300
commitddf4d1e5292f226f266a486b84c70e01ec1f93fe (patch)
tree2d243d69c4c8bafa98d2f0bd9b6ed43fea552637 /sql/item_sum.cc
parentd6d6c5e1bb78215da668634310f592a9b4263db1 (diff)
downloadmariadb-git-ddf4d1e5292f226f266a486b84c70e01ec1f93fe.tar.gz
fixed printability of Items (all items except subselects)
(SCRUM) (WL#1274)
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 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 <root@medinf.chuvashia.su>
@@ -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("\')");
+}