From 734c2a28c905326bcf3e018fb9a984ca3b0f2e64 Mon Sep 17 00:00:00 2001
From: Jianghua Yang <yjhjstz@gmail.com>
Date: Thu, 26 Jun 2025 12:47:11 -0700
Subject: [PATCH] Fix type mismatch in dsm_attach() argument by using
 DatumGetUInt32()

The argument passed to dsm_attach() represents a dynamic shared memory
segment handle, which is defined as a uint32. The existing code incorrectly
used DatumGetInt32(), which may lead to unexpected behavior if the value
exceeds the range of a signed 32-bit integer.
---
 src/test/modules/test_shm_mq/worker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/modules/test_shm_mq/worker.c b/src/test/modules/test_shm_mq/worker.c
index 96cd304dbbc..c1d321b69a4 100644
--- a/src/test/modules/test_shm_mq/worker.c
+++ b/src/test/modules/test_shm_mq/worker.c
@@ -77,7 +77,7 @@ test_shm_mq_main(Datum main_arg)
 	 * exit, which is fine.  If there were a ResourceOwner, it would acquire
 	 * ownership of the mapping, but we have no need for that.
 	 */
-	seg = dsm_attach(DatumGetInt32(main_arg));
+	seg = dsm_attach(DatumGetUInt32(main_arg));
 	if (seg == NULL)
 		ereport(ERROR,
 				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
-- 
2.39.5 (Apple Git-154)

