Commit d059dd73 authored by Olivier Bertrand's avatar Olivier Bertrand

Fix memory error when a plain string argument is parsed.

Parsing memory, not added in CalcLen, is added in CheckMemory.
Adding also the file length.
  modified:   storage/connect/jsonudf.cpp
parent a6b8bfca
......@@ -1426,10 +1426,11 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
char *p = args->args[0];
// Is this a file name?
if (strchr("[{ \t\r\n", *p) || !(len = GetFileLength(p)))
len = args->lengths[0];
if (!strchr("[{ \t\r\n", *p) && (len = GetFileLength(p)))
ml += len * (M + 1);
else
ml += args->lengths[0] * M;
ml += len * M; // Was not done in CalcLen
} // endif b
if (ml > g->Sarea_Size) {
......
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