diff options
author | Monty <monty@mariadb.org> | 2019-08-08 22:52:22 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-08-23 22:03:54 +0200 |
commit | a38f47e90ce8273e83b4151cd93a0a224420f69b (patch) | |
tree | 3faafa530d602fe2440dfaf13dec4ad23e24c265 /storage/connect/jsonudf.cpp | |
parent | de8b51fdc9d998fdf9c2d5c317a6da063c73d84a (diff) | |
download | mariadb-git-a38f47e90ce8273e83b4151cd93a0a224420f69b.tar.gz |
Fixed compiler warnings from connect engine
- clang complains about register in C++
- Removed not used variables
- Fixed bug when printing date in filamdbf.cpp
- Added {} to fix warning about dangling else
- Changed connect_done_func() to be global to remove conflict with header
files
- Added extra () around assignment in if
Diffstat (limited to 'storage/connect/jsonudf.cpp')
-rw-r--r-- | storage/connect/jsonudf.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index d521322edb6..c634d722c31 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -247,7 +247,7 @@ my_bool JSNX::ParseJpath(PGLOBAL g) { char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL; int i; - my_bool a, mul = false; + my_bool a; if (Parsed) return false; // Already done @@ -424,7 +424,6 @@ PVAL JSNX::GetColumnValue(PGLOBAL g, PJSON row, int i) /*********************************************************************************/ PJVAL JSNX::GetRowValue(PGLOBAL g, PJSON row, int i, my_bool b) { - my_bool expd = false; PJAR arp; PJVAL val = NULL; @@ -763,7 +762,7 @@ my_bool JSNX::WriteValue(PGLOBAL g, PJVAL jvalp) PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k) { PSZ str = NULL; - my_bool b = false, err = true; + my_bool err = true; g->Message[0] = 0; @@ -885,7 +884,7 @@ my_bool JSNX::LocateValue(PJVAL jvp) PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx) { PSZ str = NULL; - my_bool b = false, err = true; + my_bool err = true; PJPN jnp; if (!jsp) { @@ -1352,7 +1351,7 @@ static PBSON MakeBinResult(PGLOBAL g, UDF_ARGS *args, PJSON top, ulong len, int bsnp->Pretty = pretty; - if (bsnp->Filename = (char*)args->args[0]) { + if ((bsnp->Filename = (char*)args->args[0])) { bsnp->Filename = MakePSZ(g, args, 0); strncpy(bsnp->Msg, bsnp->Filename, BMX); } else @@ -3755,11 +3754,13 @@ my_bool jsonlocate_init(UDF_INIT *initid, UDF_ARGS *args, char *message) strcpy(message, "Third argument is not an integer (rank)"); return true; } else if (args->arg_count > 3) + { if (args->arg_type[3] != INT_RESULT) { strcpy(message, "Fourth argument is not an integer (memory)"); return true; } else more += (ulong)*(longlong*)args->args[2]; + } CalcLen(args, false, reslen, memlen); @@ -5178,7 +5179,7 @@ char *jbin_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, PCSZ key; PJOB jobp; PJVAL jvp = MakeValue(g, args, 0, &top); - PJSON jsp = jvp->GetJson(); + (void) jvp->GetJson(); // XXX Should be removed? if (CheckPath(g, args, top, jvp, 2)) PUSH_WARNING(g->Message); @@ -5889,7 +5890,7 @@ long long countin(UDF_INIT *initid, UDF_ARGS *args, char *result, memcpy(str2, args->args[1], lg); str2[lg] = 0; - while (s = strstr(s, str2)) { + while ((s = strstr(s, str2))) { n++; s += lg; } // endwhile |