public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?gb18030?B?emVuZ21hbg==?= <[email protected]>
To: =?gb18030?B?S2lyaWxsIFJlc2hrZQ==?= <[email protected]>
Cc: =?gb18030?B?cGdzcWwtaGFja2Vycw==?= <[email protected]>
Subject: Re: Use correct macro for accessing offset numbers.
Date: Mon, 12 Jan 2026 14:53:24 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALdSSPgzLF8Vx7S0HpJo4rR3tc6Wqnr68JZ9LMOoVGPZSM0dTA@mail.gmail.com>
References: <CALdSSPidtC7j3MwhkqRj0K2hyp36ztnnjSt6qzGxQtiePR1dzw@mail.gmail.com>
	<[email protected]>
	<CALdSSPgzLF8Vx7S0HpJo4rR3tc6Wqnr68JZ9LMOoVGPZSM0dTA@mail.gmail.com>

Hi,

I’ve also seen such cases in the kernel code, and I’m wondering if this should be added to the patch here?
```
postgres@zxm-VMware-Virtual-Platform:~/code/postgres$ git diff
diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c
index bcbc226125c..9dadd6da672 100644
--- a/src/backend/utils/adt/lockfuncs.c
+++ b/src/backend/utils/adt/lockfuncs.c
@@ -329,7 +329,7 @@ pg_lock_status(PG_FUNCTION_ARGS)
                                values[1] = ObjectIdGetDatum(instance->locktag.locktag_field1);
                                values[8] = ObjectIdGetDatum(instance->locktag.locktag_field2);
                                values[6] = ObjectIdGetDatum(instance->locktag.locktag_field3);
-                               values[9] = Int16GetDatum(instance->locktag.locktag_field4);
+                               values[9] = UInt16GetDatum(instance->locktag.locktag_field4);
                                nulls[2] = true;
                                nulls[3] = true;
                                nulls[4] = true;
@@ -343,7 +343,7 @@ pg_lock_status(PG_FUNCTION_ARGS)
                                values[1] = ObjectIdGetDatum(instance->locktag.locktag_field1);
                                values[7] = ObjectIdGetDatum(instance->locktag.locktag_field2);
                                values[8] = ObjectIdGetDatum(instance->locktag.locktag_field3);
-                               values[9] = Int16GetDatum(instance->locktag.locktag_field4);
+                               values[9] = UInt16GetDatum(instance->locktag.locktag_field4);
                                nulls[2] = true;
                                nulls[3] = true;
                                nulls[4] = true;
```

--
Regards,
Man Zeng
www.openhalo.org

view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Use correct macro for accessing offset numbers.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox