Bug #13157 bitfields not handled in select distinct
Submitted: 13 Sep 2005 22:05 Modified: 30 Sep 2005 5:56
Reporter: Tomas Ulin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Ramil Kalimullin CPU Architecture:Any

[13 Sep 2005 22:05] Tomas Ulin
Description:
see below

How to repeat:
master> drop table if exists t1;  create table t1 (a int, b char(1)); insert into t1 values (1,'\0'), (1,'1'); select distinct * from t1;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

+------+------+
| a    | b    |
+------+------+
|    1 |      |
|    1 | 1    |
+------+------+
2 rows in set (0.00 sec)

master> drop table if exists t1;  create table t1 (a int, b bit(1)); insert into t1 values (1,'\0'), (1,'1'); select distinct * from t1;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 2 rows affected, 1 warning (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 1

+------+------+
| a    | b    |
+------+------+
|    1 |      |
+------+------+
1 row in set (0.01 sec)

master> select hex(b) from t1;
+--------+
| hex(b) |
+--------+
| 0      |
| 1      |
+--------+
2 rows in set (0.00 sec)

master>