summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-09-13 00:36:09 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-09-13 00:36:09 +0400
commita237a920991f417e9a4567957f4fc7aa5b538270 (patch)
treec93f776ab05c6f731d50e394a0267db3f100e276 /sql/item_jsonfunc.cc
parent80a38372832b391488a09c71a260334b23e5c98e (diff)
downloadmariadb-git-a237a920991f417e9a4567957f4fc7aa5b538270.tar.gz
MDEV-12877 Wrong result from JSON native function.
Set default charset for temporary paths so UDF call don't crash.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 9295c34aba9..a39b5f3f263 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -650,6 +650,7 @@ static int alloc_tmp_paths(THD *thd, uint n_paths,
if (*tmp_paths == 0)
{
MEM_ROOT *root= thd->stmt_arena->mem_root;
+
*paths= (json_path_with_flags *) alloc_root(root,
sizeof(json_path_with_flags) * n_paths);
*tmp_paths= (String *) alloc_root(root, sizeof(String) * n_paths);
@@ -657,6 +658,8 @@ static int alloc_tmp_paths(THD *thd, uint n_paths,
return 1;
bzero(*tmp_paths, sizeof(String) * n_paths);
+ for (uint c_path=0; c_path < n_paths; c_path++)
+ (*tmp_paths)[c_path].set_charset(&my_charset_utf8_general_ci);
}
return 0;