apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r398048 - /apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c
Date Sat, 29 Apr 2006 01:06:32 GMT
Author: bojan
Date: Fri Apr 28 18:06:31 2006
New Revision: 398048

URL: http://svn.apache.org/viewcvs?rev=398048&view=rev
Log:
Fix SQLite3 double commit attempt
Remove semicolons that are not required and other unnecessary verbosity.

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c?rev=398048&r1=398047&r2=398048&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c Fri Apr 28 18:06:31 2006
@@ -339,7 +339,7 @@
     int ret = 0;
     int nrows = 0;
 
-    ret = dbd_sqlite3_query(handle, &nrows, "BEGIN TRANSACTION;");
+    ret = dbd_sqlite3_query(handle, &nrows, "BEGIN");
     if (!*trans) {
         *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t));
         (*trans)->handle = handle;
@@ -351,16 +351,15 @@
 
 static int dbd_sqlite3_end_transaction(apr_dbd_transaction_t *trans)
 {
-    int ret = 0;
+    int ret = -1; /* ending transaction that was never started is an error */
     int nrows = 0;
 
     if (trans) {
-        ret = dbd_sqlite3_query(trans->handle, &nrows, "END TRANSACTION;");
         if (trans->errnum) {
             trans->errnum = 0;
-            ret = dbd_sqlite3_query(trans->handle, &nrows, "ROLLBACK;");
+            ret = dbd_sqlite3_query(trans->handle, &nrows, "ROLLBACK");
         } else {
-            ret = dbd_sqlite3_query(trans->handle, &nrows, "COMMIT;");
+            ret = dbd_sqlite3_query(trans->handle, &nrows, "COMMIT");
         }
         trans->handle->trans = NULL;
     }



Mime
View raw message