diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 15:57:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 15:57:39 +0000 |
commit | a0381f267912063547d7911f2c4600da20ded024 (patch) | |
tree | f34fd5e5ce6c615b9f69390deccd58cd652a2b2b /src | |
parent | b99751a199742f1b50e0fc3f8249b53d69c8eb88 (diff) | |
download | postgresql-a0381f267912063547d7911f2c4600da20ded024.tar.gz postgresql-a0381f267912063547d7911f2c4600da20ded024.zip |
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.
Diffstat (limited to 'src')
-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 dd2b4b05f82..555e465a825 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.7.2.2 2009/03/31 05:18:47 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.7.2.3 2009/07/29 15:57:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -768,7 +768,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) |