1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-30689: JSON_SCHEMA_VALID for type=array return 1 for any string that

starts with '['

Analysis:
When type is non-scalar and the json document has syntax error
then it is not detected during validating type. And Since other validate
functions take const argument, the error state is not stored eventually.
Fix:
After we run out of all schemas (in case of no error during validation) from
the schema list, go over the json document until there is error in parsing
or json doc has ended.
This commit is contained in:
Rucha Deodhar
2023-04-25 13:54:05 +05:30
parent 3ef111610b
commit 97675570ca
4 changed files with 69 additions and 1 deletions

View File

@@ -443,6 +443,11 @@ int json_normalize(DYNAMIC_STRING *result,
int json_skip_array_and_count(json_engine_t *j, int* n_item);
inline static int json_scan_ended(json_engine_t *j)
{
return (j->state == JST_ARRAY_END && j->stack_p == 0);
}
#ifdef __cplusplus
}
#endif