Skip to content

Commit

Permalink
db_mongodb: catch the null values and set the type to DB1_STRING
Browse files Browse the repository at this point in the history
- avoid the log message on unhandled type

(cherry picked from commit a5781fc)
  • Loading branch information
miconda committed May 17, 2019
1 parent fcf6fd6 commit 353192c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/db_mongodb/mongodb_dbase.c
Expand Up @@ -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:
Expand Down

0 comments on commit 353192c

Please sign in to comment.