mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
pgindent run for 9.5
This commit is contained in:
@@ -121,6 +121,7 @@ HeapTupleHeaderGetCmax(HeapTupleHeader tup)
|
||||
CommandId cid = HeapTupleHeaderGetRawCommandId(tup);
|
||||
|
||||
Assert(!(tup->t_infomask & HEAP_MOVED));
|
||||
|
||||
/*
|
||||
* Because GetUpdateXid() performs memory allocations if xmax is a
|
||||
* multixact we can't Assert() if we're inside a critical section. This
|
||||
@@ -128,7 +129,7 @@ HeapTupleHeaderGetCmax(HeapTupleHeader tup)
|
||||
* things too much.
|
||||
*/
|
||||
Assert(CritSectionCount > 0 ||
|
||||
TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tup)));
|
||||
TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tup)));
|
||||
|
||||
if (tup->t_infomask & HEAP_COMBOCID)
|
||||
return GetRealCmax(cid);
|
||||
@@ -317,7 +318,7 @@ SerializeComboCIDState(Size maxsize, char *start_address)
|
||||
char *endptr;
|
||||
|
||||
/* First, we store the number of currently-existing ComboCIDs. */
|
||||
* (int *) start_address = usedComboCids;
|
||||
*(int *) start_address = usedComboCids;
|
||||
|
||||
/* If maxsize is too small, throw an error. */
|
||||
endptr = start_address + sizeof(int) +
|
||||
@@ -347,7 +348,7 @@ RestoreComboCIDState(char *comboCIDstate)
|
||||
Assert(!comboCids && !comboHash);
|
||||
|
||||
/* First, we retrieve the number of ComboCIDs that were serialized. */
|
||||
num_elements = * (int *) comboCIDstate;
|
||||
num_elements = *(int *) comboCIDstate;
|
||||
keydata = (ComboCidKeyData *) (comboCIDstate + sizeof(int));
|
||||
|
||||
/* Use GetComboCommandId to restore each ComboCID. */
|
||||
|
@@ -131,7 +131,7 @@ static ActiveSnapshotElt *ActiveSnapshot = NULL;
|
||||
static int xmin_cmp(const pairingheap_node *a, const pairingheap_node *b,
|
||||
void *arg);
|
||||
|
||||
static pairingheap RegisteredSnapshots = { &xmin_cmp, NULL, NULL };
|
||||
static pairingheap RegisteredSnapshots = {&xmin_cmp, NULL, NULL};
|
||||
|
||||
/* first GetTransactionSnapshot call in a transaction? */
|
||||
bool FirstSnapshotSet = false;
|
||||
@@ -313,10 +313,10 @@ GetNonHistoricCatalogSnapshot(Oid relid)
|
||||
{
|
||||
/*
|
||||
* If the caller is trying to scan a relation that has no syscache, no
|
||||
* catcache invalidations will be sent when it is updated. For a few
|
||||
* key relations, snapshot invalidations are sent instead. If we're
|
||||
* trying to scan a relation for which neither catcache nor snapshot
|
||||
* invalidations are sent, we must refresh the snapshot every time.
|
||||
* catcache invalidations will be sent when it is updated. For a few key
|
||||
* relations, snapshot invalidations are sent instead. If we're trying to
|
||||
* scan a relation for which neither catcache nor snapshot invalidations
|
||||
* are sent, we must refresh the snapshot every time.
|
||||
*/
|
||||
if (!CatalogSnapshotStale && !RelationInvalidatesSnapshotsOnly(relid) &&
|
||||
!RelationHasSysCache(relid))
|
||||
@@ -587,7 +587,9 @@ PushCopiedSnapshot(Snapshot snapshot)
|
||||
void
|
||||
UpdateActiveSnapshotCommandId(void)
|
||||
{
|
||||
CommandId save_curcid, curcid;
|
||||
CommandId save_curcid,
|
||||
curcid;
|
||||
|
||||
Assert(ActiveSnapshot != NULL);
|
||||
Assert(ActiveSnapshot->as_snap->active_count == 1);
|
||||
Assert(ActiveSnapshot->as_snap->regd_count == 0);
|
||||
@@ -772,7 +774,7 @@ xmin_cmp(const pairingheap_node *a, const pairingheap_node *b, void *arg)
|
||||
static void
|
||||
SnapshotResetXmin(void)
|
||||
{
|
||||
Snapshot minSnapshot;
|
||||
Snapshot minSnapshot;
|
||||
|
||||
if (ActiveSnapshot != NULL)
|
||||
return;
|
||||
@@ -897,7 +899,8 @@ AtEOXact_Snapshot(bool isCommit)
|
||||
*/
|
||||
foreach(lc, exportedSnapshots)
|
||||
{
|
||||
Snapshot snap = (Snapshot) lfirst(lc);
|
||||
Snapshot snap = (Snapshot) lfirst(lc);
|
||||
|
||||
pairingheap_remove(&RegisteredSnapshots, &snap->ph_node);
|
||||
}
|
||||
|
||||
@@ -1472,8 +1475,8 @@ EstimateSnapshotSpace(Snapshot snap)
|
||||
|
||||
/*
|
||||
* SerializeSnapshot
|
||||
* Dumps the serialized snapshot (extracted from given snapshot) onto the
|
||||
* memory location at start_address.
|
||||
* Dumps the serialized snapshot (extracted from given snapshot) onto the
|
||||
* memory location at start_address.
|
||||
*/
|
||||
void
|
||||
SerializeSnapshot(Snapshot snapshot, char *start_address)
|
||||
@@ -1494,9 +1497,9 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
|
||||
serialized_snapshot->curcid = snapshot->curcid;
|
||||
|
||||
/*
|
||||
* Ignore the SubXID array if it has overflowed, unless the snapshot
|
||||
* was taken during recovey - in that case, top-level XIDs are in subxip
|
||||
* as well, and we mustn't lose them.
|
||||
* Ignore the SubXID array if it has overflowed, unless the snapshot was
|
||||
* taken during recovey - in that case, top-level XIDs are in subxip as
|
||||
* well, and we mustn't lose them.
|
||||
*/
|
||||
if (serialized_snapshot->suboverflowed && !snapshot->takenDuringRecovery)
|
||||
serialized_snapshot->subxcnt = 0;
|
||||
@@ -1514,8 +1517,8 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
|
||||
*/
|
||||
if (snapshot->subxcnt > 0)
|
||||
{
|
||||
Size subxipoff = sizeof(SerializedSnapshotData) +
|
||||
snapshot->xcnt * sizeof(TransactionId);
|
||||
Size subxipoff = sizeof(SerializedSnapshotData) +
|
||||
snapshot->xcnt * sizeof(TransactionId);
|
||||
|
||||
memcpy((TransactionId *) ((char *) serialized_snapshot + subxipoff),
|
||||
snapshot->subxip, snapshot->subxcnt * sizeof(TransactionId));
|
||||
|
@@ -405,6 +405,7 @@ HeapTupleSatisfiesToast(HeapTuple htup, Snapshot snapshot,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* An invalid Xmin can be left behind by a speculative insertion that
|
||||
* is cancelled by super-deleting the tuple. We shouldn't see any of
|
||||
@@ -550,7 +551,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
|
||||
if (!TransactionIdIsCurrentTransactionId(xmax))
|
||||
{
|
||||
if (MultiXactIdIsRunning(HeapTupleHeaderGetRawXmax(tuple),
|
||||
false))
|
||||
false))
|
||||
return HeapTupleBeingUpdated;
|
||||
return HeapTupleMayBeUpdated;
|
||||
}
|
||||
@@ -820,10 +821,10 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
|
||||
else if (TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple)))
|
||||
{
|
||||
/*
|
||||
* Return the speculative token to caller. Caller can worry
|
||||
* about xmax, since it requires a conclusively locked row
|
||||
* version, and a concurrent update to this tuple is a conflict
|
||||
* of its purposes.
|
||||
* Return the speculative token to caller. Caller can worry about
|
||||
* xmax, since it requires a conclusively locked row version, and
|
||||
* a concurrent update to this tuple is a conflict of its
|
||||
* purposes.
|
||||
*/
|
||||
if (HeapTupleHeaderIsSpeculative(tuple))
|
||||
{
|
||||
|
Reference in New Issue
Block a user