Skip to content

Commit

Permalink
Accept BIGINT also for table version
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu committed Jun 3, 2019
1 parent cd7fe92 commit dafa8f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db/db.c
Expand Up @@ -444,15 +444,19 @@ int db_table_version(const db_func_t* dbf, db_con_t* connection, const str* tabl
}

ver = ROW_VALUES(RES_ROWS(res));
if ( VAL_TYPE(ver)!=DB_INT || VAL_NULL(ver) ) {
if ((VAL_TYPE(ver)!=DB_INT && VAL_TYPE(ver)!=DB_BIGINT) || VAL_NULL(ver)) {
LM_ERR("invalid type (%d) or nul (%d) version "
"columns for %.*s\n", VAL_TYPE(ver), VAL_NULL(ver),
table->len, ZSW(table->s));
dbf->free_result(connection, res);
return -1;
}

ret = VAL_INT(ver);
if (VAL_TYPE(ver)==DB_INT)
ret = VAL_INT(ver);
else
ret = (int)VAL_BIGINT(ver);

dbf->free_result(connection, res);
return ret;
}
Expand Down

0 comments on commit dafa8f6

Please sign in to comment.