Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Case:
SET @schema_array= '{"type":"array"}'; |
SELECT JSON_SCHEMA_VALID(@schema_array, '['); |
In case it is missed closing brace for array, but result is still 1:
JSON_SCHEMA_VALID(json_object(),'[[') |
1
|
Expected result:
JSON_SCHEMA_VALID(json_object(),'[[') |
0
|
Or maybe result+warning
The same problem presents for case:
SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object()); |
Actual result:
SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object()); |
JSON_SCHEMA_VALID(repeat('[', 100000), json_object()) |
1
|
Warnings:
|
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 2 to function 'json_schema_valid' at position 32 |
Expected result (result must be NULL):
SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object()); |
JSON_SCHEMA_VALID(repeat('[', 100000), json_object()) |
NULL
|
Warnings:
|
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 2 to function 'json_schema_valid' at position 32 |
Also after fix bug the following case should also be tested:
SELECT JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000)); |
Attachments
Issue Links
- is caused by
-
MDEV-27128 Implement JSON Schema Validation FUNCTION
- Closed