mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-12877 Wrong result from JSON native function.
Set default charset for temporary paths so UDF call don't crash.
This commit is contained in:
@ -650,6 +650,7 @@ static int alloc_tmp_paths(THD *thd, uint n_paths,
|
|||||||
if (*tmp_paths == 0)
|
if (*tmp_paths == 0)
|
||||||
{
|
{
|
||||||
MEM_ROOT *root= thd->stmt_arena->mem_root;
|
MEM_ROOT *root= thd->stmt_arena->mem_root;
|
||||||
|
|
||||||
*paths= (json_path_with_flags *) alloc_root(root,
|
*paths= (json_path_with_flags *) alloc_root(root,
|
||||||
sizeof(json_path_with_flags) * n_paths);
|
sizeof(json_path_with_flags) * n_paths);
|
||||||
*tmp_paths= (String *) alloc_root(root, sizeof(String) * 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;
|
return 1;
|
||||||
|
|
||||||
bzero(*tmp_paths, sizeof(String) * n_paths);
|
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;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user