Module: sip-router Branch: master Commit: 367840503010d1be0da23e79525f2f88eb09ebcf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=36784050...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Oct 30 10:23:51 2014 +0100
sqlops: use row index for storing result of sql_pvquery()
- reported by Savolainen Dmitri, FS#487
---
modules/sqlops/sql_api.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/sqlops/sql_api.c b/modules/sqlops/sql_api.c index aa5cfc3..fe7acf5 100644 --- a/modules/sqlops/sql_api.c +++ b/modules/sqlops/sql_api.c @@ -600,9 +600,9 @@ int sql_do_pvquery(struct sip_msg *msg, sql_con_t *con, pv_elem_t *query, LM_ERR("Missing pv spec for column %d\n", j+1); goto error; } - if (db_val2pv_spec(msg, &RES_ROWS(db_res)[0].values[j], &pv->sname) != 0) { - LM_ERR("Failed to convert value for column %.*s\n", - RES_NAMES(db_res)[j]->len, RES_NAMES(db_res)[j]->s); + if (db_val2pv_spec(msg, &RES_ROWS(db_res)[i].values[j], &pv->sname) != 0) { + LM_ERR("Failed to convert value for column %.*s (row %d)\n", + RES_NAMES(db_res)[j]->len, RES_NAMES(db_res)[j]->s, i); goto error; } pv = pv->next;