说明:本文中的MySQL,如果不做特殊说明,指的是开源社区版MySQL。
华为云数据库新版本在发布之前,会面临一系列严苛的测试规则,除了要求通过MySQL的所有测试用例之外,还需要通过由华为百万级更丰富、更贴近用户业务场景的测试用例构筑的测试防护网,以此充分验证新版本是否满足用户经典场景的稳定性。
正是在这样严苛的验证过程中,我们发现了MySQL的一个潜在Bug。
Bug描述
测试环境:
基于相同的测试用例、数据集,分别测试MySQL 8.0.22, MySQL 8.0.26,与华为云GaussDB(for MySQL)的返回结果。
测试语句:
select
subq_0.c2 as c0
from
(select
ref_6.C_STATE asc0,
case whenref_6.C_PHONE is not NULL then ref_5.C_ID else ref_5.C_ID end
asc1,
floor(
ref_3.c_id)as c2
from
sqltester.t0_hash_partition_p1_view as ref_0
right join sqltester.t4 as ref_1
on (EXISTS (
select
ref_1.c_middle as c0
from
sqltester.t1 as ref_2
where ((false)
and ((true)
or (true)))
or (false)
))
innerjoin sqltester.t0_range_key_subpartition_sub_view as ref_3
on(EXISTS (
select
ref_0.c_credit as c0,
ref_1.c_street_1 as c1,
ref_4.c_credit_lim as c2,
ref_3.c_credit as c3
from
sqltester.t0_hash_partition_p1 as ref_4
where true
))
left joinsqltester.t10 as ref_5
innerjoin sqltester.t11 as ref_6
on(true)