Skip to content

Commit 83a7637

Browse files
committed
Reset conn->errorReported when PQrequestCancel sets errorMessage.
Oversight in commit 618c167. This is mainly neatnik-ism, since if PQrequestCancel is used per its API contract, we should perform pqClearConnErrorState before reaching any place that would consult errorReported. But still, it seems like a bad idea to potentially leave errorReported pointing past errorMessage.len.
1 parent 1c6d462 commit 83a7637

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4687,6 +4687,7 @@ PQrequestCancel(PGconn *conn)
46874687
"PQrequestCancel() -- connection is not open\n",
46884688
conn->errorMessage.maxlen);
46894689
conn->errorMessage.len = strlen(conn->errorMessage.data);
4690+
conn->errorReported = 0;
46904691

46914692
return false;
46924693
}
@@ -4706,7 +4707,10 @@ PQrequestCancel(PGconn *conn)
47064707
}
47074708

47084709
if (!r)
4710+
{
47094711
conn->errorMessage.len = strlen(conn->errorMessage.data);
4712+
conn->errorReported = 0;
4713+
}
47104714

47114715
return r;
47124716
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy