summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-08-05 14:21:36 -0700
committerunknown <igor@olga.mysql.com>2007-08-05 14:21:36 -0700
commite106b09ad3509991e8e4cd286c14135486363400 (patch)
tree3e83b7c9d79d4eaee09153ef3705aec38290d416 /mysql-test
parent983cda8d36be587827a3ddfdd86ddcf91630fb29 (diff)
parent4e6e122061b71f9378a161793367ae5120310ed4 (diff)
downloadmariadb-git-e106b09ad3509991e8e4cd286c14135486363400.tar.gz
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug30219
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_bit.result32
-rw-r--r--mysql-test/t/type_bit.test24
2 files changed, 56 insertions, 0 deletions
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index fad0e1f7974..324dcc2775b 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -618,4 +618,36 @@ bit_field int_field
 2
handler t1 close;
drop table t1;
+CREATE TABLE t1 (b BIT(2));
+INSERT INTO t1 (b) VALUES (1), (3), (0), (3);
+SELECT b+0, COUNT(DISTINCT b) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT b)
+0 1
+1 1
+3 1
+DROP TABLE t1;
+CREATE TABLE t1 (b BIT(2), a VARCHAR(5));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(5), b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, 1), (3, 2), (0, 3), (3, 4);
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 48ad24ff6b7..2c7f87f342d 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -272,4 +272,28 @@ handler t1 read a=(1);
handler t1 close;
drop table t1;
+#
+# Bug #30219: GROUP BY a column of the BIT type
+#
+
+CREATE TABLE t1 (b BIT(2));
+INSERT INTO t1 (b) VALUES (1), (3), (0), (3);
+SELECT b+0, COUNT(DISTINCT b) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (b BIT(2), a VARCHAR(5));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a CHAR(5), b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, 1), (3, 2), (0, 3), (3, 4);
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
--echo End of 5.0 tests