apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
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 GMT
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;
         }
     }
 



Mime
View raw message