Skip to content
/ server Public

MDEV-38033: JSON_SCHEMA_VALID returns wrong result for array of objects#4727

Open
abhishek593 wants to merge 1 commit intoMariaDB:12.1from
abhishek593:MDEV-38033-12.1
Open

MDEV-38033: JSON_SCHEMA_VALID returns wrong result for array of objects#4727
abhishek593 wants to merge 1 commit intoMariaDB:12.1from
abhishek593:MDEV-38033-12.1

Conversation

@abhishek593
Copy link

This PR fixes a bug in Json_schema_items::validate where it was missing a json_skip_level() call. Without this skip, the validator would incorrectly recurse into non-scalar array elements (like objects) and try to validate their internal keys/values against the array's item schema.

Changes:

  • Added json_skip_level() check for non-scalar array elements
  • Added Jira test to main.func_json

Fix a bug in Json_schema_items::validate where it was missing a
json_skip_level() call. Without this skip, the validator would
incorrectly recurse into non-scalar array elements (like objects)
and try to validate their internal keys/values against the array's
item schema.
@grooverdan grooverdan added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 3, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This is a preliminary review.

Please stay tuned for the final review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants