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>