1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-13306 JSON_CONTAINS returns wrong value.

The 'value' state should be saved to be compared against the
        next array item.
This commit is contained in:
Alexey Botchkov
2017-10-05 23:23:39 +04:00
parent 08c493c62a
commit 1f6ada8da8
3 changed files with 11 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ select json_contains('[1, {"a":1}]', '{}');
select json_contains('[1, {"a":1}]', '{"a":1}');
select json_contains('[{"abc":"def", "def":"abc"}]', '["foo","bar"]');
select json_contains('[{"abc":"def", "def":"abc"}, "bar"]', '["bar", {}]');
select json_contains('[{"a":"b"},{"c":"d"}]','{"c":"d"}');
select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]");
select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[10]");