aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/commit_ts.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-09-10 13:49:04 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-09-10 13:49:04 -0400
commitddc889317912fd8b654439701195a43cecfd4e79 (patch)
tree4a717a4d7f4d64a18cd7f4752b9c0323b2c76914 /src/backend/access/transam/commit_ts.c
parent24992c6db9fd40f342db1f22747ec9e56483796d (diff)
downloadpostgresql-ddc889317912fd8b654439701195a43cecfd4e79.tar.gz
postgresql-ddc889317912fd8b654439701195a43cecfd4e79.zip
Fix miserable coding in pg_stat_get_activity().
Commit dd1a3bccc replaced a test on whether a subroutine returned a null pointer with a test on whether &pointer->backendStatus was null. This accidentally failed to fail, at least on common compilers, because backendStatus is the first field in the struct; but it was surely trouble waiting to happen. Commit f91feba87 then messed things up further, changing the logic to local_beentry = pgstat_fetch_stat_local_beentry(curr_backend); if (!local_beentry) continue; beentry = &local_beentry->backendStatus; if (!beentry) { where the second "if" is now dead code, so that the intended behavior of printing a row with "<backend information not available>" cannot occur. I suspect this is all moot because pgstat_fetch_stat_local_beentry will never actually return null in this function's usage, but it's still very poor coding. Repair back to 9.4 where the original problem was introduced.
Diffstat (limited to 'src/backend/access/transam/commit_ts.c')
0 files changed, 0 insertions, 0 deletions