Conversation
DerZc
force-pushed
the
fix-mdev-41067
branch
from
September 21, 2026 05:59
1426055 to
049d258
Compare
mariadb-YuchenPei
self-requested a review
September 21, 2026 06:49
gkodinov
requested changes
Sep 23, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
Please squash your two commits into a single one. Otherwise: a very good analysis and a good looking fix!
…has an empty nested array element
JSON_OVERLAPS can report an overlap between unequal nested arrays,
including JSON_OVERLAPS('[[1]]','[[]]'), which must return 0.
The nested-container comparison treats reaching the end of one input as
sufficient for equality, without also requiring the other input to reach
its matching end.
Require both JSON parser states to be at their array/object end before
accepting the nested-container match. Retain the existing cleanup that
advances both parsers after the comparison.
The regression checks that [[1]] and [[]] have no equal nested element
and that JSON_OVERLAPS returns 0.
Bug report: https://jira.mariadb.org/browse/MDEV-41067
DerZc
force-pushed
the
fix-mdev-41067
branch
from
September 24, 2026 13:26
4448f88 to
0f36c41
Compare
gkodinov
approved these changes
Sep 25, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Thank you! LGTM. Please stand by for the final review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON_OVERLAPS can report an overlap between unequal nested arrays, including JSON_OVERLAPS('[[1]]','[[]]'), which must return 0.
Bug report: https://jira.mariadb.org/browse/MDEV-41067
Root cause
The nested-container comparison treats reaching the end of one input as sufficient for equality, without also requiring the other input to reach its matching end.
Changes
Regression coverage
The regression is integrated into the existing
main.func_jsontest.The regression checks that [[1]] and [[]] have no equal nested element and that JSON_OVERLAPS returns 0.
mysql-test/main/func_json.testmysql-test/main/func_json.resultValidation
On
11.4atd10e5d726799b1cd57cc866f40aad68c720803da:main.func_jsontest, including the integrated regression, failed on the unchanged target branch at the regression case and passed with this fix.main.func_json,main.select.