Bug #108659 multi-valued index get wrong result
Submitted: 30 Sep 2022 7:18 Modified: 30 Sep 2022 9:53
Reporter: x j Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any

[30 Sep 2022 7:18] x j
Description:
multi-valued index get wrong result when using or not using index

How to repeat:
drop table t;
create table t(a int, b char(10), c json, index idx((cast(c->'$.a' as unsigned Array))));
insert into t values (1, 'a', '{"a": [1, 2, 3]}');

select * from t ignore index(idx) where json_contains(c->'$.a', '"1"');
nothing

select * from t force index(idx) where json_contains(c->'$.a', '"1"');
1,a,"{""a"": [1, 2, 3]}"
[30 Sep 2022 9:53] MySQL Verification Team
Hello x j,

Thank you for the report and test case.

regards,
Umesh