Commit e0edfc27 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix MDEV-25715

    modified:   storage/connect/bsonudf.cpp
    modified:   storage/connect/jsonudf.cpp
parent 17533c1f
......@@ -4682,7 +4682,7 @@ char *bfile_convert(UDF_INIT* initid, UDF_ARGS* args, char* result,
str = (char*)g->Xchk;
if (!str) {
PUSH_WARNING(g->Message ? g->Message : "Unexpected error");
PUSH_WARNING(*g->Message ? g->Message : "Unexpected error");
*is_null = 1;
*error = 1;
*res_length = 0;
......@@ -4742,7 +4742,7 @@ char *bfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!g->Xchk) {
int msgid = MSGID_OPEN_MODE_STRERROR;
FILE *fout;
FILE *fout = NULL;
FILE *fin;
if (!(fin = global_fopen(g, msgid, fn, "rt")))
......@@ -4805,7 +4805,7 @@ char *bfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
str = (char*)g->Xchk;
if (!str) {
if (g->Message)
if (*g->Message)
str = strcpy(result, g->Message);
else
str = strcpy(result, "Unexpected error");
......
......@@ -5943,7 +5943,7 @@ char *jfile_convert(UDF_INIT* initid, UDF_ARGS* args, char* result,
str = (char*)g->Xchk;
if (!str) {
PUSH_WARNING(g->Message ? g->Message : "Unexpected error");
PUSH_WARNING(*g->Message ? g->Message : "Unexpected error");
*is_null = 1;
*error = 1;
*res_length = 0;
......@@ -6004,7 +6004,7 @@ char *jfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!g->Xchk) {
int msgid = MSGID_OPEN_MODE_STRERROR;
FILE *fout;
FILE *fout = NULL;
FILE *fin;
if (!(fin = global_fopen(g, msgid, fn, "rt")))
......@@ -6071,7 +6071,7 @@ char *jfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
str = (char*)g->Xchk;
if (!str) {
if (g->Message)
if (*g->Message)
str = strcpy(result, g->Message);
else
str = strcpy(result, "Unexpected error");
......
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