From 7bd8a3a2619f77d23d0b418a5fcac38129833288 Mon Sep 17 00:00:00 2001 From: yongh Date: Wed, 12 Sep 2018 09:42:10 +0800 Subject: [PATCH] add IGNORE to INSERT --- session_insert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session_insert.go b/session_insert.go index 8d5007fec..f3ae9c5c7 100644 --- a/session_insert.go +++ b/session_insert.go @@ -338,7 +338,7 @@ func (session *Session) innerInsert(bean interface{}) (int64, error) { var sqlStr string var tableName = session.statement.TableName() if len(colPlaces) > 0 { - sqlStr = fmt.Sprintf("INSERT INTO %s (%v%v%v) VALUES (%v)", + sqlStr = fmt.Sprintf("INSERT IGNORE INTO %s (%v%v%v) VALUES (%v)", session.engine.Quote(tableName), session.engine.QuoteStr(), strings.Join(colNames, session.engine.Quote(", ")),