Module: kamailio Branch: master Commit: e6f3a512c599678fca08daca561bcad4c05add23 URL: https://github.com/kamailio/kamailio/commit/e6f3a512c599678fca08daca561bcad4...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-06-19T10:41:08+02:00
domain: allow 'type' field in domain_attrs to be a DB1_BIGINT
- in addition to allowing DB1_INT - makes it work with MySQL views on 64bit systems - based on a patch by divereigh, GH#182
---
Modified: modules/domain/domain.c
---
Diff: https://github.com/kamailio/kamailio/commit/e6f3a512c599678fca08daca561bcad4... Patch: https://github.com/kamailio/kamailio/commit/e6f3a512c599678fca08daca561bcad4...
---
diff --git a/modules/domain/domain.c b/modules/domain/domain.c index 19943ab..65b6aed 100644 --- a/modules/domain/domain.c +++ b/modules/domain/domain.c @@ -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;