2
0

Fix incorrect reuse of Value in Rows.Values()

fixes #386
This commit is contained in:
Jack Christensen
2018-02-03 11:04:49 -06:00
parent da3231b0b6
commit 52fc785a43
3 changed files with 71 additions and 1 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
"reflect"
"time"
"github.com/pkg/errors"
@@ -287,7 +288,7 @@ func (rows *Rows) Values() ([]interface{}, error) {
}
if dt, ok := rows.conn.ConnInfo.DataTypeForOID(fd.DataType); ok {
value := dt.Value
value := reflect.New(reflect.ValueOf(dt.Value).Elem().Type()).Interface().(pgtype.Value)
switch fd.FormatCode {
case TextFormatCode: