[PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

Jianghua Yang <yjhjstz@gmail.com>

From: Jianghua Yang <yjhjstz@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-06-26T19:51:10Z
Lists: pgsql-hackers

Attachments

Hi,

The attached patch fixes a minor type mismatch in `test_shm_mq_main()`.

The argument passed to `dsm_attach()` is expected to be a `uint32`, but the
code currently uses `DatumGetInt32()` to extract it from the `Datum`
argument. This can lead to incorrect behavior when the high bit is set, as
'unable to map dynamic shared memory segment'.

This patch changes it to use `DatumGetUInt32()` to match the expected type
and ensure correctness.


Thanks,
Jianghua Yang

Commits

  1. Use correct DatumGet*() function in test_shm_mq_main().