Skip to content

Commit

Permalink
tests: Make sure the INSERT is executed before we starts droppling co…
Browse files Browse the repository at this point in the history
…ls (pingcap#856)
  • Loading branch information
suzaku authored Dec 27, 2019
1 parent 27030dd commit f3afdce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/dailytest/case.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,15 @@ CREATE TABLE many_cols (
}
placeholders := builder.String()

// Insert a row with all columns set to empty string
insertSQL := fmt.Sprintf(`INSERT INTO many_cols(id, %s) VALUES (?, %s);`, cols, placeholders)
mustExec(db, insertSQL, 1)

var wg sync.WaitGroup

wg.Add(1)
go func() {
defer wg.Done()
// Insert a row with all columns set to empty string
insertSQL := fmt.Sprintf(`INSERT INTO many_cols(id, %s) VALUES (?, %s);`, cols, placeholders)
mustExec(db, insertSQL, 1)

// Keep updating to generate DMLs while the other goroutine's dropping columns
updateSQL := `UPDATE many_cols SET val = ? WHERE id = ?;`
Expand Down

0 comments on commit f3afdce

Please sign in to comment.