Bug #43720 MyISAM & Maria gives wrong results with range access on bit type
Submitted: 18 Mar 2009 6:00 Modified: 18 Mar 2009 6:25
Reporter: Nidhi Shrotriya Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:6.0.11, 5.0, 5.1 bzr OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[18 Mar 2009 6:00] Nidhi Shrotriya
Description:
As mentioned in how to repeat section.

How to repeat:
CREATE TABLE t5(c1  BIT(8) NOT NULL PRIMARY KEY, c2  BIT(8));
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);

With MyISAM/Maria:
-------------------------
SELECT c1,hex(c1),hex(c2) FROM t5 WHERE c1 >  '8' ORDER BY c1;
c1      hex(c1) hex(c2)
                9       FF
^W      17      24
^X      18      FF
^\      1C      FF
^]      1D      FF
^^      1E      53
^_      1F      FF
"       22      CA
,       2C      FF
1       31      FF
8       38      FF
9       39      87
;       3B      BC
<       3C      FF
=       3D      98
D       44      FF
E       45      CE
K       4B      2A
M       4D      85
N       4E      7B
O       4F      FF
W       57      FF
X       58      FF
^       5E      FF
_       5F      2E
h       68      FF
j       6A      FF
l       6C      43
o       6F      FF
t       74      FF
v       76      FF
w       77      FF
z       7A      76
{       7B      FF
^?      7F      FF

With Innodb/Falcon/PBXT:
-------------------------------
SELECT c1,hex(c1),hex(c2) FROM t5 WHERE c1 >  '8'  ORDER BY c1;
8       38      FF
9       39      87
;       3B      BC
<       3C      FF
=       3D      98
D       44      FF
E       45      CE
K       4B      2A
M       4D      85
N       4E      7B
O       4F      FF
W       57      FF
X       58      FF
^       5E      FF
_       5F      2E
h       68      FF
j       6A      FF
l       6C      43
o       6F      FF
t       74      FF
v       76      FF
w       77      FF
z       7A      76
{       7B      FF
^?      7F      FF

With 'ORDER BY LIMIT', all returns same results as below-

SELECT c1,hex(c1),hex(c2) FROM t5 WHERE c1 >  '8'  ORDER BY c1 LIMIT 2;
c1      hex(c1) hex(c2)
8       38      FF
9       39      87
[18 Mar 2009 6:25] Sveta Smirnova
Thank you for the report.

Verified as described.