mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
SET TRANSACTION ISOLATION LEVEL ...
LOCK TABLE IN ... MODE ...implemented
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.17 1998/09/01 04:27:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.18 1998/12/18 09:10:17 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -311,6 +311,42 @@ GetNewTransactionId(TransactionId *xid)
|
||||
SpinRelease(OidGenLockId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Like GetNewTransactionId reads nextXid but don't fetch it.
|
||||
*/
|
||||
void
|
||||
ReadNewTransactionId(TransactionId *xid)
|
||||
{
|
||||
|
||||
/* ----------------
|
||||
* during bootstrap initialization, we return the special
|
||||
* bootstrap transaction id.
|
||||
* ----------------
|
||||
*/
|
||||
if (AMI_OVERRIDE)
|
||||
{
|
||||
TransactionIdStore(AmiTransactionId, xid);
|
||||
return;
|
||||
}
|
||||
|
||||
SpinAcquire(OidGenLockId); /* not good for concurrency... */
|
||||
|
||||
if (ShmemVariableCache->xid_count == 0)
|
||||
{
|
||||
TransactionId nextid;
|
||||
|
||||
VariableRelationGetNextXid(&nextid);
|
||||
TransactionIdStore(nextid, &(ShmemVariableCache->nextXid));
|
||||
ShmemVariableCache->xid_count = VAR_XID_PREFETCH;
|
||||
TransactionIdAdd(&nextid, VAR_XID_PREFETCH);
|
||||
VariableRelationPutNextXid(nextid);
|
||||
}
|
||||
|
||||
TransactionIdStore(ShmemVariableCache->nextXid, xid);
|
||||
|
||||
SpinRelease(OidGenLockId);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* object id generation support
|
||||
* ----------------------------------------------------------------
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.27 1998/12/16 11:53:44 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.28 1998/12/18 09:10:18 vadim Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Transaction aborts can now occur two ways:
|
||||
@@ -194,7 +194,8 @@ TransactionStateData CurrentTransactionStateData = {
|
||||
TransactionState CurrentTransactionState =
|
||||
&CurrentTransactionStateData;
|
||||
|
||||
int XactIsoLevel = XACT_SERIALIZED;
|
||||
int DefaultXactIsoLevel = XACT_SERIALIZABLE;
|
||||
int XactIsoLevel;
|
||||
|
||||
/* ----------------
|
||||
* info returned when the system is disabled
|
||||
@@ -798,6 +799,7 @@ StartTransaction()
|
||||
|
||||
TransactionIdFlushCache();
|
||||
FreeXactSnapshot();
|
||||
XactIsoLevel = DefaultXactIsoLevel;
|
||||
|
||||
/* ----------------
|
||||
* Check the current transaction state. If the transaction system
|
||||
|
Reference in New Issue
Block a user