Skip to content

Commit

Permalink
fix: close mysql connection after create database
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Kramm <[email protected]>
  • Loading branch information
FabianKramm committed Nov 12, 2024
1 parent 810f408 commit db78f09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/drivers/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func createDBIfNotExist(dataSourceName string) error {
if err != nil {
return err
}
defer db.Close()

var exists bool
err = db.QueryRow("SELECT 1 FROM information_schema.SCHEMATA WHERE schema_name = ?", dbName).Scan(&exists)
Expand Down

0 comments on commit db78f09

Please sign in to comment.