diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 15:57:33 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 15:57:33 +0000 |
commit | aea7affde737d70da5cf0ffbc0c11bea323b81f4 (patch) | |
tree | fc5ef2713b086ae4791e0a4350c795d3e6fdc7cb | |
parent | a142498e76a74b64ea03b13809db96c7c5e6f62e (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index 8f110e6ae29..a4c8814ce1a 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.19.2.1 2009/03/31 05:18:43 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.19.2.2 2009/07/29 15:57:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -836,7 +836,7 @@ CountActiveBackends(void) * the 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) |