forked from mirror/gorm
fix panic in function databaseName when there are special characters in password, such as '?', '/'
This commit is contained in:
parent
82d726bbfd
commit
2fe185eb77
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue