summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-07-29 15:57:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-07-29 15:57:16 +0000
commit2a88963536297c4227d5f400a3c44a1f6b98c503 (patch)
tree0296a343d4b7e1ff52f9ff8dd8f5a7201ae14a0e
parent3a261300b4490b7ddef656565916b93cfc3e13bd (diff)
Fix a thinko introduced into CountActiveBackends by a recent patch:
we should ignore NULL array entries, not non-NULL ones. This had the effect of disabling commit_delay, and could have caused a crash in the rare race condition the patch was intended to fix. Bug report and diagnosis by Jeff Janes, in bug #4952.
-rw-r--r--src/backend/storage/ipc/procarray.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index e71b95c8269..36701e61891 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -23,7 +23,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.50 2009/06/11 14:49:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.50.2.1 2009/07/29 15:57:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1137,7 +1137,7 @@ CountActiveBackends(void)
* free list and are recycled. Its contents are nonsense in that case,
* but that's acceptable for this function.
*/
- if (proc != NULL)
+ if (proc == NULL)
continue;
if (proc == MyProc)