Parse array header to empty slices instead of nils
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user