- Fix MDEV-25715

modified:   storage/connect/bsonudf.cpp
    modified:   storage/connect/jsonudf.cpp
This commit is contained in:
Olivier Bertrand 2021-05-18 16:42:19 +02:00
parent 17533c1ffc
commit e0edfc277f
2 changed files with 6 additions and 6 deletions

View file

@ -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");

View file

@ -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");