[PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main() - Mailing list pgsql-hackers

From Jianghua Yang
Subject [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()
Date
Msg-id CAAZLFmRxkUD5jRs0W3K=Ue4_ZS+RcAb0PCE1S0vVJBn3sWH2UQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()
List pgsql-hackers
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
Attachment

pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Remove unneeded check for XLH_INSERT_ALL_FROZEN in heap_xlog_insert
Next
From: Nathan Bossart
Date:
Subject: Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()