From: Aki Tuomi Date: Tue, 4 Sep 2018 17:30:12 +0000 (+0300) Subject: driver-sqlite: Document why rollback is called when commit fails X-Git-Tag: 2.3.4~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3e47b70a8fff937a74b8f033afe299a128ba7f6;p=thirdparty%2Fdovecot%2Fcore.git driver-sqlite: Document why rollback is called when commit fails --- diff --git a/src/lib-sql/driver-sqlite.c b/src/lib-sql/driver-sqlite.c index 2cc3522858..819c61d254 100644 --- a/src/lib-sql/driver-sqlite.c +++ b/src/lib-sql/driver-sqlite.c @@ -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(),