mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-26392: Crash with json_get_path_next and 10.5.12
Analysis: When we skip level when path is found, it changes the state of the json engine. This breaks the sequence for json_get_path_next() which is called at the end to ensure json document is valid and leads to crash. Fix: Use json_scan_next() at the end to check if json document has correct syntax (is valid).
This commit is contained in:
@ -1054,6 +1054,18 @@ DROP TABLE t2;
|
||||
SELECT json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f')));
|
||||
SELECT json_object('a', coalesce(json_object('b', 'c')));
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26392: Crash with json_get_path_next and 10.5.12
|
||||
--echo #
|
||||
|
||||
CREATE TABLE arrNestTest (
|
||||
id VARCHAR(80) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY,
|
||||
doc JSON,
|
||||
CONSTRAINT id_not_null CHECK(id IS NOT NULL));
|
||||
|
||||
INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
|
||||
SELECT * FROM arrNestTest;
|
||||
DROP TABLE arrNestTest;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
|
Reference in New Issue
Block a user