fixed bug insert
This commit is contained in:
parent
0c541edf3f
commit
b7dce622b9
10
session.go
10
session.go
|
@ -1411,13 +1411,11 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
|
||||||
session.cacheInsert(session.Statement.TableName())
|
session.cacheInsert(session.Statement.TableName())
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := res.LastInsertId()
|
if table.PrimaryKey != "" {
|
||||||
|
return res.LastInsertId()
|
||||||
if err != nil {
|
} else {
|
||||||
return -1, err
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return id, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (session *Session) InsertMulti(rowsSlicePtr interface{}) (int64, error) {
|
func (session *Session) InsertMulti(rowsSlicePtr interface{}) (int64, error) {
|
||||||
|
|
Loading…
Reference in New Issue