[sr-dev] git:master: sqlops: reset the result container before new query is executed
Daniel-Constantin Mierla
miconda at gmail.com
Tue Mar 4 17:34:50 CET 2014
Module: sip-router
Branch: master
Commit: 864127e6e02144c40c138d6921862b1512d01c66
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=864127e6e02144c40c138d6921862b1512d01c66
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Tue Mar 4 17:31:57 2014 +0100
sqlops: reset the result container before new query is executed
- it was lost in commit 9b62514b4a90e169c9126b7bda6d87cc4c213ad2
- reported by Jonas Böttner
---
modules/sqlops/sql_api.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/sqlops/sql_api.c b/modules/sqlops/sql_api.c
index bfd4e96..2518db1 100644
--- a/modules/sqlops/sql_api.c
+++ b/modules/sqlops/sql_api.c
@@ -252,6 +252,8 @@ int sql_do_query(sql_con_t *con, str *query, sql_result_t *res)
int i, j;
str sv;
+ if(res) sql_reset_result(res);
+
if(query==NULL)
{
LM_ERR("bad parameters\n");
@@ -276,7 +278,6 @@ int sql_do_query(sql_con_t *con, str *query, sql_result_t *res)
return 3;
}
- sql_reset_result(res);
res->ncols = RES_COL_N(db_res);
res->nrows = RES_ROW_N(db_res);
LM_DBG("rows [%d] cols [%d]\n", res->nrows, res->ncols);
More information about the sr-dev
mailing list