Skip to content

Commit

Permalink
pgrowlocks: fix bogus lock strength output
Browse files Browse the repository at this point in the history
Per report from digoal@126.com
  • Loading branch information
alvherre committed Jan 31, 2013
1 parent a11e15c commit 77a3082
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions contrib/pgrowlocks/pgrowlocks.c
Expand Up @@ -247,7 +247,12 @@ pgrowlocks(PG_FUNCTION_ARGS)
else if (HEAP_XMAX_IS_KEYSHR_LOCKED(infomask))
snprintf(values[Atnum_modes], NCHARS, "{For Key Share}");
else if (HEAP_XMAX_IS_EXCL_LOCKED(infomask))
snprintf(values[Atnum_modes], NCHARS, "{For Update}");
{
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
snprintf(values[Atnum_modes], NCHARS, "{For Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{For No Key Update}");
}
else
/* neither keyshare nor exclusive bit it set */
snprintf(values[Atnum_modes], NCHARS,
Expand All @@ -256,9 +261,9 @@ pgrowlocks(PG_FUNCTION_ARGS)
else
{
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
snprintf(values[Atnum_modes], NCHARS, "{Key Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{No Key Update}");
}

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

0 comments on commit 77a3082

Please sign in to comment.