From b8e531bbcd97812a6fa31a44dc5da2323f49ad3f Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 21 Aug 2017 17:13:30 +0100 Subject: [PATCH] Clarify that if the txn is nil the stmt will run outside a transaction --- src/github.com/matrix-org/dendrite/common/sql.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/common/sql.go b/src/github.com/matrix-org/dendrite/common/sql.go index e276f31d0..c2fb753fc 100644 --- a/src/github.com/matrix-org/dendrite/common/sql.go +++ b/src/github.com/matrix-org/dendrite/common/sql.go @@ -57,7 +57,8 @@ func WithTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) { } // TxStmt wraps an SQL stmt inside an optional transaction. -// If the transaction is nil then it returns the original statement. +// If the transaction is nil then it returns the original statement that will +// run outside of a transaction. // Otherwise returns a copy of the statement that will run inside the transaction. func TxStmt(transaction *sql.Tx, statement *sql.Stmt) *sql.Stmt { if transaction != nil {