1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-17018 JSON_SEARCH and User-Defined Variables.

Item_func_json_search needs a member to store the path.
This commit is contained in:
Alexey Botchkov
2018-09-12 21:57:28 +04:00
parent c3124174c3
commit a93363022c
4 changed files with 18 additions and 2 deletions

View File

@ -796,3 +796,11 @@ JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6')
select json_array_append('[ ]', '$', 'aue');
json_array_append('[ ]', '$', 'aue')
["aue"]
#
# MDEV-17018 JSON_SEARCH and User-Defined Variables.
#
SET @`json` := '["A", [{"B": "1"}], {"C": "AB"}, {"D": "BC"}]', @`value` := 'AB';
SELECT JSON_SEARCH(@`json`, 'one', @`value`);
JSON_SEARCH(@`json`, 'one', @`value`)
"$[2].C"
SET @`json` := NULL, @`value` := NULL;