summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Hutchings <andrew@mariadb.org>2022-09-22 15:13:22 +0100
committerDaniel Black <daniel@mariadb.org>2022-10-26 16:50:46 +1100
commitfa5f26b422531c449e6a0c464865226af3b24636 (patch)
treefacc008685fc1efd60f3bc64f74ccbbb630e4c30
parent055cb3fcd1aec2a05908a312a2ae4dfd3a0d4d81 (diff)
downloadmariadb-git-fa5f26b422531c449e6a0c464865226af3b24636.tar.gz
MDEV-29578 Fix CONNECT build warnings
Fix a couple of build warnings that fire with CONNECT engine.
-rw-r--r--storage/connect/bsonudf.cpp8
-rw-r--r--storage/connect/filamdbf.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index e93f40eb509..2d9132e20ed 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -3571,14 +3571,14 @@ char *bson_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!CheckMemory(g, initid, args, 2, false, false, true)) {
JTYP type;
BJNX bnx(g);
- PBVAL jvp, top = NULL;
+ PBVAL jvp = NULL, top = NULL;
PBVAL jsp[2] = {NULL, NULL};
for (int i = 0; i < 2; i++) {
jvp = bnx.MakeValue(args, i, true);
if (i) {
- if (jvp->Type != type) {
+ if (jvp && (jvp->Type != type)) {
PUSH_WARNING("Argument types mismatch");
goto fin;
} // endif type
@@ -5722,14 +5722,14 @@ char *bbin_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!CheckMemory(g, initid, args, 2, false, false, true)) {
JTYP type;
BJNX bnx(g);
- PBVAL jvp, top = NULL;
+ PBVAL jvp = NULL, top = NULL;
PBVAL jsp[2] = {NULL, NULL};
for (int i = 0; i < 2; i++) {
if (i) {
jvp = bnx.MakeValue(args, i, true);
- if (jvp->Type != type) {
+ if (jvp && (jvp->Type != type)) {
PUSH_WARNING("Argument types mismatch");
goto fin;
} // endif type
diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp
index 4c3ec10062b..a4c2232b1bf 100644
--- a/storage/connect/filamdbf.cpp
+++ b/storage/connect/filamdbf.cpp
@@ -244,7 +244,7 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, PTOS topt, bool info)
int rc, type, len, field, fields;
bool bad, mul;
PCSZ target, pwd;
- DBFHEADER mainhead, *hp;
+ DBFHEADER mainhead, *hp = NULL;
DESCRIPTOR thisfield, *tfp;
FILE *infile = NULL;
UNZIPUTL *zutp = NULL;