diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2017-09-12 11:20:30 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2017-09-12 11:20:30 +0400 |
commit | 6352ec2184dc8e5744aed3f718fc635edb4b511f (patch) | |
tree | 384d91f8b9745139274528db590fc01538726759 /sql/item_jsonfunc.cc | |
parent | 31774f0ede81d77d889061324930d3d0066c653a (diff) | |
download | mariadb-git-6352ec2184dc8e5744aed3f718fc635edb4b511f.tar.gz |
MDEV-12982 JSON_EXTRACT returns data for invalid JSON.
Let's check the validity to the end of the JSON.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r-- | sql/item_jsonfunc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index c2a9ca28c99..c30ce45bfb2 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -821,7 +821,11 @@ String *Item_func_json_extract::read_json(String *str, not_first_value= 1; if (!possible_multiple_values) + { + /* Loop to the end of the JSON just to make sure it's valid. */ + while (json_get_path_next(&je, &p) == 0) {} break; + } } if (je.s.error) |