don't send unnecessary cancels

pull/4271/head
Nils Dijk 2020-10-23 15:35:43 +02:00
parent 5fcddfa2c6
commit 8aca59fa32
No known key found for this signature in database
GPG Key ID: CA1177EF9434F241
1 changed files with 6 additions and 0 deletions

View File

@ -1042,6 +1042,12 @@ SendCancelationRequest(MultiConnection *connection)
{
char errorBuffer[ERROR_BUFFER_SIZE] = { 0 };
if (!PQisBusy(connection->pgConn))
{
/* no statement in progress, nothing to cancel */
return false;
}
PGcancel *cancelObject = PQgetCancel(connection->pgConn);
if (cancelObject == NULL)
{