Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5eb7c4d

Browse files
committed
libpq: Fix a few bits that didn't get the memo about COPY BOTH.
There's probably no real bug here at present, so not backpatching.But it seems good to make these bits consistent with the rest oflibpq, so as to avoid future surprises.Patch by me. Review by Tom Lane.
1 parentc3d09b3 commit5eb7c4d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/interfaces/libpq/fe-protocol3.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,8 @@ pqGetline3(PGconn *conn, char *s, int maxlen)
15661566
intstatus;
15671567

15681568
if (conn->sock<0||
1569-
conn->asyncStatus!=PGASYNC_COPY_OUT||
1569+
(conn->asyncStatus!=PGASYNC_COPY_OUT&&
1570+
conn->asyncStatus!=PGASYNC_COPY_BOTH)||
15701571
conn->copy_is_binary)
15711572
{
15721573
printfPQExpBuffer(&conn->errorMessage,
@@ -1617,7 +1618,8 @@ pqGetlineAsync3(PGconn *conn, char *buffer, int bufsize)
16171618
intmsgLength;
16181619
intavail;
16191620

1620-
if (conn->asyncStatus!=PGASYNC_COPY_OUT)
1621+
if (conn->asyncStatus!=PGASYNC_COPY_OUT
1622+
&&conn->asyncStatus!=PGASYNC_COPY_BOTH)
16211623
return-1;/* we are not doing a copy... */
16221624

16231625
/*
@@ -1671,15 +1673,17 @@ pqEndcopy3(PGconn *conn)
16711673
PGresult*result;
16721674

16731675
if (conn->asyncStatus!=PGASYNC_COPY_IN&&
1674-
conn->asyncStatus!=PGASYNC_COPY_OUT)
1676+
conn->asyncStatus!=PGASYNC_COPY_OUT&&
1677+
conn->asyncStatus!=PGASYNC_COPY_BOTH)
16751678
{
16761679
printfPQExpBuffer(&conn->errorMessage,
16771680
libpq_gettext("no COPY in progress\n"));
16781681
return1;
16791682
}
16801683

16811684
/* Send the CopyDone message if needed */
1682-
if (conn->asyncStatus==PGASYNC_COPY_IN)
1685+
if (conn->asyncStatus==PGASYNC_COPY_IN||
1686+
conn->asyncStatus==PGASYNC_COPY_BOTH)
16831687
{
16841688
if (pqPutMsgStart('c', false,conn)<0||
16851689
pqPutMsgEnd(conn)<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp