summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-20 15:02:41 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-20 15:02:41 -0500
commit83a7637e2c5be27a0788b920501dde284b3fca33 (patch)
tree87a1c7feee188c06bfc74648ae26405b2e293270 /src
parent1c6d4629394d1b696b4e47ab4c501752e8c974e7 (diff)
Reset conn->errorReported when PQrequestCancel sets errorMessage.
Oversight in commit 618c16707. 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.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-connect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 2a3d68b4d14..1c5a2b43e99 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -4687,6 +4687,7 @@ PQrequestCancel(PGconn *conn)
"PQrequestCancel() -- connection is not open\n",
conn->errorMessage.maxlen);
conn->errorMessage.len = strlen(conn->errorMessage.data);
+ conn->errorReported = 0;
return false;
}
@@ -4706,7 +4707,10 @@ PQrequestCancel(PGconn *conn)
}
if (!r)
+ {
conn->errorMessage.len = strlen(conn->errorMessage.data);
+ conn->errorReported = 0;
+ }
return r;
}