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

MDEV-11489 Assertion `0' failed in json_find_path.

When the json was just a scalar value, json_extract tried
        to parse after the value ended.
This commit is contained in:
Alexey Botchkov
2016-12-08 11:25:21 +04:00
parent 9ea5de3096
commit 7f6710e5be
3 changed files with 14 additions and 9 deletions

View File

@ -138,6 +138,9 @@ json_extract('[10, 20, [30, 40]]', '$[2][*]')
select json_extract('[10, 20, [{"a":3}, 30, 40]]', '$[2][*]');
json_extract('[10, 20, [{"a":3}, 30, 40]]', '$[2][*]')
[{"a":3}, 30, 40]
select json_extract('1', '$');
json_extract('1', '$')
1
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word');
json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word')
{"a":1, "b":{"c":1, "k1":"word"}, "d":[1, 2]}