subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1663286 - /subversion/trunk/subversion/libsvn_subr/sqlite.c
Date Mon, 02 Mar 2015 12:39:20 GMT
Author: rhuijben
Date: Mon Mar  2 12:39:20 2015
New Revision: 1663286

URL: http://svn.apache.org/r1663286
Log:
Tweak error trace creation in svn_sqlite__finish_savepoint() to
hide the magic of this function unless there is an error raised
in or below this function.

* subversion/libsvn_subr/sqlite.c
  (svn_sqlite__finish_transaction,
   svn_sqlite__finish_savepoint): Only add tracing around generated
    errors, to avoid adding a trace for an error that was just
    passed as argument.

Modified:
    subversion/trunk/subversion/libsvn_subr/sqlite.c

Modified: subversion/trunk/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sqlite.c?rev=1663286&r1=1663285&r2=1663286&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite.c Mon Mar  2 12:39:20 2015
@@ -1307,7 +1307,7 @@ svn_sqlite__finish_transaction(svn_sqlit
       err2 = get_internal_statement(&stmt, db,
                                     STMT_INTERNAL_ROLLBACK_TRANSACTION);
       if (!err2)
-        err2 = svn_sqlite__step_done(stmt);
+        err2 = svn_error_trace(svn_sqlite__step_done(stmt));
 
       if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
         {
@@ -1330,14 +1330,14 @@ svn_sqlite__finish_transaction(svn_sqlit
              help diagnosing the original error and help in finding where
              a reset statement is missing. */
 
-          err2 = reset_all_statements(db, err2);
+          err2 = svn_error_trace(reset_all_statements(db, err2));
           err2 = svn_error_compose_create(
-                      svn_sqlite__step_done(stmt),
+                      svn_error_trace(svn_sqlite__step_done(stmt)),
                       err2);
+
         }
 
-      return svn_error_compose_create(err,
-                                      err2);
+      return svn_error_compose_create(err, err2);
     }
 
   SVN_ERR(get_internal_statement(&stmt, db, STMT_INTERNAL_COMMIT_TRANSACTION));
@@ -1358,7 +1358,7 @@ svn_sqlite__finish_savepoint(svn_sqlite_
                                     STMT_INTERNAL_ROLLBACK_TO_SAVEPOINT_SVN);
 
       if (!err2)
-        err2 = svn_sqlite__step_done(stmt);
+        err2 = svn_error_trace(svn_sqlite__step_done(stmt));
 
       if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
         {
@@ -1368,8 +1368,10 @@ svn_sqlite__finish_savepoint(svn_sqlite_
              ### See huge comment in svn_sqlite__finish_transaction for
                  further details */
 
-          err2 = reset_all_statements(db, err2);
-          err2 = svn_error_compose_create(svn_sqlite__step_done(stmt), err2);
+          err2 = svn_error_trace(reset_all_statements(db, err2));
+          err2 = svn_error_compose_create(
+                      svn_error_trace(svn_sqlite__step_done(stmt)),
+                      err2);
         }
 
       err = svn_error_compose_create(err, err2);
@@ -1377,9 +1379,9 @@ svn_sqlite__finish_savepoint(svn_sqlite_
                                     STMT_INTERNAL_RELEASE_SAVEPOINT_SVN);
 
       if (!err2)
-        err2 = svn_sqlite__step_done(stmt);
+        err2 = svn_error_trace(svn_sqlite__step_done(stmt));
 
-      return svn_error_trace(svn_error_compose_create(err, err2));
+      return svn_error_compose_create(err, err2);
     }
 
   SVN_ERR(get_internal_statement(&stmt, db,



Mime
View raw message