diff options
author | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-30 05:50:29 +0000 |
---|---|---|
committer | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-30 05:50:29 +0000 |
commit | d45884c8edc94d8416f09d240dc1a58a126d2a67 (patch) | |
tree | e28bb83acdd048181146cfeecaab8631e78526b2 | |
parent | 4f5d8180501042c48ede2b18de972a727650aa8d (diff) | |
download | libapr-util-d45884c8edc94d8416f09d240dc1a58a126d2a67.tar.gz |
DBD rows are counted from one, but in PostgreSQL they start from zero.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@672711 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | dbd/apr_dbd_pgsql.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index aca6b535..daf0dab0 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -258,7 +258,7 @@ static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, } if (res->random) { - if ((row->n > 0) && (size_t)row->n >= res->ntuples) { + if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { *rowp = NULL; apr_pool_cleanup_run(pool, res->res, clear_result); res->res = NULL; @@ -266,7 +266,7 @@ static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, } } else { - if ((row->n > 0) && (size_t)row->n >= res->ntuples) { + if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { /* no data; we have to fetch some */ row->n -= res->ntuples; if (res->res != NULL) { |