mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@ -1426,7 +1426,7 @@ heap_beginscan_bm(Relation relation, Snapshot snapshot,
|
||||
HeapScanDesc
|
||||
heap_beginscan_sampling(Relation relation, Snapshot snapshot,
|
||||
int nkeys, ScanKey key,
|
||||
bool allow_strat, bool allow_sync, bool allow_pagemode)
|
||||
bool allow_strat, bool allow_sync, bool allow_pagemode)
|
||||
{
|
||||
return heap_beginscan_internal(relation, snapshot, nkeys, key, NULL,
|
||||
allow_strat, allow_sync, allow_pagemode,
|
||||
@ -2244,7 +2244,7 @@ heap_get_latest_tid(Relation relation,
|
||||
* tuple. Check for XMIN match.
|
||||
*/
|
||||
if (TransactionIdIsValid(priorXmax) &&
|
||||
!TransactionIdEquals(priorXmax, HeapTupleHeaderGetXmin(tp.t_data)))
|
||||
!TransactionIdEquals(priorXmax, HeapTupleHeaderGetXmin(tp.t_data)))
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
break;
|
||||
@ -3735,8 +3735,8 @@ l2:
|
||||
*/
|
||||
if (xmax_infomask_changed(oldtup.t_data->t_infomask,
|
||||
infomask) ||
|
||||
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(oldtup.t_data),
|
||||
xwait))
|
||||
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(oldtup.t_data),
|
||||
xwait))
|
||||
goto l2;
|
||||
}
|
||||
|
||||
@ -3815,7 +3815,7 @@ l2:
|
||||
*/
|
||||
if (xmax_infomask_changed(oldtup.t_data->t_infomask, infomask) ||
|
||||
!TransactionIdEquals(xwait,
|
||||
HeapTupleHeaderGetRawXmax(oldtup.t_data)))
|
||||
HeapTupleHeaderGetRawXmax(oldtup.t_data)))
|
||||
goto l2;
|
||||
|
||||
/* Otherwise check if it committed or aborted */
|
||||
@ -4002,7 +4002,7 @@ l2:
|
||||
oldtup.t_data->t_infomask,
|
||||
oldtup.t_data->t_infomask2,
|
||||
xid, *lockmode, false,
|
||||
&xmax_lock_old_tuple, &infomask_lock_old_tuple,
|
||||
&xmax_lock_old_tuple, &infomask_lock_old_tuple,
|
||||
&infomask2_lock_old_tuple);
|
||||
|
||||
Assert(HEAP_XMAX_IS_LOCKED_ONLY(infomask_lock_old_tuple));
|
||||
@ -4177,7 +4177,7 @@ l2:
|
||||
* logged.
|
||||
*/
|
||||
old_key_tuple = ExtractReplicaIdentity(relation, &oldtup,
|
||||
bms_overlap(modified_attrs, id_attrs),
|
||||
bms_overlap(modified_attrs, id_attrs),
|
||||
&old_key_copied);
|
||||
|
||||
/* NO EREPORT(ERROR) from here till changes are logged */
|
||||
@ -4433,7 +4433,7 @@ HeapDetermineModifiedColumns(Relation relation, Bitmapset *interesting_cols,
|
||||
if (!heap_tuple_attr_equals(RelationGetDescr(relation),
|
||||
attnum, oldtup, newtup))
|
||||
modified = bms_add_member(modified,
|
||||
attnum - FirstLowInvalidHeapAttributeNumber);
|
||||
attnum - FirstLowInvalidHeapAttributeNumber);
|
||||
}
|
||||
|
||||
return modified;
|
||||
@ -4829,7 +4829,7 @@ l3:
|
||||
/* if the xmax changed in the meantime, start over */
|
||||
if (xmax_infomask_changed(tuple->t_data->t_infomask, infomask) ||
|
||||
!TransactionIdEquals(
|
||||
HeapTupleHeaderGetRawXmax(tuple->t_data),
|
||||
HeapTupleHeaderGetRawXmax(tuple->t_data),
|
||||
xwait))
|
||||
goto l3;
|
||||
/* otherwise, we're good */
|
||||
@ -4915,11 +4915,11 @@ l3:
|
||||
{
|
||||
case LockWaitBlock:
|
||||
MultiXactIdWait((MultiXactId) xwait, status, infomask,
|
||||
relation, &tuple->t_self, XLTW_Lock, NULL);
|
||||
relation, &tuple->t_self, XLTW_Lock, NULL);
|
||||
break;
|
||||
case LockWaitSkip:
|
||||
if (!ConditionalMultiXactIdWait((MultiXactId) xwait,
|
||||
status, infomask, relation,
|
||||
status, infomask, relation,
|
||||
NULL))
|
||||
{
|
||||
result = HeapTupleWouldBlock;
|
||||
@ -4930,12 +4930,12 @@ l3:
|
||||
break;
|
||||
case LockWaitError:
|
||||
if (!ConditionalMultiXactIdWait((MultiXactId) xwait,
|
||||
status, infomask, relation,
|
||||
status, infomask, relation,
|
||||
NULL))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_LOCK_NOT_AVAILABLE),
|
||||
errmsg("could not obtain lock on row in relation \"%s\"",
|
||||
RelationGetRelationName(relation))));
|
||||
RelationGetRelationName(relation))));
|
||||
|
||||
break;
|
||||
}
|
||||
@ -4973,7 +4973,7 @@ l3:
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_LOCK_NOT_AVAILABLE),
|
||||
errmsg("could not obtain lock on row in relation \"%s\"",
|
||||
RelationGetRelationName(relation))));
|
||||
RelationGetRelationName(relation))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -5224,8 +5224,8 @@ heap_acquire_tuplock(Relation relation, ItemPointer tid, LockTupleMode mode,
|
||||
if (!ConditionalLockTupleTuplock(relation, tid, mode))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_LOCK_NOT_AVAILABLE),
|
||||
errmsg("could not obtain lock on row in relation \"%s\"",
|
||||
RelationGetRelationName(relation))));
|
||||
errmsg("could not obtain lock on row in relation \"%s\"",
|
||||
RelationGetRelationName(relation))));
|
||||
break;
|
||||
}
|
||||
*have_tuple_lock = true;
|
||||
@ -5351,7 +5351,7 @@ l5:
|
||||
{
|
||||
if (HEAP_XMAX_IS_LOCKED_ONLY(old_infomask) ||
|
||||
!TransactionIdDidCommit(MultiXactIdGetUpdateXid(xmax,
|
||||
old_infomask)))
|
||||
old_infomask)))
|
||||
{
|
||||
/*
|
||||
* Reset these bits and restart; otherwise fall through to
|
||||
@ -5741,7 +5741,7 @@ l4:
|
||||
Assert(!HEAP_LOCKED_UPGRADED(mytup.t_data->t_infomask));
|
||||
|
||||
nmembers = GetMultiXactIdMembers(rawxmax, &members, false,
|
||||
HEAP_XMAX_IS_LOCKED_ONLY(old_infomask));
|
||||
HEAP_XMAX_IS_LOCKED_ONLY(old_infomask));
|
||||
for (i = 0; i < nmembers; i++)
|
||||
{
|
||||
result = test_lockmode_for_conflict(members[i].status,
|
||||
@ -7236,7 +7236,7 @@ heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_xid,
|
||||
/* need to check whether any member of the mxact is too old */
|
||||
|
||||
nmembers = GetMultiXactIdMembers(multi, &members, false,
|
||||
HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask));
|
||||
HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask));
|
||||
|
||||
for (i = 0; i < nmembers; i++)
|
||||
{
|
||||
@ -7639,7 +7639,7 @@ log_heap_update(Relation reln, Buffer oldbuf,
|
||||
{
|
||||
XLogRegisterBufData(0,
|
||||
((char *) newtup->t_data) + SizeofHeapTupleHeader,
|
||||
newtup->t_len - SizeofHeapTupleHeader - suffixlen);
|
||||
newtup->t_len - SizeofHeapTupleHeader - suffixlen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7651,14 +7651,14 @@ log_heap_update(Relation reln, Buffer oldbuf,
|
||||
if (newtup->t_data->t_hoff - SizeofHeapTupleHeader > 0)
|
||||
{
|
||||
XLogRegisterBufData(0,
|
||||
((char *) newtup->t_data) + SizeofHeapTupleHeader,
|
||||
newtup->t_data->t_hoff - SizeofHeapTupleHeader);
|
||||
((char *) newtup->t_data) + SizeofHeapTupleHeader,
|
||||
newtup->t_data->t_hoff - SizeofHeapTupleHeader);
|
||||
}
|
||||
|
||||
/* data after common prefix */
|
||||
XLogRegisterBufData(0,
|
||||
((char *) newtup->t_data) + newtup->t_data->t_hoff + prefixlen,
|
||||
newtup->t_len - newtup->t_data->t_hoff - prefixlen - suffixlen);
|
||||
((char *) newtup->t_data) + newtup->t_data->t_hoff + prefixlen,
|
||||
newtup->t_len - newtup->t_data->t_hoff - prefixlen - suffixlen);
|
||||
}
|
||||
|
||||
/* We need to log a tuple identity */
|
||||
|
@ -407,7 +407,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
|
||||
{
|
||||
heap_prune_record_unused(prstate, rootoffnum);
|
||||
HeapTupleHeaderAdvanceLatestRemovedXid(htup,
|
||||
&prstate->latestRemovedXid);
|
||||
&prstate->latestRemovedXid);
|
||||
ndeleted++;
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
|
||||
{
|
||||
latestdead = offnum;
|
||||
HeapTupleHeaderAdvanceLatestRemovedXid(htup,
|
||||
&prstate->latestRemovedXid);
|
||||
&prstate->latestRemovedXid);
|
||||
}
|
||||
else if (!recent_dead)
|
||||
break;
|
||||
|
@ -1628,7 +1628,7 @@ toast_save_datum(Relation rel, Datum value,
|
||||
{
|
||||
toast_pointer.va_valueid =
|
||||
GetNewOidWithIndex(toastrel,
|
||||
RelationGetRelid(toastidxs[validIndex]),
|
||||
RelationGetRelid(toastidxs[validIndex]),
|
||||
(AttrNumber) 1);
|
||||
} while (toastid_valueid_exists(rel->rd_toastoid,
|
||||
toast_pointer.va_valueid));
|
||||
@ -2168,7 +2168,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length)
|
||||
init_toast_snapshot(&SnapshotToast);
|
||||
nextidx = startchunk;
|
||||
toastscan = systable_beginscan_ordered(toastrel, toastidxs[validIndex],
|
||||
&SnapshotToast, nscankeys, toastkey);
|
||||
&SnapshotToast, nscankeys, toastkey);
|
||||
while ((ttup = systable_getnext_ordered(toastscan, ForwardScanDirection)) != NULL)
|
||||
{
|
||||
/*
|
||||
|
@ -592,7 +592,7 @@ vm_readbuf(Relation rel, BlockNumber blkno, bool extend)
|
||||
{
|
||||
if (smgrexists(rel->rd_smgr, VISIBILITYMAP_FORKNUM))
|
||||
rel->rd_smgr->smgr_vm_nblocks = smgrnblocks(rel->rd_smgr,
|
||||
VISIBILITYMAP_FORKNUM);
|
||||
VISIBILITYMAP_FORKNUM);
|
||||
else
|
||||
rel->rd_smgr->smgr_vm_nblocks = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user