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

MDEV-29188 Crash in JSON_EXTRACT

If we have null_value set then decimal/string value/result shoud be 0 pointer.
This commit is contained in:
Oleksandr Byelkin
2022-07-28 16:17:03 +02:00
parent 4b77d38c26
commit cbcc0101ee
4 changed files with 34 additions and 3 deletions

View File

@ -1005,5 +1005,16 @@ JSON_VALID('{"admin\\"": null}') {"admin\"": null}
1 {"\"admin": null}
1 {"\"": null}
#
# MDEV-29188: Crash in JSON_EXTRACT
#
CREATE TABLE t1 (j JSON);
INSERT INTO t1 VALUES
('{"ID": "4", "Name": "Betty", "Age": 19}'),
('[10, 20, [30, 40]]');
SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
j
{"ID": "4", "Name": "Betty", "Age": 19}
drop table t1;
#
# End of 10.3 tests
#