Skip to content

Commit 517157a

Browse files
committed
fix(pkg/server/sessions/internal/transactions): transaction is cleared after sqlExec error
Signed-off-by: Michele Meloni <[email protected]>
1 parent b44f735 commit 517157a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/server/sessions/internal/transactions/transactions.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,10 @@ func (tx *transaction) GetSessionID() string {
9191
return tx.sessionID
9292
}
9393

94-
func (tx *transaction) SQLExec(request *schema.SQLExecRequest) error {
94+
func (tx *transaction) SQLExec(request *schema.SQLExecRequest) (err error) {
9595
tx.mutex.Lock()
9696
defer tx.mutex.Unlock()
97-
ntx, _, err := tx.db.SQLExec(request, tx.sqlTx)
98-
if err != nil {
99-
return err
100-
}
101-
tx.sqlTx = ntx
97+
tx.sqlTx, _, err = tx.db.SQLExec(request, tx.sqlTx)
10298
return err
10399
}
104100

0 commit comments

Comments
 (0)