From commits-return-9832-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Mon Jun 30 05:51:21 2008 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 10014 invoked from network); 30 Jun 2008 05:51:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jun 2008 05:51:21 -0000 Received: (qmail 98346 invoked by uid 500); 30 Jun 2008 05:51:22 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 98311 invoked by uid 500); 30 Jun 2008 05:51:22 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 98302 invoked by uid 99); 30 Jun 2008 05:51:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jun 2008 22:51:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 05:50:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D606E2388A26; Sun, 29 Jun 2008 22:50:29 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r672711 - /apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Date: Mon, 30 Jun 2008 05:50:29 -0000 To: commits@apr.apache.org From: bojan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080630055029.D606E2388A26@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bojan Date: Sun Jun 29 22:50:29 2008 New Revision: 672711 URL: http://svn.apache.org/viewvc?rev=672711&view=rev Log: DBD rows are counted from one, but in PostgreSQL they start from zero. Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c?rev=672711&r1=672710&r2=672711&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Sun Jun 29 22:50:29 2008 @@ -258,7 +258,7 @@ } 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 @@ } } 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) {