Browse code

Merge pull request #86 from kamailio/lazedo/usrloc-patch

usrloc - fix column types not initialized on update

lazedo authored on 16/02/2015 13:26:28
Showing 1 changed files
... ...
@@ -824,9 +824,9 @@ int db_update_ucontact_addr(ucontact_t* _c)
824 824
 	nr_cols2++;
825 825
 
826 826
 	keys2[nr_cols2] = &ruid_col;
827
+	vals2[nr_cols2].type = DB1_STR;
827 828
 	if(_c->ruid.len>0)
828 829
 	{
829
-		vals2[nr_cols2].type = DB1_STR;
830 830
 		vals2[nr_cols2].nul = 0;
831 831
 		vals2[nr_cols2].val.str_val = _c->ruid;
832 832
 	} else {
... ...
@@ -835,9 +835,9 @@ int db_update_ucontact_addr(ucontact_t* _c)
835 835
 	nr_cols2++;
836 836
 
837 837
 	keys2[nr_cols2] = &instance_col;
838
+	vals2[nr_cols2].type = DB1_STR;
838 839
 	if(_c->instance.len>0)
839 840
 	{
840
-		vals2[nr_cols2].type = DB1_STR;
841 841
 		vals2[nr_cols2].nul = 0;
842 842
 		vals2[nr_cols2].val.str_val = _c->instance;
843 843
 	} else {
... ...
@@ -1036,9 +1036,9 @@ int db_update_ucontact_ruid(ucontact_t* _c)
1036 1036
 	n2++;
1037 1037
 
1038 1038
 	keys2[n2] = &instance_col;
1039
+	vals2[n2].type = DB1_STR;
1039 1040
 	if(_c->instance.len>0)
1040 1041
 	{
1041
-		vals2[n2].type = DB1_STR;
1042 1042
 		vals2[n2].nul = 0;
1043 1043
 		vals2[n2].val.str_val = _c->instance;
1044 1044
 	} else {