2
0

Parse array header to empty slices instead of nils

This commit is contained in:
Jack Christensen
2022-02-08 11:35:40 -06:00
parent bcc0af3f56
commit 1334d45d71
3 changed files with 9 additions and 20 deletions
-12
View File
@@ -238,12 +238,6 @@ func (c *ArrayCodec) decodeBinary(ci *ConnInfo, arrayOID uint32, src []byte, arr
return err
}
// TODO - ArrayHeader.DecodeBinary should do this. But doing this there breaks old array code. Leave until old code
// can be removed.
if arrayHeader.Dimensions == nil {
arrayHeader.Dimensions = []ArrayDimension{}
}
err = array.SetDimensions(arrayHeader.Dimensions)
if err != nil {
return err
@@ -283,12 +277,6 @@ func (c *ArrayCodec) decodeText(ci *ConnInfo, arrayOID uint32, src []byte, array
return err
}
// TODO - ParseUntypedTextArray should do this. But doing this there breaks old array code. Leave until old code
// can be removed.
if uta.Dimensions == nil {
uta.Dimensions = []ArrayDimension{}
}
err = array.SetDimensions(uta.Dimensions)
if err != nil {
return err