File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 "encoding/binary"
66 "errors"
77 "fmt"
8- "math"
98
109 "github.com/lib/pq/internal/proto"
1110 "github.com/lib/pq/oid"
@@ -83,7 +82,7 @@ func (b *writeBuf) bytes(v []byte) {
8382
8483func (b * writeBuf ) wrap () []byte {
8584 p := b .buf [b .pos :]
86- if len (p ) > math .MaxUint32 {
85+ if len (p ) > proto .MaxUint32 {
8786 panic (fmt .Errorf ("pq: message too large (%d > math.MaxUint32)" , len (p )))
8887 }
8988 binary .BigEndian .PutUint32 (p , uint32 (len (p )))
@@ -92,7 +91,7 @@ func (b *writeBuf) wrap() []byte {
9291
9392func (b * writeBuf ) next (c proto.RequestCode ) {
9493 p := b .buf [b .pos :]
95- if len (p ) > math .MaxUint32 {
94+ if len (p ) > proto .MaxUint32 {
9695 panic (fmt .Errorf ("pq: message too large (%d > math.MaxUint32)" , len (p )))
9796 }
9897 binary .BigEndian .PutUint32 (p , uint32 (len (p )))
Original file line number Diff line number Diff line change 77 "encoding/binary"
88 "errors"
99 "fmt"
10- "math"
1110 "sync"
1211
1312 "github.com/lib/pq/internal/proto"
@@ -159,7 +158,7 @@ awaitCopyInResponse:
159158}
160159
161160func (ci * copyin ) flush (buf []byte ) error {
162- if len (buf )- 1 > math .MaxUint32 {
161+ if len (buf )- 1 > proto .MaxUint32 {
163162 return errors .New ("pq: too many columns" )
164163 }
165164 // set message length (without message identifier)
Original file line number Diff line number Diff line change 1+ //go:build 386 || arm || mips || mipsle
2+
3+ package proto
4+
5+ import "math"
6+
7+ const MaxUint32 = math .MaxInt
Original file line number Diff line number Diff line change 1+ //go:build !386 && !arm && !mips && !mipsle
2+
3+ package proto
4+
5+ import "math"
6+
7+ const MaxUint32 = math .MaxUint32
You can’t perform that action at this time.
0 commit comments