Skip to content

Commit

Permalink
Merge pull request #24 from arvidfm/commit-tx
Browse files Browse the repository at this point in the history
Ensure implicit transactions are committed
  • Loading branch information
zachmu authored Jun 10, 2024
2 parents 5b95ffd + 332ea7a commit 10fb39c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 5 additions & 2 deletions result.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package embedded

import (
"io"

"database/sql/driver"
"io"

gms "github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/go-mysql-server/sql/types"
Expand Down Expand Up @@ -39,6 +38,10 @@ func newResult(gmsCtx *gms.Context, sch gms.Schema, rowItr gms.RowIter) *doltRes
}
}

if err := rowItr.Close(gmsCtx); err != nil {
return &doltResult{err: err}
}

return &doltResult{
affected: affected,
last: last,
Expand Down
3 changes: 0 additions & 3 deletions smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,5 @@ func initializeTestDatabaseConnection(t *testing.T, clientFoundRows bool) (conn
_, err = res.RowsAffected()
require.NoError(t, err)

_, err = conn.ExecContext(ctx, "commit;")
require.NoError(t, err)

return conn, cleanUpFunc
}

0 comments on commit 10fb39c

Please sign in to comment.