summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-05-02 14:28:57 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-05-02 14:28:57 +0400
commit42ad4f2821112be4e7bb4ca6d407cc72f9df6f8d (patch)
treee5a18f18bd7b772595cfd05ad729ee6c812b7170 /sql/item_jsonfunc.cc
parent7afcee4cf66c73ae3f9c5f04763b4b7a1d37e419 (diff)
downloadmariadb-git-42ad4f2821112be4e7bb4ca6d407cc72f9df6f8d.tar.gz
MDEV-12364 Server crashes in __memcpy_sse2_unaligned / String::copy on
JSON_SEARCH with variables. Wrong index for the tmp_paths array in Item_func_json_search::val_str.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index b8471dc8244..caacd189664 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -2898,7 +2898,7 @@ String *Item_func_json_search::val_str(String *str)
json_path_with_flags *c_path= paths + n_arg - 4;
if (!c_path->parsed)
{
- String *s_p= args[n_arg]->val_str(tmp_paths + (n_arg-1));
+ String *s_p= args[n_arg]->val_str(tmp_paths + (n_arg-4));
if (s_p &&
json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(),
(const uchar *) s_p->ptr() + s_p->length()))