Skip to content

Commit 808b1e0

Browse files
authored
Prevent db name collisions
1 parent a20bbf5 commit 808b1e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/mysql/mysql_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ func Test_MysqlBackend(t *testing.T) {
2222
t.Skip()
2323
}
2424

25-
dbName := "test_" + strings.Replace(uuid.NewString(), "-", "", -1)
25+
var dbName string
2626

2727
test.BackendTest(t, func() backend.Backend {
2828
db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@/?parseTime=true&interpolateParams=true", testUser, testPassword))
2929
if err != nil {
3030
panic(err)
3131
}
3232

33+
dbName = "test_" + strings.Replace(uuid.NewString(), "-", "", -1)
3334
if _, err := db.Exec("CREATE DATABASE " + dbName); err != nil {
3435
panic(fmt.Errorf("creating database: %w", err))
3536
}

0 commit comments

Comments
 (0)