From commits-return-9517-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sun May 18 08:54:33 2008 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 3299 invoked from network); 18 May 2008 08:54:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2008 08:54:33 -0000 Received: (qmail 98010 invoked by uid 500); 18 May 2008 08:54:34 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 97986 invoked by uid 500); 18 May 2008 08:54:34 -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 97977 invoked by uid 99); 18 May 2008 08:54:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 May 2008 01:54:34 -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; Sun, 18 May 2008 08:53:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0188423889F3; Sun, 18 May 2008 01:54:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r657516 - in /apr/apr-util/trunk/dbd: apr_dbd_mysql.c apr_dbd_pgsql.c Date: Sun, 18 May 2008 08:54:09 -0000 To: commits@apr.apache.org From: bojan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080518085410.0188423889F3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bojan Date: Sun May 18 01:54:09 2008 New Revision: 657516 URL: http://svn.apache.org/viewvc?rev=657516&view=rev Log: Make sure PGSQL and MySQL drivers count rows from 1, not 0 Modified: apr/apr-util/trunk/dbd/apr_dbd_mysql.c apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Modified: apr/apr-util/trunk/dbd/apr_dbd_mysql.c URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_mysql.c?rev=657516&r1=657515&r2=657516&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_mysql.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_mysql.c Sun May 18 01:54:09 2008 @@ -269,7 +269,7 @@ if (res->statement) { if (res->random) { if (rownum >= 0) { - mysql_stmt_data_seek(res->statement, (my_ulonglong)rownum); + mysql_stmt_data_seek(res->statement, (my_ulonglong) --rownum); } } ret = mysql_stmt_fetch(res->statement); @@ -288,7 +288,7 @@ else { if (res->random) { if (rownum >= 0) { - mysql_data_seek(res->res, (my_ulonglong) rownum); + mysql_data_seek(res->res, (my_ulonglong) --rownum); } } r = mysql_fetch_row(res->res); 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=657516&r1=657515&r2=657516&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Sun May 18 01:54:09 2008 @@ -231,14 +231,14 @@ row = apr_palloc(pool, sizeof(apr_dbd_row_t)); *rowp = row; row->res = res; - row->n = sequential ? 0 : rownum; + row->n = sequential ? 0 : --rownum; } else { if ( sequential ) { ++row->n; } else { - row->n = rownum; + row->n = --rownum; } }