Skip to content

Commit 918aff3

Browse files
committed
Fix missing error messages for failed DML statements (backported from #61)
1 parent 1eb2332 commit 918aff3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

loop.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ func (ss *session) Loop(ctx context.Context, commandIn commandIn) error {
190190
isNewTx := (ss.tx == nil)
191191
err = ss.beginTx(ctx, ss.stdErr)
192192
if err == nil {
193-
count, err := doDML(ctx, ss.tx, query, nil, ss.stdOut)
193+
var count int64
194+
count, err = doDML(ctx, ss.tx, query, nil, ss.stdOut)
194195
if (err != nil || count == 0) && isNewTx && ss.tx != nil {
195196
ss.tx.Rollback()
196197
ss.tx = nil

0 commit comments

Comments
 (0)