Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Jan 23, 2025
1 parent 20a3559 commit c09f6df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions go/libraries/doltcore/sqle/database_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,13 @@ func (p *DoltDatabaseProvider) CreateDatabase(ctx *sql.Context, name string) err

func commitTransaction(ctx *sql.Context, dSess *dsess.DoltSession, rsc *doltdb.ReplicationStatusController) error {
currentTx := ctx.GetTransaction()

err := dSess.CommitTransaction(ctx, currentTx)
if err != nil {
return err
if currentTx != nil {
err := dSess.CommitTransaction(ctx, currentTx)
if err != nil {
return err
}
}

newTx, err := dSess.StartTransaction(ctx, sql.ReadWrite)
if err != nil {
return err
Expand Down

0 comments on commit c09f6df

Please sign in to comment.