Propagate errors from SQL row reading

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.
This commit is contained in:
Lorenz Brun 2018-08-22 21:55:43 +02:00 committed by GitHub
parent e88d320934
commit bfb6281545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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
}