dev  

Re: svn commit: r657516 - in /apr/apr-util/trunk/dbd: apr_dbd_mysql.c apr_dbd_pgsql.c

Ruediger Pluem
Sun, 18 May 2008 02:24:42 -0700



On 05/18/2008 10:54 AM, [EMAIL PROTECTED] wrote:
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) {

I guess this should now be > 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) {

Same as above.

-                mysql_data_seek(res->res, (my_ulonglong) rownum);
+                mysql_data_seek(res->res, (my_ulonglong) --rownum);
             }
         }
         r = mysql_fetch_row(res->res);

Regards

RĂ¼diger