Browse code

acc: set again the type of db vals

- work properly when nullable modparam is set and var can be null on
some transactions

(cherry picked from commit 908ca872bec956d5f755a1b51df781bf66ad3866)

Daniel-Constantin Mierla authored on 13/11/2021 19:31:38
Showing 1 changed files
... ...
@@ -464,6 +464,9 @@ int acc_db_request( struct sip_msg *rq)
464 464
 			LM_DBG("attr[%d] is NULL\n", i);
465 465
 			VAL_NULL(db_vals + i) = 1;
466 466
 		} else {
467
+			LM_DBG("attr[%d] is STR len=%d\n", i, val_arr[i].len);
468
+			VAL_NULL(db_vals+i) = 0;
469
+			VAL_TYPE(db_vals+i)=DB1_STR;
467 470
 			VAL_STR(db_vals+i) = val_arr[i];
468 471
 		}
469 472
 	}
... ...
@@ -499,6 +502,8 @@ int acc_db_request( struct sip_msg *rq)
499 502
 			if (acc_extra_nullable == 1 && type_arr[i] == TYPE_NULL) {
500 503
 					VAL_NULL(db_vals + i) = 1;
501 504
 				} else {
505
+					VAL_NULL(db_vals+i) = 0;
506
+					VAL_TYPE(db_vals+i)=DB1_STR;
502 507
 					VAL_STR(db_vals+i)=val_arr[i];
503 508
 				}
504 509
 			}