Skip to content

Commit

Permalink
merge <- 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rade-popovic committed Dec 6, 2023
2 parents 74f8542 + 649c79f commit efcfbdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
12 changes: 6 additions & 6 deletions testing/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ func CreateMySQL(t testing.TB, optMaker MySQLOptions) (*sql.DB, string) {
t.FailNow()
}

var client *sql.DB

t.Cleanup(func() {
if client != nil {
_ = client.Close()
}
_, err = mysqlClient.Exec(fmt.Sprintf("DROP DATABASE IF EXISTS %s;", dbName))
if err != nil {
t.Errorf("failed to delete database %s: %v", dbName, err)
}

if err = mysqlClient.Close(); err != nil {
t.Errorf("failed to close connection: %v", err)
t.FailNow()
}
})

_, err = mysqlClient.Exec(
Expand All @@ -86,7 +86,7 @@ func CreateMySQL(t testing.TB, optMaker MySQLOptions) (*sql.DB, string) {
t.FailNow()
}

client, err := sql.Open(
client, err = sql.Open(
"mysql",
fmt.Sprintf(
"%s:%s@%s(%s)/%s",
Expand Down
6 changes: 0 additions & 6 deletions testing/timescaledb.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ func CreateTimescaledb(t testing.TB, optMaker TimescaledbOptions) (*sql.DB, stri
if err != nil {
t.Errorf("failed to delete database %s: %v", dbName, err)
}

if err = tsdbClient.Close(); err != nil {
t.Errorf("failed to close connection: %v", err)
t.FailNow()
}

})

if _, err = tsdbClient.Exec(fmt.Sprintf("GRANT ALL ON DATABASE %s TO %s;", dbName, opts.Username)); err != nil {
Expand Down

0 comments on commit efcfbdf

Please sign in to comment.