Skip to content

Commit

Permalink
transactions for import
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Jan 17, 2025
1 parent 4d191da commit 0b52336
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion go/libraries/doltcore/mvdata/engine_table_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ func (s *SqlEngineTableWriter) WriteRows(ctx context.Context, inputChannel chan
}
}()

line := 1
// If there were create table statements, they are automatically committed, so we need to start a new transaction
_, _, _, err = s.se.Query(s.sqlCtx, "START TRANSACTION")
if err != nil {
return err
}

line := 1
for {
if s.statsCB != nil && atomic.LoadInt32(&s.statOps) >= tableWriterStatUpdateRate {
atomic.StoreInt32(&s.statOps, 0)
Expand Down

0 comments on commit 0b52336

Please sign in to comment.