1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-31599: Assertion `0' failed in Item_param::can_return_value

from Item::val_json, UBSAN: member access within null pointer of
type 'struct String' in sql/item_jsonfunc.cc

Analysis:
The first argument of json_schema_valid() needs to be a constant.
Fix:
Parse the schema if the item is constant otherwise set it to return null.
This commit is contained in:
Rucha Deodhar
2023-09-19 00:54:19 +05:30
parent 855356ca6d
commit 5d3e14d780
4 changed files with 27 additions and 3 deletions

View File

@ -3647,4 +3647,13 @@ SELECT JSON_SCHEMA_VALID('{}', NULL);
SELECT JSON_SCHEMA_VALID(NULL, '{}');
SELECT JSON_SCHEMA_VALID(NULL, NULL);
--echo #
--echo # MDEV-31599: Assertion `0' failed in Item_param::can_return_value from Item::val_json,
--echo # UBSAN: member access within null pointer of type 'struct String' in
--echo # sql/item_jsonfunc.cc
--echo #
--error ER_JSON_NO_VARIABLE_SCHEMA
PREPARE s FROM 'SELECT JSON_SCHEMA_VALID (?,''{}'') FROM DUAL';
--echo # End of 11.1 test