diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-10-16 16:50:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-10-16 16:50:41 +0000 |
commit | 90b22029755121a61812e991838391bd40ba2bbf (patch) | |
tree | 201dc497b0516616e1ff07403a77a5c367073f49 /src/backend/commands/async.c | |
parent | 839cea8814ca8fc19aed01eface17c4ec9466218 (diff) | |
download | postgresql-90b22029755121a61812e991838391bd40ba2bbf.tar.gz postgresql-90b22029755121a61812e991838391bd40ba2bbf.zip |
Fix bad interaction between NOTIFY processing and V3 extended query
protocol, per report from Igor Shevchenko. NOTIFY thought it could
do its thing if transaction blockState is TBLOCK_DEFAULT, but in
reality it had better check the low-level transaction state is
TRANS_DEFAULT as well. Formerly it was not possible to wait for the
client in a state where the first is true and the second is not ...
but now we can have such a state. Minor cleanup in StartTransaction()
as well.
Diffstat (limited to 'src/backend/commands/async.c')
-rw-r--r-- | src/backend/commands/async.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index d977995f5ff..f0dde27bb17 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.101 2003/10/01 21:30:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.102 2003/10/16 16:50:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -91,10 +91,6 @@ #include "utils/syscache.h" -/* stuff that we really ought not be touching directly :-( */ -extern TransactionState CurrentTransactionState; - - /* * State for outbound notifies consists of a list of all relnames NOTIFYed * in the current transaction. We do not actually perform a NOTIFY until @@ -717,7 +713,7 @@ Async_NotifyHandler(SIGNAL_ARGS) void EnableNotifyInterrupt(void) { - if (CurrentTransactionState->blockState != TRANS_DEFAULT) + if (IsTransactionOrTransactionBlock()) return; /* not really idle */ /* |