Quoting Bojan Smojver <[EMAIL PROTECTED]>:
Here is a quick patch that should get rid of the "commit twice" code.
A variant with a more conservative approach.
This one also returns success if rollback was successful. I'm not sure
what semantics is supposed to be here, but other drivers appear to be
returning 0 as long as they can rollback (i.e. transaction end was a
success, although transaction as a whole failed).
--
Bojan
Index: apr_dbd_sqlite3.c
===================================================================
--- apr_dbd_sqlite3.c (revision 397754)
+++ apr_dbd_sqlite3.c (working copy)
@@ -351,11 +351,10 @@
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;");