Content-Length: 288860 | pFad | http://github.com/postgrespro/postgres/commit/77a3082fc546774808b76f58173caec3852ebf62

4F pgrowlocks: fix bogus lock strength output · postgrespro/postgres@77a3082 · GitHub
Skip to content

Commit 77a3082

Browse files
committed
pgrowlocks: fix bogus lock strength output
Per report from digoal@126.com
1 parent a11e15c commit 77a3082

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

contrib/pgrowlocks/pgrowlocks.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,12 @@ pgrowlocks(PG_FUNCTION_ARGS)
247247
else if (HEAP_XMAX_IS_KEYSHR_LOCKED(infomask))
248248
snprintf(values[Atnum_modes], NCHARS, "{For Key Share}");
249249
else if (HEAP_XMAX_IS_EXCL_LOCKED(infomask))
250-
snprintf(values[Atnum_modes], NCHARS, "{For Update}");
250+
{
251+
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
252+
snprintf(values[Atnum_modes], NCHARS, "{For Update}");
253+
else
254+
snprintf(values[Atnum_modes], NCHARS, "{For No Key Update}");
255+
}
251256
else
252257
/* neither keyshare nor exclusive bit it set */
253258
snprintf(values[Atnum_modes], NCHARS,
@@ -256,9 +261,9 @@ pgrowlocks(PG_FUNCTION_ARGS)
256261
else
257262
{
258263
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
259-
snprintf(values[Atnum_modes], NCHARS, "{Key Update}");
260-
else
261264
snprintf(values[Atnum_modes], NCHARS, "{Update}");
265+
else
266+
snprintf(values[Atnum_modes], NCHARS, "{No Key Update}");
262267
}
263268

264269
values[Atnum_pids] = palloc(NCHARS * sizeof(char));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/77a3082fc546774808b76f58173caec3852ebf62

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy