postgres.git / summary / log / commit / refs

commit    e9d2f68632aaa12cd7a17a33675a947734df2be6
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Wed Jul 29 15:57:23 2009 +0000
First released in: 9.0.0, 8.1.18, 8.2.14, 8.3.8, 8.4.1

    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.


src/backend/storage/ipc/procarray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index a9ae969f31e..94459cc1993 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.40.2.1 2009/03/31 05:18:39 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.40.2.2 2009/07/29 15:57:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1101,7 +1101,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) [parent: fe37cbb84160]