2
0

Tweak handling of reading null as raw bytes.

* NULL maps to nil not empty slice
* Handle NULL in Scan not ReadBytes
This commit is contained in:
Jack Christensen
2014-12-23 21:58:48 -06:00
parent e616eb0783
commit daf2efa313
3 changed files with 11 additions and 6 deletions
+5 -1
View File
@@ -227,7 +227,11 @@ func (rows *Rows) Scan(dest ...interface{}) (err error) {
if vr.Type().DataType == ByteaOid {
*d = decodeBytea(vr)
} else {
*d = vr.ReadBytes(vr.Len())
if vr.Len() != -1 {
*d = vr.ReadBytes(vr.Len())
} else {
*d = nil
}
}
case *int64:
*d = decodeInt8(vr)