apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tdono...@apache.org
Subject svn commit: r668786 - /apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c
Date Tue, 17 Jun 2008 18:36:02 GMT
Author: tdonovan
Date: Tue Jun 17 11:36:01 2008
New Revision: 668786

URL: http://svn.apache.org/viewvc?rev=668786&view=rev
Log:
Don't try to close results or stmts in pool cleanups after the connection has been manually
closed. - trunk r668784

Modified:
    apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c?rev=668786&r1=668785&r2=668786&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c Tue Jun 17 11:36:01 2008
@@ -293,10 +293,11 @@
 {   apr_dbd_results_t *dbr = (apr_dbd_results_t *) d;
     SQLRETURN rc = SQL_SUCCESS;
     
-    if (dbr && !dbr->isclosed) {
-        rc = SQLCloseCursor(dbr->stmt);
+    if (dbr && dbr->apr_dbd && dbr->apr_dbd->dbc) {
+    	if (!dbr->isclosed) 
+        	rc = SQLCloseCursor(dbr->stmt);
+    	dbr->isclosed = 1;
     }
-    dbr->isclosed = 1;
     return APR_FROM_SQL_RESULT(rc);
 }
 
@@ -305,12 +306,15 @@
 {   
     SQLRETURN rc = APR_SUCCESS;
     apr_dbd_prepared_t *statement = s;
-    SQLHANDLE hstmt = statement->stmt;
     /* stmt is closed if connection has already been closed */
-    if (hstmt && statement->apr_dbd && statement->apr_dbd->dbc)
{
-        rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
+    if (statement) {
+        SQLHANDLE hstmt = statement->stmt;
+
+        if (hstmt && statement->apr_dbd && statement->apr_dbd->dbc)
{
+            rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
         }
-    statement->stmt = NULL;
+        statement->stmt = NULL;
+    }
     return APR_FROM_SQL_RESULT(rc);
 }
 



Mime
View raw message