1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"

Analysis: null_value is not set if any one of the arguments is NULL. So it
returns 1.
Fix: when either argument is NULL, set null_value to true, so that null can
be returned
This commit is contained in:
Rucha Deodhar
2023-05-02 16:34:07 +05:30
parent 97675570ca
commit 4e5b771e98
4 changed files with 33 additions and 6 deletions

View File

@@ -4704,4 +4704,16 @@ JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000))
0
Warnings:
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 2 to function 'json_schema_valid' at position 32
#
# MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
#
SELECT JSON_SCHEMA_VALID('{}', NULL);
JSON_SCHEMA_VALID('{}', NULL)
NULL
SELECT JSON_SCHEMA_VALID(NULL, '{}');
JSON_SCHEMA_VALID(NULL, '{}')
NULL
SELECT JSON_SCHEMA_VALID(NULL, NULL);
JSON_SCHEMA_VALID(NULL, NULL)
NULL
# End of 11.1 test