diff --git a/common_dialect.go b/common_dialect.go index 281df8a7..3b646869 100644 --- a/common_dialect.go +++ b/common_dialect.go @@ -70,8 +70,8 @@ func (commonDialect) Quote(key string) string { } func (commonDialect) databaseName(scope *Scope) string { - from := strings.Index(scope.db.parent.source, "/") + 1 - to := strings.Index(scope.db.parent.source, "?") + from := strings.LastIndex(scope.db.parent.source, "/") + 1 + to := strings.LastIndex(scope.db.parent.source, "?") if to == -1 { to = len(scope.db.parent.source) }