Fixed WithinTx and improved test coverage #46
@@ -64,10 +64,10 @@ func (t *Transactor) withinSavepoint(ctx context.Context, tx *sql.Tx, fn func(co
|
||||
}
|
||||
|
||||
if err := fn(ctx); err != nil {
|
||||
_, _ = tx.ExecContext(ctx, "ROLLBACK TO SAVEPOINT"+name)
|
||||
_, _ = tx.ExecContext(ctx, "ROLLBACK TO SAVEPOINT "+name)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err := tx.ExecContext(ctx, "RELEASE SAVEPOINT"+name)
|
||||
_, err := tx.ExecContext(ctx, "RELEASE SAVEPOINT "+name)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user