1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-22 23:02:54 +03:00

Setting MyProc->xid to current transaction' id in StartTransaction

and to InvalidTransactionId in CommitTransaction & AbortTransaction
(it's for new TransactionIdIsInProgress func).
This commit is contained in:
Vadim B. Mikheev 1996-11-27 07:14:51 +00:00
parent 1db76d708c
commit 713b65e19c

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* Transaction aborts can now occur two ways: * Transaction aborts can now occur two ways:
@ -754,6 +754,14 @@ StartTransaction()
* ---------------- * ----------------
*/ */
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()) if (IsNormalProcessingMode())
Async_NotifyAtCommit(); 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; 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 * check the current transaction state
* ---------------- * ----------------