Skip to content
Permalink
Browse files
- Fix MDEV-25715
    modified:   storage/connect/bsonudf.cpp
    modified:   storage/connect/jsonudf.cpp
  • Loading branch information
Buggynours committed May 18, 2021
1 parent 17533c1 commit e0edfc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
@@ -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");

0 comments on commit e0edfc2

Please sign in to comment.