This commit is contained in:
Lunny Xiao 2017-04-14 13:55:55 +08:00
parent a0b6b62ba0
commit 15f11df2af
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 7 additions and 1 deletions

View File

@ -1218,8 +1218,14 @@ func (statement *Statement) genSelectSQL(columnStr, condSQL string) (a string) {
fmt.Fprintf(&buf, " WHERE %v", condSQL)
}
var whereStr = buf.String()
var fromStr = " FROM "
if dialect.DBType() == core.MSSQL && strings.Contains(statement.TableName(), "..") {
fromStr += statement.TableName()
} else {
fromStr += quote(statement.TableName())
}
var fromStr = " FROM " + quote(statement.TableName())
if statement.TableAlias != "" {
if dialect.DBType() == core.ORACLE {
fromStr += " " + quote(statement.TableAlias)