Change ArrayHeader.ElementOID to uint32
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
type ArrayHeader struct {
|
type ArrayHeader struct {
|
||||||
ContainsNull bool
|
ContainsNull bool
|
||||||
ElementOID int32
|
ElementOID uint32
|
||||||
Dimensions []ArrayDimension
|
Dimensions []ArrayDimension
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ func (dst *ArrayHeader) DecodeBinary(ci *ConnInfo, src []byte) (int, error) {
|
|||||||
dst.ContainsNull = binary.BigEndian.Uint32(src[rp:]) == 1
|
dst.ContainsNull = binary.BigEndian.Uint32(src[rp:]) == 1
|
||||||
rp += 4
|
rp += 4
|
||||||
|
|
||||||
dst.ElementOID = int32(binary.BigEndian.Uint32(src[rp:]))
|
dst.ElementOID = binary.BigEndian.Uint32(src[rp:])
|
||||||
rp += 4
|
rp += 4
|
||||||
|
|
||||||
if numDims > 0 {
|
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, containsNull)
|
||||||
|
|
||||||
buf = pgio.AppendInt32(buf, src.ElementOID)
|
buf = pgio.AppendUint32(buf, src.ElementOID)
|
||||||
|
|
||||||
for i := range src.Dimensions {
|
for i := range src.Dimensions {
|
||||||
buf = pgio.AppendInt32(buf, src.Dimensions[i].Length)
|
buf = pgio.AppendInt32(buf, src.Dimensions[i].Length)
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func (p *encodePlanArrayCodecBinary) Encode(value interface{}, buf []byte) (newB
|
|||||||
|
|
||||||
arrayHeader := ArrayHeader{
|
arrayHeader := ArrayHeader{
|
||||||
Dimensions: dimensions,
|
Dimensions: dimensions,
|
||||||
ElementOID: int32(p.ac.ElementOID),
|
ElementOID: p.ac.ElementOID,
|
||||||
}
|
}
|
||||||
|
|
||||||
containsNullIndex := len(buf) + 4
|
containsNullIndex := len(buf) + 4
|
||||||
|
|||||||
Reference in New Issue
Block a user