Skip to content

Commit

Permalink
Propagate errors from SQL row reading (go-xorm#1079)
Browse files Browse the repository at this point in the history
Currently errors while data is being read are being swallowed and result in a truncated result set, this fixes that and properly returns an error and not an incomplete result.
  • Loading branch information
lorenz authored and lunny committed Aug 23, 2018
1 parent e88d320 commit c5c275a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions session_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
defer rows.Close()

if !rows.Next() {
if rows.Err() != nil {
return false, rows.Err()
}
return false, nil
}

Expand Down

0 comments on commit c5c275a

Please sign in to comment.