Use correct type for pq_mq_parallel_leader_proc_number variable
authorHeikki Linnakangas
Mon, 15 Jul 2024 08:12:22 +0000 (11:12 +0300)
committerHeikki Linnakangas
Mon, 15 Jul 2024 08:12:22 +0000 (11:12 +0300)
It's a ProcNumber, not a process id. Both are integers, so it's
harmless, but clearly wrong. It's been wrong since forever, the
mistake has survived through a couple of refactorings already.

Spotted-by: Thomas Munro
Discussion: https://www.postgresql.org/message-id/CA+hUKGKPTLSGMyE4Brin-osY8omPLNXmVWDMfrRABLp=6QrR_Q@mail.gmail.com

src/backend/libpq/pqmq.c

index 00a44ca803fb4ac6bf4c6147cea2fcebc6d50a3d..fd735e2fea9d6e494167a45a0ed0f8a8ff12403c 100644 (file)
@@ -26,7 +26,7 @@
 static shm_mq_handle *pq_mq_handle;
 static bool pq_mq_busy = false;
 static pid_t pq_mq_parallel_leader_pid = 0;
-static pid_t pq_mq_parallel_leader_proc_number = INVALID_PROC_NUMBER;
+static ProcNumber pq_mq_parallel_leader_proc_number = INVALID_PROC_NUMBER;
 
 static void pq_cleanup_redirect_to_shm_mq(dsm_segment *seg, Datum arg);
 static void mq_comm_reset(void);