From c73fe96cfdba8abc2b164a7cf0ec644db8e5e65a Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 13 Jul 2021 19:59:31 +0800 Subject: [PATCH] Fix scan into decimal.Decimal, close #4457 --- scan.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scan.go b/scan.go index c4f88cf8..2beecd45 100644 --- a/scan.go +++ b/scan.go @@ -208,6 +208,8 @@ func Scan(rows *sql.Rows, db *DB, initialized bool) { } } values[idx] = &sql.RawBytes{} + } else if len(columns) == 1 { + values[idx] = dest } else { values[idx] = &sql.RawBytes{} }