httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r454732 - /httpd/httpd/trunk/modules/mappers/mod_rewrite.c
Date Tue, 10 Oct 2006 13:15:07 GMT
Author: niq
Date: Tue Oct 10 06:15:07 2006
New Revision: 454732

URL: http://svn.apache.org/viewvc?view=rev&rev=454732
Log:
Fix rewritemap/dbd bug pointed out by Davi Arnaut, and improve error reporting.

Modified:
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?view=diff&rev=454732&r1=454731&r2=454732
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Tue Oct 10 06:15:07 2006
@@ -1330,6 +1330,7 @@
 {
     apr_status_t rv;
     apr_dbd_prepared_t *stmt;
+    const char *errmsg;
     apr_dbd_results_t *res = NULL;
     apr_dbd_row_t *row = NULL;
     const char *ret = NULL;
@@ -1341,8 +1342,10 @@
     rv = apr_dbd_pvselect(db->driver, r->pool, db->handle, &res,
                           stmt, 0, key, NULL);
     if (rv != 0) {
+        errmsg = apr_dbd_error(db->driver, db->handle, rv);
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
-                      "rewritemap: error querying for %s", key);
+                      "rewritemap: error %s querying for %s", errmsg, key);
+        return NULL;
     }
     while (rv = apr_dbd_get_row(db->driver, r->pool, res, &row, -1), rv == 0) {
         ++n;
@@ -1357,8 +1360,9 @@
         }
     }
     if (rv != -1) {
+        errmsg = apr_dbd_error(db->driver, db->handle, rv);
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
-                      "rewritemap: error looking up %s", key);
+                      "rewritemap: error %s looking up %s", errmsg, key);
     }
     switch (n) {
     case 0:



Mime
View raw message