mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Fix query cancellation.
In commit fe0a0b59
, the datatype used for MyCancelKey and other variables
that store cancel keys were changed from long to uint32, but I missed this
one. That broke query cancellation on platforms where long is wider than 32
bits.
Report by Andres Freund, fix by Michael Paquier.
This commit is contained in:
@ -2216,7 +2216,7 @@ processCancelRequest(Port *port, void *pkt)
|
|||||||
{
|
{
|
||||||
CancelRequestPacket *canc = (CancelRequestPacket *) pkt;
|
CancelRequestPacket *canc = (CancelRequestPacket *) pkt;
|
||||||
int backendPID;
|
int backendPID;
|
||||||
long cancelAuthCode;
|
int32 cancelAuthCode;
|
||||||
Backend *bp;
|
Backend *bp;
|
||||||
|
|
||||||
#ifndef EXEC_BACKEND
|
#ifndef EXEC_BACKEND
|
||||||
@ -2226,7 +2226,7 @@ processCancelRequest(Port *port, void *pkt)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
backendPID = (int) ntohl(canc->backendPID);
|
backendPID = (int) ntohl(canc->backendPID);
|
||||||
cancelAuthCode = (long) ntohl(canc->cancelAuthCode);
|
cancelAuthCode = (int32) ntohl(canc->cancelAuthCode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if we have a matching backend. In the EXEC_BACKEND case, we can no
|
* See if we have a matching backend. In the EXEC_BACKEND case, we can no
|
||||||
|
Reference in New Issue
Block a user