You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/05/01 06:01:20 UTC

svn commit: r1477904 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_wc/upgrade.c

Author: svn-role
Date: Wed May  1 04:01:19 2013
New Revision: 1477904

URL: http://svn.apache.org/r1477904
Log:
Merge r1476193 from trunk:

 * r1476193
   Reset SQLite statements on error during 1.7 to 1.8 upgrade.
   Justification:
     Avoid SQLITE_MISUSE errors.
   Votes:
     +1: philip, cmpilato, brane

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_wc/upgrade.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1476193

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1477904&r1=1477903&r2=1477904&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed May  1 04:01:19 2013
@@ -80,13 +80,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1476193
-   Reset SQLite statements on error during 1.7 to 1.8 upgrade.
-   Justification:
-     Avoid SQLITE_MISUSE errors.
-   Votes:
-     +1: philip, cmpilato, brane
-
  * r1476607
    Some svnadmin command help copy-editing.
    Justification:

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/upgrade.c?rev=1477904&r1=1477903&r2=1477904&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/upgrade.c Wed May  1 04:01:19 2013
@@ -1590,6 +1590,7 @@ bump_to_31(void *baton,
   apr_array_header_t *empty_iprops = apr_array_make(
     scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
   svn_boolean_t iprops_column_exists = FALSE;
+  svn_error_t *err;
 
   /* Add the inherited_props column to NODES if it does not yet exist.
    *
@@ -1631,23 +1632,42 @@ bump_to_31(void *baton,
                                     STMT_UPGRADE_31_SELECT_WCROOT_NODES));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
-                                    STMT_UPDATE_IPROP));
+  err = svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
+                                  STMT_UPDATE_IPROP);
+  if (err)
+    return svn_error_compose_create(err, svn_sqlite__reset(stmt));
+
   while (have_row)
     {
       const char *switched_relpath = svn_sqlite__column_text(stmt, 1, NULL);
       apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
 
-      SVN_ERR(svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
-                                switched_relpath));
-      SVN_ERR(svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
-                                      empty_iprops, iterpool));
-      SVN_ERR(svn_sqlite__step_done(stmt_mark_switch_roots));
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+      err = svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
+                              switched_relpath);
+      if (!err)
+        err = svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
+                                      empty_iprops, iterpool);
+      if (!err)
+        err = svn_sqlite__step_done(stmt_mark_switch_roots);
+      if (!err)
+        err = svn_sqlite__step(&have_row, stmt);
+
+      if (err)
+        return svn_error_compose_create(
+                err,
+                svn_error_compose_create(
+                  /* Reset in either order is OK. */
+                  svn_sqlite__reset(stmt),
+                  svn_sqlite__reset(stmt_mark_switch_roots)));
     }
 
+  err = svn_sqlite__reset(stmt_mark_switch_roots);
+  if (err)
+    return svn_error_compose_create(err, svn_sqlite__reset(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
+
   svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }