Skip to content

Commit

Permalink
domain: allow 'type' field in domain_attrs to be a DB1_BIGINT
Browse files Browse the repository at this point in the history
- in addition to allowing DB1_INT
- makes it work with MySQL views on 64bit systems
- based on a patch by divereigh, GH#182
  • Loading branch information
miconda committed Jun 19, 2015
1 parent e0e6994 commit e6f3a51
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/domain/domain.c
Expand Up @@ -362,11 +362,16 @@ int reload_tables ( void )
}

if ((VAL_NULL(ROW_VALUES(row) + 2) == 1) ||
(VAL_TYPE(ROW_VALUES(row) + 2) != DB1_INT)) {
((VAL_TYPE(ROW_VALUES(row) + 2) != DB1_INT) &&
(VAL_TYPE(ROW_VALUES(row) + 2) != DB1_BIGINT))) {
LM_ERR("type at row <%u> is null or not int\n", i);
goto err;
}
type = (int)VAL_INT(ROW_VALUES(row) + 2);
if(VAL_TYPE(ROW_VALUES(row) + 2) == DB1_BIGINT) {
type = (int)VAL_BIGINT(ROW_VALUES(row) + 2);
} else {
type = (int)VAL_INT(ROW_VALUES(row) + 2);
}
if ((type != 0) && (type != 2)) {
LM_ERR("unknown type <%d> at row <%u>\n", type, i);
goto err;
Expand Down

0 comments on commit e6f3a51

Please sign in to comment.