summaryrefslogtreecommitdiff
path: root/storage/connect/bsonudf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/bsonudf.cpp')
-rw-r--r--storage/connect/bsonudf.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index 29fe0a6bf22..90ef36e3269 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -87,6 +87,7 @@ static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp)
/*********************************************************************************/
/* SubAlloc a new BJNX class with protection against memory exhaustion. */
/*********************************************************************************/
+#ifdef NOT_USED
static PBJNX BjnxNew(PGLOBAL g, PBVAL vlp, int type, int len)
{
PBJNX bjnx;
@@ -103,7 +104,7 @@ static PBJNX BjnxNew(PGLOBAL g, PBVAL vlp, int type, int len)
return bjnx;
} /* end of BjnxNew */
-
+#endif
/* ----------------------------------- BSNX ------------------------------------ */
/*********************************************************************************/
@@ -320,7 +321,7 @@ my_bool BJNX::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
@@ -529,6 +530,7 @@ void BJNX::SetJsonValue(PGLOBAL g, PVAL vp, PBVAL vlp)
break;
case TYPE_NULL:
vp->SetNull(true);
+ /* fall through */
default:
vp->Reset();
} // endswitch Type
@@ -572,7 +574,6 @@ PVAL BJNX::GetColumnValue(PGLOBAL g, PBVAL row, int i)
/*********************************************************************************/
PBVAL BJNX::GetRowValue(PGLOBAL g, PBVAL row, int i)
{
- my_bool expd = false;
PBVAL bap;
PBVAL vlp = NULL;
@@ -1115,7 +1116,7 @@ my_bool BJNX::CheckPath(PGLOBAL g, UDF_ARGS *args, PBVAL jsp, PBVAL& jvp, int n)
PSZ BJNX::Locate(PGLOBAL g, PBVAL jsp, PBVAL jvp, int k)
{
PSZ str = NULL;
- my_bool b = false, err = true;
+ my_bool err = true;
g->Message[0] = 0;
@@ -1236,7 +1237,7 @@ my_bool BJNX::LocateValue(PGLOBAL g, PBVAL jvp)
PSZ BJNX::LocateAll(PGLOBAL g, PBVAL jsp, PBVAL bvp, int mx)
{
PSZ str = NULL;
- my_bool b = false, err = true;
+ my_bool err = true;
PJPN jnp;
if (!jsp) {
@@ -2926,7 +2927,7 @@ my_bool bson_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return true;
PGLOBAL g = (PGLOBAL)initid->ptr;
- PBJNX bxp = new(g) BJNX(g);
+ (void) new(g) BJNX(g);
JsonMemSave(g);
return false;
@@ -2999,7 +3000,7 @@ my_bool bson_object_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return true;
PGLOBAL g = (PGLOBAL)initid->ptr;
- PBJNX bxp = new(g) BJNX(g);
+ (void) new(g) BJNX(g);
JsonMemSave(g);
return false;
@@ -3069,7 +3070,7 @@ my_bool bson_test_init(UDF_INIT* initid, UDF_ARGS* args, char* message) {
char* bson_test(UDF_INIT* initid, UDF_ARGS* args, char* result,
unsigned long* res_length, char* is_null, char* error) {
- char* str = NULL, * sap = NULL, * fn = NULL;
+ char* str = NULL, * fn = NULL;
int pretty = 1;
PBVAL bvp;
PGLOBAL g = (PGLOBAL)initid->ptr;
@@ -5067,7 +5068,7 @@ char* bbin_array_add_values(UDF_INIT* initid, UDF_ARGS* args, char* result,
if (!CheckMemory(g, initid, args, args->arg_count, true)) {
uint i = 0;
BJNX bnx(g);
- PBVAL arp, top, jvp = NULL;
+ PBVAL arp, top;
PBVAL bvp = bnx.MakeValue(args, 0, true, &top);
if (bvp->Type == TYPE_JAR) {
@@ -5691,7 +5692,7 @@ char *bbin_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (g->Xchk) {
bsp = (PBSON)g->Xchk;
} else if (!CheckMemory(g, initid, args, 1, true, true)) {
- char *path = MakePSZ(g, args, 1);
+ // char *path = MakePSZ(g, args, 1);
BJNX bnx(g, NULL, TYPE_STRING, initid->max_length);
PBVAL top, jvp = NULL;
PBVAL jsp = bnx.MakeValue(args, 0, true, &top);