mirror of https://github.com/go-gorm/gorm.git
Fix wrong RowsAffected if not data found
This commit is contained in:
parent
ce610a9560
commit
79628be2c2
|
@ -446,6 +446,8 @@ func (db *DB) Scan(dest interface{}) (tx *DB) {
|
|||
defer rows.Close()
|
||||
if rows.Next() {
|
||||
tx.ScanRows(rows, dest)
|
||||
} else {
|
||||
tx.RowsAffected = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue