[mirrorbrain-commits] r7887 - /trunk/mod_mirrorbrain/mod_mirrorbrain.c

From: <poeml_at_mirrorbrain.org>
Date: Tue, 01 Dec 2009 21:26:10 -0000
Author: poeml
Date: Tue Dec  1 22:26:08 2009
New Revision: 7887

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7887&view=rev
Log:
mod_mirrorbrain.c:
- detect the APR version at compile time, and if it's 1.2, change the way how
  DBD database rows are counted. Thereby fixing http://mirrorbrain.org/issues/issue7

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.c

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=7887&r1=7886&r2=7887&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Tue Dec  1 22:26:08 2009
@@ -1170,7 +1170,19 @@
         const char *val = NULL;
         short col = 0; /* incremented for the column we are reading out */
 
-        rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, i);
+        rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, 
+#if (APR_MAJOR_VERSION == 1 && APR_MINOR_VERSION == 2)
+                             /* APR 1.2 was the first version to support the DBD
+                              * framework, and had a different way of counting
+                              * rows, see http://mirrorbrain.org/issues/issue7
+                              * */
+                             i - 1
+#else
+                             i
+#endif
+                             );
+
+
         if (rv != 0) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                       "[mod_mirrorbrain] Error looking up %s in database", filename);




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Dec 01 2009 - 21:26:15 GMT

This archive was generated by hypermail 2.2.0 : Tue Dec 01 2009 - 21:45:18 GMT