]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
driver-sqlite: Document why rollback is called when commit fails
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 4 Sep 2018 17:30:12 +0000 (20:30 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 14 Nov 2018 08:13:11 +0000 (10:13 +0200)
src/lib-sql/driver-sqlite.c

index 2cc3522858f142cd44d8df7b1bfe657212a1bd0a..819c61d254f14374946f30637d1e56fcf84e4766 100644 (file)
@@ -400,7 +400,12 @@ driver_sqlite_transaction_commit(struct sql_transaction_context *_ctx,
                e_debug(sql_transaction_finished_event(_ctx)->
                        add_str("error", commit_result.error)->event(),
                        "Transaction failed");
-               /* also does i_free(ctx) */
+               /* From SQLite manual: It is recommended that applications
+                  respond to the errors listed above by explicitly issuing a
+                  ROLLBACK command. If the transaction has already been rolled
+                  back automatically by the error response, then the ROLLBACK
+                  command will fail with an error, but no harm is caused by
+                  this. */
                driver_sqlite_transaction_rollback(_ctx);
        } else {
                e_debug(sql_transaction_finished_event(_ctx)->event(),