Commit 825c8d79 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-12774 JSON_EXTRACT fails with some escaped unicode as key.

        Tests added.
parent 30db4e1f
......@@ -686,3 +686,13 @@ JSON_SET('{}', '$.age', 87)
SELECT JSON_MERGE('[]', '{"c":"d"}');
JSON_MERGE('[]', '{"c":"d"}')
[{"c": "d"}]
SET @str = "{\"\\u00e4\\u00f6\":\"yes\"}";
SET @path = "$.\"\\u00e4\\u00f6\"";
select @str, @path, JSON_EXTRACT(@str, @path);
@str @path JSON_EXTRACT(@str, @path)
{"\u00e4\u00f6":"yes"} $."\u00e4\u00f6" "yes"
SET @str = "{\"\\u00e4\":\"yes\"}";
SET @path = "$.\"\\u00e4\"";
select @str, @path, JSON_EXTRACT(@str, @path);
@str @path JSON_EXTRACT(@str, @path)
{"\u00e4":"yes"} $."\u00e4" "yes"
......@@ -338,3 +338,14 @@ SELECT JSON_SET('{}', '$.age', 87);
#
SELECT JSON_MERGE('[]', '{"c":"d"}');
#
# MDEV-12774 JSON_EXTRACT fails with some escaped unicode as key.
#
SET @str = "{\"\\u00e4\\u00f6\":\"yes\"}";
SET @path = "$.\"\\u00e4\\u00f6\"";
select @str, @path, JSON_EXTRACT(@str, @path);
SET @str = "{\"\\u00e4\":\"yes\"}";
SET @path = "$.\"\\u00e4\"";
select @str, @path, JSON_EXTRACT(@str, @path);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment