summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sergefp@pylon.mylan>2007-09-14 15:00:10 +0400
committerunknown <sergefp@pylon.mylan>2007-09-14 15:00:10 +0400
commit2ab4e3d1177e856738fc928c4b790651cd3dd6dd (patch)
tree3006d487c817562d3338ea6d7c1143be30518cf1 /mysql-test
parenta87365e5db2c1d69f1bf5cc76c9a092548ea749e (diff)
parent466747d57081b4bdfe166ff16da8ac9da99900e4 (diff)
downloadmariadb-git-2ab4e3d1177e856738fc928c4b790651cd3dd6dd.tar.gz
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/psergey/mysql-5.0-bug30324
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_bit.result15
-rw-r--r--mysql-test/t/type_bit.test14
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 5356f7e0712..4c1b80c2fd5 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -657,4 +657,19 @@ b
#
#
DROP TABLE t1;
+CREATE TABLE t1 (a int, b bit(2));
+INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1);
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+COUNT(DISTINCT b)
+2
+2
+DROP TABLE t1;
+create table t2 (a int, b bit(2), c char(10));
+INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'),
+(3, 2, 'two'), (3, 1, 'one');
+SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
+COUNT(DISTINCT b,c)
+2
+2
+DROP TABLE t2;
End of 5.0 tests
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 66538f59c6f..4978f55d776 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -304,4 +304,18 @@ SELECT b FROM t1 GROUP BY b;
--disable_metadata
DROP TABLE t1;
+#
+# BUG#30324 Wrong query result for COUNT(DISTINCT(bit_column))
+#
+CREATE TABLE t1 (a int, b bit(2));
+INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1);
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+create table t2 (a int, b bit(2), c char(10));
+INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'),
+ (3, 2, 'two'), (3, 1, 'one');
+SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
+DROP TABLE t2;
+
--echo End of 5.0 tests