Bug #104201 Wrong result when compare 'null' with subquery result

Submitted: 5 Jul 2021 2:50 Modified: 5 Jul 2021 5:00
Reporter: deng yl (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.0.25, 5.7.34 OS:Ubuntu (20.04)
Assigned to: CPU Architecture:x86 (6 core * 2 threads)

[5 Jul 2021 2:50] deng yl
Description:
Wrong result when compare 'null' with subquery result.

How to repeat:
testcase like below:

create dabase test;

create table t1(c1 int, c2 int);

insert into t1 values(10, 10);

select ('a',null) <=> (select 'a',c2 from t1 where c2 = 0);
('a',null) <=> (select 'a',c2 from t1 where c2 = 0)
0

truncate t1;

select ('a',null) <=> (select 'a',c2 from t1 where c2 = 0);
('a',null) <=> (select 'a',c2 from t1 where c2 = 0)
1
[5 Jul 2021 5:00] MySQL Verification Team
Hello deng yl,

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.049 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.