You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2011/11/29 22:29:12 UTC

svn commit: r1208081 - /httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c

Author: minfrin
Date: Tue Nov 29 21:29:11 2011
New Revision: 1208081

URL: http://svn.apache.org/viewvc?rev=1208081&view=rev
Log:
Backport:
mod_dbd: The dbd_prepared_init() function reported the result of the last
prepared statement, obscuring earlier errors. Fixed.

Modified:
    httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c

Modified: httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c?rev=1208081&r1=1208080&r2=1208081&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c (original)
+++ httpd/httpd/branches/2.4.x/modules/database/mod_dbd.c Tue Nov 29 21:29:11 2011
@@ -435,7 +435,6 @@ static apr_status_t dbd_prepared_init(ap
                                       ap_dbd_t *rec)
 {
     apr_hash_index_t *hi;
-    apr_status_t rv = APR_SUCCESS;
 
     rec->prepared = apr_hash_make(pool);
 
@@ -453,14 +452,14 @@ static apr_status_t dbd_prepared_init(ap
         stmt = NULL;
         if (apr_dbd_prepare(rec->driver, pool, rec->handle, query,
                             label, &stmt)) {
-            rv = APR_EGENERAL;
+            return APR_EGENERAL;
         }
         else {
             apr_hash_set(rec->prepared, label, APR_HASH_KEY_STRING, stmt);
         }
     }
 
-    return rv;
+    return APR_SUCCESS;
 }
 
 static apr_status_t dbd_init_sql_init(apr_pool_t *pool, dbd_cfg_t *cfg,