diff options
author | Alvaro Herrera | 2013-01-31 22:11:34 +0000 |
---|---|---|
committer | Alvaro Herrera | 2013-01-31 22:15:35 +0000 |
commit | 77a3082fc546774808b76f58173caec3852ebf62 (patch) | |
tree | e8a915906df04672bef73e213a270ae7e50b6ce4 | |
parent | a11e15c7b66c647269ecad73560be0e717ffc400 (diff) |
pgrowlocks: fix bogus lock strength output
Per report from digoal@126.com
-rw-r--r-- | contrib/pgrowlocks/pgrowlocks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c index 43ada57352..98aa7c80c0 100644 --- a/contrib/pgrowlocks/pgrowlocks.c +++ b/contrib/pgrowlocks/pgrowlocks.c @@ -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, @@ -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)); |