From db78f0974fc4c58cfd2da86e9eb663992f898be4 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Tue, 12 Nov 2024 08:48:35 +0100 Subject: [PATCH] fix: close mysql connection after create database Signed-off-by: Fabian Kramm --- pkg/drivers/mysql/mysql.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/drivers/mysql/mysql.go b/pkg/drivers/mysql/mysql.go index 2cf01b0d..e255e444 100644 --- a/pkg/drivers/mysql/mysql.go +++ b/pkg/drivers/mysql/mysql.go @@ -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)