fix: 兼容租户标准MySQL连接串

This commit is contained in:
richjohnrambo
2026-09-07 18:47:50 +08:00
parent 845f19fd1c
commit e5b8db41ea
2 changed files with 23 additions and 1 deletions
+4 -1
View File
@@ -148,7 +148,10 @@ func replaceMySQLDatabase(link string, dbName string) (string, error) {
func normalizeMySQLTimeOptions(link string) (string, error) {
if !strings.HasPrefix(link, "mysql:") {
return "", gerror.New("租户业务库仅支持 MySQL")
if !strings.Contains(link, "@tcp(") {
return "", gerror.New("租户业务库仅支持 MySQL")
}
link = "mysql:" + link
}
parts := strings.SplitN(link, "?", 2)
values := make(url.Values)