This commit is contained in:
Lunny Xiao 2021-07-20 23:28:29 +08:00
parent d7ebbe79e6
commit 60b14cb1d5
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 2 deletions

View File

@ -362,14 +362,13 @@ func (session *Session) innerInsert(bean interface{}) (int64, error) {
var id int64
if !rows.Next() {
if rows.Err() != nil {
return 0, err
return 0, rows.Err()
}
return 0, errors.New("insert successfully but not returned id")
}
if err := rows.Scan(&id); err != nil {
return 1, err
}
aiValue, err := table.AutoIncrColumn().ValueOf(bean)
if err != nil {
session.engine.logger.Errorf("%v", err)