summaryrefslogtreecommitdiff
path: root/mysql-test/t/type_bit.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-08-17 18:30:41 +0400
committerunknown <evgen@moonbone.local>2007-08-17 18:30:41 +0400
commitd280a06e36b04d245ad26126c5f0466d21726146 (patch)
tree8817334d63f43820767a9b3de9efd61e0637b25e /mysql-test/t/type_bit.test
parent83fdcb2b7bddfffcf5a750ac9830f7ea38d2b8fc (diff)
downloadmariadb-git-d280a06e36b04d245ad26126c5f0466d21726146.tar.gz
Bug#30245: A wrong type of a BIT field is reported when grouped by it.
HEAP tables can't index BIT fields. Due to this when grouping by such fields is needed they are converted to a fields of the LONG type when temporary table is being created. But a side effect of this is that a wrong type of BIT fields is returned to a client. Now the JOIN::prepare and the create_distinct_group functions are create additional hidden copy of BIT fields to preserve original fields untouched. New hidden fields are used for grouping instead. mysql-test/t/type_bit.test: Added a test case for the bug#30245: A wrong type of a BIT field is reported when grouped by it. mysql-test/r/type_bit.result: Added a test case for the bug#30245: A wrong type of a BIT field is reported when grouped by it. sql/sql_select.cc: Bug#30245: A wrong type of a BIT field is reported when grouped by it. Now the JOIN::prepare and the create_distinct_group functions are create additional hidden copy of BIT fields to preserve original fields untouched. New hidden fields are used for grouping instead.
Diffstat (limited to 'mysql-test/t/type_bit.test')
-rw-r--r--mysql-test/t/type_bit.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 6423d017afb..66538f59c6f 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -291,4 +291,17 @@ 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;
+#
+# Bug#30245: A wrong type of a BIT field is reported when grouped by it.
+#
+CREATE TABLE t1 (b BIT);
+INSERT INTO t1 (b) VALUES (1), (0);
+--enable_metadata
+--replace_column 1 #
+SELECT DISTINCT b FROM t1;
+--replace_column 1 #
+SELECT b FROM t1 GROUP BY b;
+--disable_metadata
+DROP TABLE t1;
+
--echo End of 5.0 tests