Module: kamailio
Branch: master
Commit: a5781fc4bb3063c6e7abf54d93178ef610617298
URL:
https://github.com/kamailio/kamailio/commit/a5781fc4bb3063c6e7abf54d93178ef…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-16T12:35:46+02:00
db_mongodb: catch the null values and set the type to DB1_STRING
- avoid the log message on unhandled type
---
Modified: src/modules/db_mongodb/mongodb_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a5781fc4bb3063c6e7abf54d93178ef…
Patch:
https://github.com/kamailio/kamailio/commit/a5781fc4bb3063c6e7abf54d93178ef…
---
diff --git a/src/modules/db_mongodb/mongodb_dbase.c
b/src/modules/db_mongodb/mongodb_dbase.c
index 8d88049919..db7f67c1e9 100644
--- a/src/modules/db_mongodb/mongodb_dbase.c
+++ b/src/modules/db_mongodb/mongodb_dbase.c
@@ -504,13 +504,18 @@ int db_mongodb_get_columns(const db1_con_t* _h, db1_res_t* _r)
RES_TYPES(_r)[col] = DB1_STRING;
break;
+ case BSON_TYPE_NULL:
+ /* 'null' value - default to type DB1_STRING */
+ LM_DBG("BSON_TYPE_NULL - use DB1_STRING result type\n");
+ RES_TYPES(_r)[col] = DB1_STRING;
+ break;
+
#if 0
case BSON_TYPE_EOD:
case BSON_TYPE_DOCUMENT:
case BSON_TYPE_ARRAY:
case BSON_TYPE_UNDEFINED:
case BSON_TYPE_OID:
- case BSON_TYPE_NULL:
case BSON_TYPE_REGEX:
case BSON_TYPE_DBPOINTER:
case BSON_TYPE_CODE: