subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1329008 - /subversion/trunk/subversion/libsvn_wc/wc_db.c
Date Mon, 23 Apr 2012 00:31:24 GMT
Author: rhuijben
Date: Mon Apr 23 00:31:23 2012
New Revision: 1329008

URL: http://svn.apache.org/viewvc?rev=1329008&view=rev
Log:
Add a few missing SQLite cleanups in error and cancel conditions.

* subversion/libsvn_wc/wc_db.c
  (do_changelist_notify): Reset statement when cancelling.
  (svn_wc__db_read_props_streamily): Reset statement and remove temporary table
    when cancelling.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1329008&r1=1329007&r2=1329008&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Apr 23 00:31:23 2012
@@ -5101,7 +5101,14 @@ do_changelist_notify(void *baton,
       svn_pool_clear(iterpool);
 
       if (cancel_func)
-        SVN_ERR(cancel_func(cancel_baton));
+        {
+          svn_error_t *err = cancel_func(cancel_baton);
+
+          if (err)
+            return svn_error_trace(svn_error_compose_create(
+                                                    err,
+                                                    svn_sqlite__reset(stmt)));
+        }
 
       notify_abspath = svn_dirent_join(wcroot->abspath, notify_relpath,
                                        iterpool);
@@ -8166,6 +8173,7 @@ svn_wc__db_read_props_streamily(svn_wc__
   cache_props_baton_t baton;
   svn_boolean_t have_row;
   apr_pool_t *iterpool;
+  svn_error_t *err = NULL;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(receiver_func);
@@ -8198,40 +8206,43 @@ svn_wc__db_read_props_streamily(svn_wc__
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_RELEVANT_PROPS_FROM_CACHE));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  while (have_row)
+  while (!err && have_row)
     {
       apr_hash_t *props;
 
       svn_pool_clear(iterpool);
 
+      SVN_ERR(svn_sqlite__column_properties(&props, stmt, 1, iterpool,
+                                            iterpool));
+
       /* see if someone wants to cancel this operation. */
       if (cancel_func)
-        SVN_ERR(cancel_func(cancel_baton));
+        err = cancel_func(cancel_baton);
 
-      SVN_ERR(svn_sqlite__column_properties(&props, stmt, 1, iterpool,
-                                            iterpool));
-      if (props && apr_hash_count(props) != 0)
+      if (!err && props && apr_hash_count(props) != 0)
         {
           const char *child_relpath;
           const char *child_abspath;
+          svn_error_t *err;
 
           child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
           child_abspath = svn_dirent_join(wcroot->abspath,
                                           child_relpath, iterpool);
 
-          SVN_ERR(receiver_func(receiver_baton, child_abspath, props,
-                                iterpool));
+          err = receiver_func(receiver_baton, child_abspath, props, iterpool);
         }
 
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+      err = svn_error_compose_create(err, svn_sqlite__step(&have_row, stmt));
     }
 
-  SVN_ERR(svn_sqlite__reset(stmt));
+  err = svn_error_compose_create(err, svn_sqlite__reset(stmt));
 
   svn_pool_destroy(iterpool);
 
-  SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
-                                      STMT_DROP_NODE_PROPS_CACHE));
+  SVN_ERR(svn_error_compose_create(
+                    err,
+                    svn_sqlite__exec_statements(wcroot->sdb,
+                                                STMT_DROP_NODE_PROPS_CACHE)));
   return SVN_NO_ERROR;
 }
 



Mime
View raw message