1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user

variable

Analysis:
Since the item is NULL, it's json value is NULL but we proceed to parse
it anyway.
Fix:
If json value is NULL, return NULL.
This commit is contained in:
Rucha Deodhar
2023-12-15 16:06:24 +05:30
parent 187cbfca7c
commit fa2e1c3948
3 changed files with 24 additions and 5 deletions

View File

@ -4737,4 +4737,11 @@ NULL
#
PREPARE s FROM 'SELECT JSON_SCHEMA_VALID (?,''{}'') FROM DUAL';
ERROR HY000: Variable schema is not supported.
#
# MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user variable
#
SET @a= NULL;
SELECT JSON_SCHEMA_VALID(@a,'{}');
JSON_SCHEMA_VALID(@a,'{}')
NULL
# End of 11.1 test