Bug #117606 Incorrect query result

Submitted: 28 Feb 2025 16:01 Modified: 28 Feb 2025 16:26
Reporter: John Jove Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:8.4.4, 8.0.41 OS:Any
Assigned to: CPU Architecture:Any

[28 Feb 2025 16:01] John Jove
Description:
I run the following case, and an incorrect result is returned.
I got the following query plan for further reference.

id    select_type     table           partitions      type       possible_keys   key             key_len    ref        rows       filtered   Extra               
1     PRIMARY         t2              null            ALL        null            null            null       null       6          100.0      null                
1     PRIMARY         t2              null            ALL        null            null            null       null       6          100.0      Using where; Using join buffer (hash join)
4     DEPENDENT SUBQUERY t2              null            unique_subquery PRIMARY         PRIMARY         18         func       1          100.0      Using where         
3     SUBQUERY        t2              null            ALL        null            null            null       null       6          100.0      null        

How to repeat:
CREATE TABLE t1 (c1 LONGTEXT, PRIMARY KEY (c1(4))) ENGINE = InnoDB;
INSERT INTO t1 (c1) VALUES ('3');
INSERT INTO t1 (c1) VALUES ('a');
SELECT c1 FROM t1 WHERE ((0) >= SOME (SELECT c1 AS ca7 FROM t1)) != 1; -- actual: {3, a}, expected: {}
[28 Feb 2025 16:26] MySQL Verification Team
Hello John,

Thank you for the report and test case.

regards,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.