Browse code

modules_k/rls: Fixed broken SQL query in RLS

- Fix by Hugh Waite @ Crocodile RCS

Peter Dunkley authored on 01/05/2012 13:22:27
Showing 1 changed files
... ...
@@ -119,7 +119,7 @@ int delete_expired_subs_rlsdb( void )
119 119
 	db_op_t query_ops[1];
120 120
 	db_row_t *rows;
121 121
 	db1_res_t *result = NULL;
122
-	int n_query_cols = 0, n_result_cols = 0, n_update_cols = 0;
122
+	int n_query_cols = 0, n_result_cols = 0;
123 123
 	int r_callid_col = 0, r_to_tag_col = 0, r_from_tag_col = 0;
124 124
 	int i;
125 125
 	subs_t subs;
... ...
@@ -206,14 +206,13 @@ int delete_expired_subs_rlsdb( void )
206 206
 		query_vals[n_query_cols].val.str_val = subs.from_tag;
207 207
 		n_query_cols++;
208 208
 
209
-		update_cols[n_update_cols] = &str_updated_col;
210
-		update_vals[n_update_cols].type = DB1_INT;
211
-		update_vals[n_update_cols].nul = 0;
212
-		update_vals[n_update_cols].val.int_val = subs.updated;
213
-		n_update_cols++;
209
+		update_cols[0] = &str_updated_col;
210
+		update_vals[0].type = DB1_INT;
211
+		update_vals[0].nul = 0;
212
+		update_vals[0].val.int_val = subs.updated;
214 213
 
215 214
 		if(rls_dbf.update(rls_db, query_cols, 0, query_vals,
216
-			update_cols,update_vals,n_query_cols,n_update_cols) < 0)
215
+			update_cols,update_vals,n_query_cols, 1) < 0)
217 216
 		{
218 217
 			LM_ERR("db update failed for expired subs\n");
219 218
 			goto error;