forked from mirror/gorm
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()
|
defer rows.Close()
|
||||||
if rows.Next() {
|
if rows.Next() {
|
||||||
tx.ScanRows(rows, dest)
|
tx.ScanRows(rows, dest)
|
||||||
|
} else {
|
||||||
|
tx.RowsAffected = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue