bug resolved for #364 & #365

This commit is contained in:
Lunny Xiao 2016-03-04 17:38:05 +08:00
parent 4fec1167de
commit d92dc9d373
4 changed files with 8 additions and 7 deletions

View File

@ -1 +1 @@
xorm v0.5.2.0303
xorm v0.5.2.0304

View File

@ -2204,12 +2204,12 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
continue
}
if session.Statement.ColumnStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; !ok {
if _, ok := session.Statement.columnMap[strings.ToLower(col.Name)]; !ok {
continue
}
}
if session.Statement.OmitStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; ok {
if _, ok := session.Statement.columnMap[strings.ToLower(col.Name)]; ok {
continue
}
}
@ -2252,12 +2252,12 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
continue
}
if session.Statement.ColumnStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; !ok {
if _, ok := session.Statement.columnMap[strings.ToLower(col.Name)]; !ok {
continue
}
}
if session.Statement.OmitStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; ok {
if _, ok := session.Statement.columnMap[strings.ToLower(col.Name)]; ok {
continue
}
}

View File

@ -867,7 +867,8 @@ func (statement *Statement) Cols(columns ...string) *Statement {
}
statement.ColumnStr = statement.Engine.Quote(strings.Join(newColumns, statement.Engine.Quote(", ")))
if strings.Contains(statement.ColumnStr, ".") {
statement.ColumnStr = strings.Replace(statement.ColumnStr, ".", statement.Engine.Quote("."), -1)
statement.ColumnStr = strings.Replace(statement.ColumnStr, ".",
statement.Engine.dialect.QuoteStr()+"."+statement.Engine.dialect.QuoteStr(), -1)
}
statement.ColumnStr = strings.Replace(statement.ColumnStr, statement.Engine.Quote("*"), "*", -1)
return statement

View File

@ -17,7 +17,7 @@ import (
)
const (
Version string = "0.5.2.0303"
Version string = "0.5.2.0304"
)
func regDrvsNDialects() bool {