From c53a033cf37d82c925774fdfd4124cd1b065acc3 Mon Sep 17 00:00:00 2001 From: yongh Date: Tue, 11 Sep 2018 18:03:29 +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 2ea58fdaf..8d5007fec 100644 --- a/session_insert.go +++ b/session_insert.go @@ -218,7 +218,7 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error session.engine.QuoteStr(), strings.Join(colMultiPlaces, temp)) } else { - sql = fmt.Sprintf("INSERT INTO %s (%v%v%v) VALUES (%v)", + sql = fmt.Sprintf("INSERT IGNORE INTO %s (%v%v%v) VALUES (%v)", session.engine.Quote(tableName), session.engine.QuoteStr(), strings.Join(colNames, session.engine.QuoteStr()+", "+session.engine.QuoteStr()),