Module: kamailio
Branch: 4.2
Commit: df4df4fbe8c742d960b0fdecd5a1e9967a96b58b
URL:
https://github.com/kamailio/kamailio/commit/df4df4fbe8c742d960b0fdecd5a1e99…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2015-02-16T13:27:06Z
usrloc - fix column types not initialized on update
some columns were not initialized on update leading to errors in update
ERROR: db_text [dbt_lib.c:464]: dbt_is_neq_type(): invalid datatype -1001432832
ERROR: db_text [dbt_base.c:560]: dbt_update(): incompatible types!
ERROR: db_text [dbt_base.c:599]: dbt_update(): failed to update the table!
(cherry picked from commit cf521e66825fea4b7498d615d435739628fe4c09)
---
Modified: modules/usrloc/ucontact.c
---
Diff:
https://github.com/kamailio/kamailio/commit/df4df4fbe8c742d960b0fdecd5a1e99…
Patch:
https://github.com/kamailio/kamailio/commit/df4df4fbe8c742d960b0fdecd5a1e99…
---
diff --git a/modules/usrloc/ucontact.c b/modules/usrloc/ucontact.c
index cc1c2e5..d129472 100644
--- a/modules/usrloc/ucontact.c
+++ b/modules/usrloc/ucontact.c
@@ -831,9 +831,9 @@ int db_update_ucontact_addr(ucontact_t* _c)
nr_cols2++;
keys2[nr_cols2] = &ruid_col;
+ vals2[nr_cols2].type = DB1_STR;
if(_c->ruid.len>0)
{
- vals2[nr_cols2].type = DB1_STR;
vals2[nr_cols2].nul = 0;
vals2[nr_cols2].val.str_val = _c->ruid;
} else {
@@ -842,9 +842,9 @@ int db_update_ucontact_addr(ucontact_t* _c)
nr_cols2++;
keys2[nr_cols2] = &instance_col;
+ vals2[nr_cols2].type = DB1_STR;
if(_c->instance.len>0)
{
- vals2[nr_cols2].type = DB1_STR;
vals2[nr_cols2].nul = 0;
vals2[nr_cols2].val.str_val = _c->instance;
} else {
@@ -1043,9 +1043,9 @@ int db_update_ucontact_ruid(ucontact_t* _c)
n2++;
keys2[n2] = &instance_col;
+ vals2[n2].type = DB1_STR;
if(_c->instance.len>0)
{
- vals2[n2].type = DB1_STR;
vals2[n2].nul = 0;
vals2[n2].val.str_val = _c->instance;
} else {