From 2a5d411c8ca687888d06cd3b8b3720295a09336f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 14 Jan 2015 11:09:42 +0800 Subject: [PATCH] bug fixed #195 --- session.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/session.go b/session.go index a3f9f0da..71449bbd 100644 --- a/session.go +++ b/session.go @@ -2058,11 +2058,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error if col.MapType == core.ONLYFROMDB { continue } + if col.IsDeleted { + continue + } if session.Statement.ColumnStr != "" { if _, ok := session.Statement.columnMap[col.Name]; !ok { continue } } + if session.Statement.OmitStr != "" { + if _, ok := session.Statement.columnMap[col.Name]; ok { + continue + } + } if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { args = append(args, session.Engine.NowTime(col.SQLType.Name)) } else { @@ -2086,11 +2094,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error if col.MapType == core.ONLYFROMDB { continue } + if col.IsDeleted { + continue + } if session.Statement.ColumnStr != "" { if _, ok := session.Statement.columnMap[col.Name]; !ok { continue } } + if session.Statement.OmitStr != "" { + if _, ok := session.Statement.columnMap[col.Name]; ok { + continue + } + } if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { args = append(args, session.Engine.NowTime(col.SQLType.Name)) } else {