subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1330233 - /subversion/trunk/subversion/libsvn_subr/sqlite.c
Date Wed, 25 Apr 2012 12:16:12 GMT
Author: rhuijben
Date: Wed Apr 25 12:16:12 2012
New Revision: 1330233

URL: http://svn.apache.org/viewvc?rev=1330233&view=rev
Log:
Add verification for statement resetting to the sqlite pool cleanup handler in
maintainer mode, like how we handle this for leaked errors.

Also properly reset statements before finalizing them if required to
closely follow the sqlite guidelines.

* subversion/libsvn_subr/sqlite.c
  (close_apr): Check to see if statements need resetting.

Suggested by: danielsh

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=1330233&r1=1330232&r2=1330233&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite.c Wed Apr 25 12:16:12 2012
@@ -718,8 +718,23 @@ close_apr(void *data)
   for (i = 0; i < db->nbr_statements; i++)
     {
       if (db->prepared_stmts[i])
-        err = svn_error_compose_create(
+        {
+          if (db->prepared_stmts[i]->needs_reset)
+            {
+#ifdef SVN_DEBUG
+              const char *stmt_text = db->statement_strings[i];
+              stmt_text = stmt_text; /* Provide value for debugger */
+
+              SVN_ERR_MALFUNCTION_NO_RETURN();
+#else
+              err = svn_error_compose_create(
+                            err,
+                            svn_sqlite__reset(db->prepared_stmts[i]));
+#endif
+            }
+          err = svn_error_compose_create(
                         svn_sqlite__finalize(db->prepared_stmts[i]), err);
+        }
     }
 
   result = sqlite3_close(db->db3);



Mime
View raw message