[MDEV-29212] json_overlaps() does not check nested key-value pair correctly Created: 2022-07-30  Updated: 2022-08-29  Resolved: 2022-08-11

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.9
Fix Version/s: 10.9.2, 10.10.1

Type: Bug Priority: Major
Reporter: Rucha Deodhar Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None


 Description   

This bug was pointed out by GSoC student working on JSON_INTERSECT().
JSON_OVERLAPS() does not check entire value for nested keys.

SET @json1 = '{"kk":{"k1":"v1","k2":"v2"}}';
SET @json2 = '{"kk":{"k1":"v1","k2":"v2","k3":"v3"}}';
Example:
SELECT JSON_OVERLAPS(@json2, @json1);
JSON_OVERLAPS(@json2, @json1)
1

vs

SELECT JSON_OVERLAPS(@json1, @json2);
JSON_OVERLAPS(@json1, @json2)
0

Both should give 0



 Comments   
Comment by Rucha Deodhar [ 2022-07-30 ]

Patch:
https://github.com/MariaDB/server/commit/f253426346f5573178512c486d3ea0a23f3d2eeb

Comment by Alexey Botchkov [ 2022-08-11 ]

ok to push with few corrections in the patch comment.

Generated at Thu Feb 08 10:06:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.