mirror of https://github.com/jackc/pgx.git
Initial passing tests
parent
ea3cdab234
commit
f1df39a29d
|
@ -1159,7 +1159,7 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co
|
||||||
buf[0] = 'd'
|
buf[0] = 'd'
|
||||||
|
|
||||||
var readErr, pgErr error
|
var readErr, pgErr error
|
||||||
for {
|
for pgErr == nil {
|
||||||
// Read chunk from r.
|
// Read chunk from r.
|
||||||
var n int
|
var n int
|
||||||
n, readErr = r.Read(buf[5:cap(buf)])
|
n, readErr = r.Read(buf[5:cap(buf)])
|
||||||
|
@ -1182,7 +1182,7 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read messages until error or none available.
|
// Read messages until error or none available.
|
||||||
for {
|
for pgErr == nil {
|
||||||
msg, err := pgConn.receiveMessage()
|
msg, err := pgConn.receiveMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, nbbconn.ErrWouldBlock) {
|
if errors.Is(err, nbbconn.ErrWouldBlock) {
|
||||||
|
|
Loading…
Reference in New Issue