Merge pull request #583 from liudanking/master

fix panic in function databaseName()
This commit is contained in:
Jinzhu 2015-08-01 08:54:47 +08:00
commit 3f18890ca4
1 changed files with 2 additions and 2 deletions

View File

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