From 190584e0e68eaf18328b7b70244042f99a00285a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Thu, 27 Jul 2023 17:16:30 +0200 Subject: [PATCH] v0.0.218 bf --- goextVersion.go | 4 ++-- sq/transaction.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index 579d450..ff6f213 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.217" +const GoextVersion = "0.0.218" -const GoextVersionTimestamp = "2023-07-27T17:12:41+0200" +const GoextVersionTimestamp = "2023-07-27T17:16:30+0200" diff --git a/sq/transaction.go b/sq/transaction.go index 78c6022..dd0433d 100644 --- a/sq/transaction.go +++ b/sq/transaction.go @@ -54,7 +54,7 @@ func (tx *transaction) Rollback() error { result := tx.tx.Rollback() - if result != nil { + if result == nil { tx.status = TxStatusRollback } @@ -75,7 +75,7 @@ func (tx *transaction) Commit() error { result := tx.tx.Commit() - if result != nil { + if result == nil { tx.status = TxStatusComitted } @@ -97,7 +97,7 @@ func (tx *transaction) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Re res, err := tx.tx.NamedExecContext(ctx, sqlstr, prep) - if tx.status == TxStatusInitial && err != nil { + if tx.status == TxStatusInitial && err == nil { tx.status = TxStatusActive } @@ -122,7 +122,7 @@ func (tx *transaction) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx rows, err := sqlx.NamedQueryContext(ctx, tx.tx, sqlstr, prep) - if tx.status == TxStatusInitial && err != nil { + if tx.status == TxStatusInitial && err == nil { tx.status = TxStatusActive }