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