fix: 解决创建数据库用户重复的问题 (#1837)

This commit is contained in:
ssongliu 2023-08-04 18:20:04 +08:00 committed by GitHub
parent 5f357db1e1
commit a516ba9d63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -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
}

View file

@ -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
}