From: Vadim B. Mikheev Date: Wed, 27 Nov 1996 07:14:51 +0000 (+0000) Subject: Setting MyProc->xid to current transaction' id in StartTransaction X-Git-Tag: REL2_0~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=713b65e19c1cf58bbc5dd4dd8845ddf4a67aaa26;p=thirdparty%2Fpostgresql.git Setting MyProc->xid to current transaction' id in StartTransaction and to InvalidTransactionId in CommitTransaction & AbortTransaction (it's for new TransactionIdIsInProgress func). --- diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index ff8908de095..e58502ccaa8 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.5 1996/11/10 02:59:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.6 1996/11/27 07:14:51 vadim Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -753,7 +753,15 @@ StartTransaction() * state to "in progress" * ---------------- */ - s->state = TRANS_INPROGRESS; + s->state = TRANS_INPROGRESS; + + /* + * Let others to know about current transaction is in progress + * - vadim 11/26/96 + */ + if ( MyProc != (PROC*) NULL ) + MyProc->xid = s->transactionIdData; + } /* --------------- @@ -815,6 +823,13 @@ CommitTransaction() if (IsNormalProcessingMode()) Async_NotifyAtCommit(); } + + /* + * Let others to know about no transaction in progress + * - vadim 11/26/96 + */ + if ( MyProc != (PROC*) NULL ) + MyProc->xid = InvalidTransactionId; } /* -------------------------------- @@ -827,6 +842,13 @@ AbortTransaction() { TransactionState s = CurrentTransactionState; + /* + * Let others to know about no transaction in progress + * - vadim 11/26/96 + */ + if ( MyProc != (PROC*) NULL ) + MyProc->xid = InvalidTransactionId; + /* ---------------- * check the current transaction state * ----------------