From c5c275a2617b8a6350836e1b542217438bbb7091 Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Thu, 23 Aug 2018 08:11:23 +0200 Subject: [PATCH] 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. --- session_get.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/session_get.go b/session_get.go index 3b2c9493c..69194a236 100644 --- a/session_get.go +++ b/session_get.go @@ -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 }