summaryrefslogtreecommitdiff
path: root/storage/connect/bsonudf.cpp
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 /storage/connect/bsonudf.cpp
parent055cb3fcd1aec2a05908a312a2ae4dfd3a0d4d81 (diff)
downloadmariadb-git-fa5f26b422531c449e6a0c464865226af3b24636.tar.gz
MDEV-29578 Fix CONNECT build warnings
Fix a couple of build warnings that fire with CONNECT engine.
Diffstat (limited to 'storage/connect/bsonudf.cpp')
-rw-r--r--storage/connect/bsonudf.cpp8
1 files changed, 4 insertions, 4 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