summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_group.result
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-03-15 03:46:19 +0300
committerunknown <konstantin@mysql.com>2005-03-15 03:46:19 +0300
commit897849e5d8802ebe6a42803cba72caa80cd23415 (patch)
tree7afe84de6147f4619865e4f759eb1d0ad2f376f8 /mysql-test/r/func_group.result
parentce4f43cb860e71a3d5e48773e305ff8e5e130872 (diff)
downloadmariadb-git-897849e5d8802ebe6a42803cba72caa80cd23415.tar.gz
WL#926 "AVG(DISTINCT) and other distincts", part 2 (out of 3): clean up
Item_sum_count_distinct, and deploy Unique for use with COUNT(DISTINCT) if there is no blob column in the list of DISTINCT arguments. mysql-test/r/count_distinct2.result: Test results fixed. mysql-test/r/func_group.result: Updated. mysql-test/r/sum_distinct.result: Updated. mysql-test/t/func_group.test: Add a test for COUNT(DISTINCT) and true varchar and case-insensitive collation. The table in the test contains only two distinct values. mysql-test/t/sum_distinct.test: Since now we support INSERT INTO t1 (a) SELECT a+1 FROM t1, shorten the test. Add a nominal test for AVG(DISTINCT) sql/item_sum.cc: Implementation of cleaned up Item_sum_count_distinct. Fixed a bug with COUNT(DISTINCT) and new VARCHAR and collations. Fixed a bug wiht AVG(DISTINCT) and wrong number of output digits after decimal point. sql/item_sum.h: Cleanup for Item_sum_count_distinct. Now if the list of distinct arguments doesn't contain a blob column, we always use Unique and merge-sort to find distinct values. sql/sql_class.h: Added a short-cut to find number of elements in Unique if all elements fit into memory.
Diffstat (limited to 'mysql-test/r/func_group.result')
-rw-r--r--mysql-test/r/func_group.result7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 46dba6cdfa9..81663cd9d66 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -881,3 +881,10 @@ SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
MAX(id)
NULL
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(400));
+INSERT INTO t1 (a) VALUES ("A"), ("a"), ("a "), ("a "),
+("B"), ("b"), ("b "), ("b ");
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+2
+DROP TABLE t1;