Author: stsp
Date: Mon Jan 28 16:31:41 2013
New Revision: 1439479

URL: http://svn.apache.org/viewvc?rev=1439479&view=rev
Log:
* subversion/libsvn_wc/upgrade.c
  (bump_to_30): Reduce the scope of 'stmt_store', preventing the statement
   from being prepared without also being used and reset.

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

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1439479&r1=1439478&r2=1439479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Mon Jan 28 16:31:41 2013
@@ -1504,22 +1504,19 @@ bump_to_30(void *baton, svn_sqlite__db_t
   svn_boolean_t have_row;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_sqlite__stmt_t *stmt;
-  svn_sqlite__stmt_t *stmt_store;
   svn_wc__db_t *db; /* Read only temp db */
   const char *wri_abspath = bb->wcroot_abspath;
 
   SVN_ERR(svn_wc__db_open(&db, NULL, FALSE, FALSE,
                           scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt_store, sdb,
-                                    STMT_UPGRADE_30_SET_CONFLICT));
-
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   while (have_row)
     {
+      svn_sqlite__stmt_t *stmt_store;
       svn_stringbuf_t *skel_data;
       svn_skel_t *conflict_data;
       apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
@@ -1549,6 +1546,8 @@ bump_to_30(void *baton, svn_sqlite__db_t
 
       skel_data = svn_skel__unparse(conflict_data, iterpool);
 
+      SVN_ERR(svn_sqlite__get_statement(&stmt_store, sdb,
+                                        STMT_UPGRADE_30_SET_CONFLICT));
       SVN_ERR(svn_sqlite__bindf(stmt_store, "isb", wc_id, local_relpath,
                                 skel_data->data, skel_data->len));
       SVN_ERR(svn_sqlite__step_done(stmt_store));


Reply via email to