Bug #114718 Incorrect query results
Submitted: 21 Apr 2024 12:09 Modified: 22 Apr 2024 7:44
Reporter: John Jove Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:8.0.36 OS:Any
Assigned to: CPU Architecture:Any

[21 Apr 2024 12:09] John Jove
Description:
I run the following statements, in which the query returns an incorrect result.
I observe that if we remove the first INSERT statement or execute the same query without using index i1, the result becomes valid.

How to repeat:
CREATE TABLE t1 (c1 bit(51) NOT NULL, c2 longblob, KEY i1 (c1) USING BTREE );
CREATE TABLE t2 (c1 longtext, PRIMARY KEY (c1(1)));
INSERT INTO t1 (c1) VALUES (b'10011100011'); -- remove me, result becomes valid
INSERT INTO t1 (c1) VALUES (b'10');
INSERT INTO t2 (c1) VALUES ('2');
SELECT t2.c1 FROM t1 USE INDEX (i1) INNER JOIN t2 USING (c1); -- {}, expected to be {2}
[22 Apr 2024 7:44] MySQL Verification Team
Hello John,

Thank you for the report and test case.
Verified as described.

regards,
Umesh