You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/29 22:36:14 UTC

svn commit: r1152368 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: stsp
Date: Fri Jul 29 20:36:13 2011
New Revision: 1152368

URL: http://svn.apache.org/viewvc?rev=1152368&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Reset open SQLite statements when returning errors
   that aren't coming from the svn_sqlite__ API.

Found by: rhuijben

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=1152368&r1=1152367&r2=1152368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 20:36:13 2011
@@ -6117,25 +6117,34 @@ op_delete_txn(void *baton,
               const char *child_delete_op_root_relpath = NULL;
               const char *moved_here_child_relpath =
                 svn_sqlite__column_text(stmt, 0, scratch_pool);
+              svn_error_t *err;
 
               svn_pool_clear(iterpool);
 
               /* The moved-here-children query returns info based on the
                * delete-half of the move. Check if that the copied-half of
                * the move matches this information. */
-              SVN_ERR(read_info(&child_status, NULL, NULL, NULL, NULL,
-                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                NULL, NULL, NULL, NULL, NULL, NULL,
-                                wcroot, moved_here_child_relpath,
-                                iterpool, iterpool));
+              err = read_info(&child_status, NULL, NULL, NULL, NULL,
+                              NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                              NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                              NULL, NULL, NULL, NULL, NULL, NULL,
+                              wcroot, moved_here_child_relpath,
+                              iterpool, iterpool);
+              if (err)
+                return svn_error_compose_create(err, svn_sqlite__reset(stmt));
+
               if (child_status == svn_wc__db_status_added)
-                SVN_ERR(scan_addition(&child_status, NULL, NULL, NULL,
+                {
+                  err = scan_addition(&child_status, NULL, NULL, NULL,
                                       NULL, NULL, NULL,
                                       &child_moved_from_relpath,
                                       &child_delete_op_root_relpath,
                                       wcroot, moved_here_child_relpath,
-                                      iterpool, iterpool));
+                                      iterpool, iterpool);
+                  if (err)
+                    return svn_error_compose_create(err,
+                                                    svn_sqlite__reset(stmt));
+                }
 #ifdef SVN_DEBUG
               /* This catches incorrectly recorded moves.
                * It is possible to hit this during normal operation