Commit 77a3082f authored by Alvaro Herrera's avatar Alvaro Herrera

pgrowlocks: fix bogus lock strength output

Per report from digoal@126.com
parent a11e15c7
...@@ -247,7 +247,12 @@ pgrowlocks(PG_FUNCTION_ARGS) ...@@ -247,7 +247,12 @@ pgrowlocks(PG_FUNCTION_ARGS)
else if (HEAP_XMAX_IS_KEYSHR_LOCKED(infomask)) else if (HEAP_XMAX_IS_KEYSHR_LOCKED(infomask))
snprintf(values[Atnum_modes], NCHARS, "{For Key Share}"); snprintf(values[Atnum_modes], NCHARS, "{For Key Share}");
else if (HEAP_XMAX_IS_EXCL_LOCKED(infomask)) else if (HEAP_XMAX_IS_EXCL_LOCKED(infomask))
{
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
snprintf(values[Atnum_modes], NCHARS, "{For Update}"); snprintf(values[Atnum_modes], NCHARS, "{For Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{For No Key Update}");
}
else else
/* neither keyshare nor exclusive bit it set */ /* neither keyshare nor exclusive bit it set */
snprintf(values[Atnum_modes], NCHARS, snprintf(values[Atnum_modes], NCHARS,
...@@ -256,9 +261,9 @@ pgrowlocks(PG_FUNCTION_ARGS) ...@@ -256,9 +261,9 @@ pgrowlocks(PG_FUNCTION_ARGS)
else else
{ {
if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED) if (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED)
snprintf(values[Atnum_modes], NCHARS, "{Key Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{Update}"); snprintf(values[Atnum_modes], NCHARS, "{Update}");
else
snprintf(values[Atnum_modes], NCHARS, "{No Key Update}");
} }
values[Atnum_pids] = palloc(NCHARS * sizeof(char)); values[Atnum_pids] = palloc(NCHARS * sizeof(char));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment