From c5c275a2617b8a6350836e1b542217438bbb7091 Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Thu, 23 Aug 2018 08:11:23 +0200 Subject: [PATCH 1/2] 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 3b2c9493..69194a23 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 } From 5b080b74958604862aecc216d8ac47c4f7692e69 Mon Sep 17 00:00:00 2001 From: aojianwu Date: Fri, 24 Aug 2018 16:02:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=BA=E5=B0=91sqlite=E5=BA=93=20(#1083)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/find.go | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/find.go b/examples/find.go index d80a698c..ae710b8e 100644 --- a/examples/find.go +++ b/examples/find.go @@ -6,6 +6,7 @@ import ( "time" "github.com/go-xorm/xorm" + _ "github.com/mattn/go-sqlite3" ) // User describes a user