1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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

@ -3708,4 +3708,12 @@ SELECT JSON_SCHEMA_VALID(NULL, NULL);
--error ER_JSON_NO_VARIABLE_SCHEMA
PREPARE s FROM 'SELECT JSON_SCHEMA_VALID (?,''{}'') FROM DUAL';
--echo #
--echo # MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user variable
--echo #
SET @a= NULL;
SELECT JSON_SCHEMA_VALID(@a,'{}');
--echo # End of 11.1 test