Description:
In the partition table, when the bit type has an index, the query result is incorrect.
mysql> drop table t0;
Query OK, 0 rows affected (0.03 sec)
mysql> create table t0 (`int_col` int,`bit_col` bit(8) DEFAULT b'0', KEY `ndx_bit_col` (`bit_col` DESC)) partition by hash(int_col) partitions 3;
Query OK, 0 rows affected (0.06 sec)
mysql> insert into t0(int_col) values(1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT bit_col, int_col FROM t0 A WHERE bit_col = '0x00';
Empty set (0.00 sec)
mysql> alter table t0 drop key ndx_bit_col;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SELECT bit_col, int_col FROM t0 A WHERE bit_col = '0x00';
+------------------+---------+
| bit_col | int_col |
+------------------+---------+
| 0x00 | 1 |
+------------------+---------+
1 row in set, 1 warning (0.00 sec)
How to repeat:
create table t0 (`int_col` int,`bit_col` bit(8) DEFAULT b'0', KEY `ndx_bit_col` (`bit_col` DESC)) partition by hash(int_col) partitions 3;
insert into t0(int_col) values(1);
SELECT bit_col, int_col FROM t0 A WHERE bit_col = '0x00';
alter table t0 drop key ndx_bit_col;
SELECT bit_col, int_col FROM t0 A WHERE bit_col = '0x00';
Suggested fix:
In the partition table.The query results must be consistent regardless of whether a column of the bit type has an index.