Change ArrayHeader.ElementOID to uint32

query-exec-mode
Jack Christensen 2022-01-25 20:19:02 -06:00
parent 0ddf9e3b4b
commit 551d26ca41
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ import (
type ArrayHeader struct {
ContainsNull bool
ElementOID int32
ElementOID uint32
Dimensions []ArrayDimension
}
@ -55,7 +55,7 @@ func (dst *ArrayHeader) DecodeBinary(ci *ConnInfo, src []byte) (int, error) {
dst.ContainsNull = binary.BigEndian.Uint32(src[rp:]) == 1
rp += 4
dst.ElementOID = int32(binary.BigEndian.Uint32(src[rp:]))
dst.ElementOID = binary.BigEndian.Uint32(src[rp:])
rp += 4
if numDims > 0 {
@ -84,7 +84,7 @@ func (src ArrayHeader) EncodeBinary(ci *ConnInfo, buf []byte) []byte {
}
buf = pgio.AppendInt32(buf, containsNull)
buf = pgio.AppendInt32(buf, src.ElementOID)
buf = pgio.AppendUint32(buf, src.ElementOID)
for i := range src.Dimensions {
buf = pgio.AppendInt32(buf, src.Dimensions[i].Length)

View File

@ -155,7 +155,7 @@ func (p *encodePlanArrayCodecBinary) Encode(value interface{}, buf []byte) (newB
arrayHeader := ArrayHeader{
Dimensions: dimensions,
ElementOID: int32(p.ac.ElementOID),
ElementOID: p.ac.ElementOID,
}
containsNullIndex := len(buf) + 4