2
0

Do not scan binary values into strings

refs #219 and #228
This commit is contained in:
Jack Christensen
2017-02-16 19:19:45 -06:00
parent ccc65c361a
commit 4d56221868
4 changed files with 47 additions and 9 deletions
+13 -1
View File
@@ -301,7 +301,19 @@ func (rows *Rows) Values() ([]interface{}, error) {
// All intrinsic types (except string) are encoded with binary
// encoding so anything else should be treated as a string
case TextFormatCode:
values = append(values, vr.ReadString(vr.Len()))
switch vr.Type().DataType {
case JSONOID:
var d interface{}
decodeJSON(vr, &d)
values = append(values, d)
case JSONBOID:
var d interface{}
decodeJSONB(vr, &d)
values = append(values, d)
default:
values = append(values, vr.ReadString(vr.Len()))
}
case BinaryFormatCode:
switch vr.Type().DataType {
case TextOID, VarcharOID: