Skip to content

Commit

Permalink
drouting: Allow 64-bit integers for dr_rules.sort_profile
Browse files Browse the repository at this point in the history
This allows SQL views to represent the NULL value as a 64-bit integer
without getting rejected by OpenSIPS, which expected a 32-bit integer
for that column.

Admittedly, any 64-bit integer "sort profile" will now be truncated to
32 bits, but OpenSIPS had no full support for 64-bit sort profile values
in the first place, so it's better to just truncate and NOT error.
  • Loading branch information
liviuchircu committed Nov 23, 2021
1 parent e377a90 commit 7fb5ddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/drouting/dr_load.c
Expand Up @@ -671,7 +671,7 @@ rt_data_t* dr_load_routing_info(struct head_db *part,
ROW_VALUES(row)+7);
}
/* SORT_PROFILE column */
check_val(sort_profile_drr_col, ROW_VALUES(row)+8, DB_INT, 0, 0);
check_val2(sort_profile_drr_col, ROW_VALUES(row)+8, DB_INT, DB_BIGINT, 0, 0);
int_vals[INT_VALS_QR_PROFILE_DRR_COL] = VAL_INT(ROW_VALUES(row)+8);
/* ATTRS column */
check_val2( attrs_drr_col, ROW_VALUES(row)+9, DB_STRING, DB_BLOB, 0, 0);
Expand Down

0 comments on commit 7fb5ddf

Please sign in to comment.