Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
Unexpected results
Description
JSON_SCHEMA_VALID() is returning incorrect result with JSON having array of objects.
For this schema
{
|
"type": "object",
|
"properties":
|
{
|
"id": {
|
"type": "string",
|
"minLength": 1
|
},
|
"arr_fields": {
|
"type": "array",
|
"items": {
|
"type": "object",
|
"properties": {
|
"field1": {
|
"type": "string"
|
},
|
"field2": {
|
"type": "number"
|
}
|
},
|
"required": ["field1"]
|
}
|
}
|
}
|
}
|
and the json value
{
|
"id": "zero",
|
"arr_fields": [
|
{
|
"field1": "A",
|
"field2": 123
|
},
|
{
|
"field1": "A"
|
}
|
]
|
}
|
JSON_SCHEMA_VALID(@schema, @value) returns false. Where as https://www.jsonschemavalidator.net/ as well as MYSQL return true for the same.
The testcase is similar to the one from https://jira.mariadb.org/browse/MDEV-38033. However, the field1 value in both the objects is same i.e. "A"
Attachments
Issue Links
- blocks
-
MDEV-40891 Re-enable JSON_SCHEMA_VALID checks in optimizer context tests
-
- Open
-