From a516ba9d639fdb462b55e8dc932d833129b0b90a Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:20:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=94=A8=E6=88=B7=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#1837)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/mysql/client/local.go | 1 + backend/utils/mysql/client/remote.go | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/utils/mysql/client/local.go b/backend/utils/mysql/client/local.go index e14eb80c3..54ed43b61 100644 --- a/backend/utils/mysql/client/local.go +++ b/backend/utils/mysql/client/local.go @@ -39,6 +39,7 @@ func (r *Local) Create(info CreateInfo) error { } if err := r.CreateUser(info); err != nil { + _ = r.ExecSQL(fmt.Sprintf("drop database if exists `%s`", info.Name), info.Timeout) return err } diff --git a/backend/utils/mysql/client/remote.go b/backend/utils/mysql/client/remote.go index c4479ac51..6ae7b71aa 100644 --- a/backend/utils/mysql/client/remote.go +++ b/backend/utils/mysql/client/remote.go @@ -40,6 +40,7 @@ func (r *Remote) Create(info CreateInfo) error { } if err := r.CreateUser(info); err != nil { + _ = r.ExecSQL(fmt.Sprintf("drop database if exists `%s`", info.Name), info.Timeout) return err }