Propagate errors from SQL row reading (#1079)

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-23 08:11:23 +02:00 committed by Lunny Xiao
parent e88d320934
commit c5c275a261
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
}