Skip to content

Commit 254c63e

Browse files
committed
pgrowlocks: Fix incorrect format placeholders
Transaction IDs should be printed as unsigned, similar to xidout().
1 parent 1a2aaeb commit 254c63e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/pgrowlocks/pgrowlocks.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
168168
PointerGetDatum(&tuple->t_self));
169169

170170
values[Atnum_xmax] = palloc(NCHARS * sizeof(char));
171-
snprintf(values[Atnum_xmax], NCHARS, "%d", xmax);
171+
snprintf(values[Atnum_xmax], NCHARS, "%u", xmax);
172172
if (infomask & HEAP_XMAX_IS_MULTI)
173173
{
174174
MultiXactMember *members;
@@ -209,7 +209,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
209209
strcat(values[Atnum_modes], ",");
210210
strcat(values[Atnum_pids], ",");
211211
}
212-
snprintf(buf, NCHARS, "%d", members[j].xid);
212+
snprintf(buf, NCHARS, "%u", members[j].xid);
213213
strcat(values[Atnum_xids], buf);
214214
switch (members[j].status)
215215
{
@@ -250,7 +250,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
250250
values[Atnum_ismulti] = pstrdup("false");
251251

252252
values[Atnum_xids] = palloc(NCHARS * sizeof(char));
253-
snprintf(values[Atnum_xids], NCHARS, "{%d}", xmax);
253+
snprintf(values[Atnum_xids], NCHARS, "{%u}", xmax);
254254

255255
values[Atnum_modes] = palloc(NCHARS);
256256
if (infomask & HEAP_XMAX_LOCK_ONLY)

0 commit comments

Comments
 (0)