Module: kamailio
Branch: master
Commit: 1435618b71ed749bc33982a00c8caf6b8de7b80a
URL:
https://github.com/kamailio/kamailio/commit/1435618b71ed749bc33982a00c8caf6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-08-28T09:06:41+02:00
sqlops: number fields kept as long
---
Modified: src/modules/sqlops/sql_api.c
Modified: src/modules/sqlops/sql_api.h
---
Diff:
https://github.com/kamailio/kamailio/commit/1435618b71ed749bc33982a00c8caf6…
Patch:
https://github.com/kamailio/kamailio/commit/1435618b71ed749bc33982a00c8caf6…
---
diff --git a/src/modules/sqlops/sql_api.c b/src/modules/sqlops/sql_api.c
index 93a9b36528a..b76edbd480e 100644
--- a/src/modules/sqlops/sql_api.c
+++ b/src/modules/sqlops/sql_api.c
@@ -357,17 +357,17 @@ int sql_do_query(sql_con_t *con, str *query, sql_result_t *res)
case DB1_INT:
res->vals[i][j].flags = PV_VAL_INT;
res->vals[i][j].value.n =
- (int)RES_ROWS(db_res)[i].values[j].val.int_val;
+ (long)RES_ROWS(db_res)[i].values[j].val.int_val;
break;
case DB1_DATETIME:
res->vals[i][j].flags = PV_VAL_INT;
res->vals[i][j].value.n =
- (int)RES_ROWS(db_res)[i].values[j].val.time_val;
+ (long)RES_ROWS(db_res)[i].values[j].val.time_val;
break;
case DB1_BITMAP:
res->vals[i][j].flags = PV_VAL_INT;
res->vals[i][j].value.n =
- (int)RES_ROWS(db_res)[i].values[j].val.bitmap_val;
+ (long)RES_ROWS(db_res)[i].values[j].val.bitmap_val;
break;
case DB1_BIGINT:
res->vals[i][j].flags = PV_VAL_STR;
diff --git a/src/modules/sqlops/sql_api.h b/src/modules/sqlops/sql_api.h
index b1189561054..0051a61a53c 100644
--- a/src/modules/sqlops/sql_api.h
+++ b/src/modules/sqlops/sql_api.h
@@ -41,7 +41,7 @@ typedef struct _sql_col
typedef struct _sql_val
{
int flags;
- int_str value;
+ numstr_ut value;
} sql_val_t;
typedef struct _sql_result