This commit is contained in:
Lunny Xiao 2015-01-14 11:09:42 +08:00
parent 8402302cc7
commit 2a5d411c8c
1 changed files with 16 additions and 0 deletions

View File

@ -2058,11 +2058,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
if col.MapType == core.ONLYFROMDB { if col.MapType == core.ONLYFROMDB {
continue continue
} }
if col.IsDeleted {
continue
}
if session.Statement.ColumnStr != "" { if session.Statement.ColumnStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; !ok { if _, ok := session.Statement.columnMap[col.Name]; !ok {
continue continue
} }
} }
if session.Statement.OmitStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; ok {
continue
}
}
if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime {
args = append(args, session.Engine.NowTime(col.SQLType.Name)) args = append(args, session.Engine.NowTime(col.SQLType.Name))
} else { } else {
@ -2086,11 +2094,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
if col.MapType == core.ONLYFROMDB { if col.MapType == core.ONLYFROMDB {
continue continue
} }
if col.IsDeleted {
continue
}
if session.Statement.ColumnStr != "" { if session.Statement.ColumnStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; !ok { if _, ok := session.Statement.columnMap[col.Name]; !ok {
continue continue
} }
} }
if session.Statement.OmitStr != "" {
if _, ok := session.Statement.columnMap[col.Name]; ok {
continue
}
}
if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime {
args = append(args, session.Engine.NowTime(col.SQLType.Name)) args = append(args, session.Engine.NowTime(col.SQLType.Name))
} else { } else {