mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4d
wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
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:
@ -344,7 +344,7 @@ ExecBuildProjectionInfo(List *targetList,
|
||||
attnum = variable->varattno;
|
||||
|
||||
if (inputDesc == NULL)
|
||||
isSafeVar = true; /* can't check, just assume OK */
|
||||
isSafeVar = true; /* can't check, just assume OK */
|
||||
else if (attnum <= inputDesc->natts)
|
||||
{
|
||||
Form_pg_attribute attr = inputDesc->attrs[attnum - 1];
|
||||
@ -1362,7 +1362,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state,
|
||||
|
||||
/* If WHEN result isn't true, jump to next CASE arm */
|
||||
scratch.opcode = EEOP_JUMP_IF_NOT_TRUE;
|
||||
scratch.d.jump.jumpdone = -1; /* computed later */
|
||||
scratch.d.jump.jumpdone = -1; /* computed later */
|
||||
ExprEvalPushStep(state, &scratch);
|
||||
whenstep = state->steps_len - 1;
|
||||
|
||||
@ -1374,7 +1374,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state,
|
||||
|
||||
/* Emit JUMP step to jump to end of CASE's code */
|
||||
scratch.opcode = EEOP_JUMP;
|
||||
scratch.d.jump.jumpdone = -1; /* computed later */
|
||||
scratch.d.jump.jumpdone = -1; /* computed later */
|
||||
ExprEvalPushStep(state, &scratch);
|
||||
|
||||
/*
|
||||
@ -1720,7 +1720,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state,
|
||||
|
||||
/* if it's not null, skip to end of COALESCE expr */
|
||||
scratch.opcode = EEOP_JUMP_IF_NOT_NULL;
|
||||
scratch.d.jump.jumpdone = -1; /* adjust later */
|
||||
scratch.d.jump.jumpdone = -1; /* adjust later */
|
||||
ExprEvalPushStep(state, &scratch);
|
||||
|
||||
adjust_jumps = lappend_int(adjust_jumps,
|
||||
|
@ -83,7 +83,7 @@
|
||||
*/
|
||||
#ifdef HAVE_COMPUTED_GOTO
|
||||
#define EEO_USE_COMPUTED_GOTO
|
||||
#endif /* HAVE_COMPUTED_GOTO */
|
||||
#endif /* HAVE_COMPUTED_GOTO */
|
||||
|
||||
/*
|
||||
* Macros for opcode dispatch.
|
||||
@ -112,7 +112,7 @@ static const void **dispatch_table = NULL;
|
||||
#define EEO_DISPATCH() goto starteval
|
||||
#define EEO_OPCODE(opcode) (opcode)
|
||||
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
|
||||
#define EEO_NEXT() \
|
||||
do { \
|
||||
@ -256,7 +256,7 @@ ExecReadyInterpretedExpr(ExprState *state)
|
||||
|
||||
state->flags |= EEO_FLAG_DIRECT_THREADED;
|
||||
}
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
|
||||
state->evalfunc = ExecInterpExpr;
|
||||
}
|
||||
@ -373,7 +373,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
return PointerGetDatum(dispatch_table);
|
||||
#else
|
||||
Assert(state != NULL);
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
#endif /* EEO_USE_COMPUTED_GOTO */
|
||||
|
||||
/* setup state */
|
||||
op = state->steps;
|
||||
@ -1559,7 +1559,7 @@ CheckVarSlotCompatibility(TupleTableSlot *slot, int attnum, Oid vartype)
|
||||
TupleDesc slot_tupdesc = slot->tts_tupleDescriptor;
|
||||
Form_pg_attribute attr;
|
||||
|
||||
if (attnum > slot_tupdesc->natts) /* should never happen */
|
||||
if (attnum > slot_tupdesc->natts) /* should never happen */
|
||||
elog(ERROR, "attribute number %d exceeds number of columns %d",
|
||||
attnum, slot_tupdesc->natts);
|
||||
|
||||
@ -2475,7 +2475,7 @@ ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
|
||||
if (fieldnum <= 0) /* should never happen */
|
||||
elog(ERROR, "unsupported reference to system column %d in FieldSelect",
|
||||
fieldnum);
|
||||
if (fieldnum > tupDesc->natts) /* should never happen */
|
||||
if (fieldnum > tupDesc->natts) /* should never happen */
|
||||
elog(ERROR, "attribute number %d exceeds number of columns %d",
|
||||
fieldnum, tupDesc->natts);
|
||||
attr = tupDesc->attrs[fieldnum - 1];
|
||||
|
@ -387,7 +387,7 @@ ExecInsertIndexTuples(TupleTableSlot *slot,
|
||||
index_insert(indexRelation, /* index relation */
|
||||
values, /* array of index Datums */
|
||||
isnull, /* null flags */
|
||||
tupleid, /* tid of heap tuple */
|
||||
tupleid, /* tid of heap tuple */
|
||||
heapRelation, /* heap relation */
|
||||
checkUnique, /* type of uniqueness check to do */
|
||||
indexInfo); /* index AM may need this */
|
||||
|
@ -2570,7 +2570,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode,
|
||||
break;
|
||||
case LockWaitSkip:
|
||||
if (!ConditionalXactLockTableWait(SnapshotDirty.xmax))
|
||||
return NULL; /* skip instead of waiting */
|
||||
return NULL; /* skip instead of waiting */
|
||||
break;
|
||||
case LockWaitError:
|
||||
if (!ConditionalXactLockTableWait(SnapshotDirty.xmax))
|
||||
|
@ -244,8 +244,8 @@ ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
|
||||
TupleDesc tupdesc) /* new tuple descriptor */
|
||||
ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
|
||||
TupleDesc tupdesc) /* new tuple descriptor */
|
||||
{
|
||||
/* For safety, make sure slot is empty before changing it */
|
||||
ExecClearTuple(slot);
|
||||
|
@ -102,7 +102,7 @@ CreateExecutorState(void)
|
||||
* Initialize all fields of the Executor State structure
|
||||
*/
|
||||
estate->es_direction = ForwardScanDirection;
|
||||
estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
|
||||
estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
|
||||
estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */
|
||||
estate->es_range_table = NIL;
|
||||
estate->es_plannedstmt = NULL;
|
||||
|
@ -93,7 +93,7 @@ typedef struct
|
||||
char *fname; /* function name (for error msgs) */
|
||||
char *src; /* function body text (for error msgs) */
|
||||
|
||||
SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */
|
||||
SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */
|
||||
|
||||
Oid rettype; /* actual return type */
|
||||
int16 typlen; /* length of the return type */
|
||||
@ -245,13 +245,13 @@ prepare_sql_fn_parse_info(HeapTuple procedureTuple,
|
||||
Anum_pg_proc_proargnames,
|
||||
&isNull);
|
||||
if (isNull)
|
||||
proargnames = PointerGetDatum(NULL); /* just to be sure */
|
||||
proargnames = PointerGetDatum(NULL); /* just to be sure */
|
||||
|
||||
proargmodes = SysCacheGetAttr(PROCNAMEARGSNSP, procedureTuple,
|
||||
Anum_pg_proc_proargmodes,
|
||||
&isNull);
|
||||
if (isNull)
|
||||
proargmodes = PointerGetDatum(NULL); /* just to be sure */
|
||||
proargmodes = PointerGetDatum(NULL); /* just to be sure */
|
||||
|
||||
n_arg_names = get_func_input_arg_names(proargnames, proargmodes,
|
||||
&pinfo->argnames);
|
||||
@ -648,7 +648,7 @@ init_sql_fcache(FmgrInfo *finfo, Oid collation, bool lazyEvalOK)
|
||||
if (IsPolymorphicType(rettype))
|
||||
{
|
||||
rettype = get_fn_expr_rettype(finfo);
|
||||
if (rettype == InvalidOid) /* this probably should not happen */
|
||||
if (rettype == InvalidOid) /* this probably should not happen */
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("could not determine actual result type for function declared to return type %s",
|
||||
@ -1544,7 +1544,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
|
||||
AssertArg(!IsPolymorphicType(rettype));
|
||||
|
||||
if (modifyTargetList)
|
||||
*modifyTargetList = false; /* initialize for no change */
|
||||
*modifyTargetList = false; /* initialize for no change */
|
||||
if (junkFilter)
|
||||
*junkFilter = NULL; /* initialize in case of VOID result */
|
||||
|
||||
@ -1770,7 +1770,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
|
||||
InvalidOid,
|
||||
sizeof(int32),
|
||||
(Datum) 0,
|
||||
true, /* isnull */
|
||||
true, /* isnull */
|
||||
true /* byval */ );
|
||||
newtlist = lappend(newtlist,
|
||||
makeTargetEntry(null_expr,
|
||||
|
@ -511,9 +511,9 @@ typedef struct AggStatePerHashData
|
||||
FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
|
||||
int numCols; /* number of hash key columns */
|
||||
int numhashGrpCols; /* number of columns in hash table */
|
||||
int largestGrpColIdx; /* largest col required for hashing */
|
||||
AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */
|
||||
AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */
|
||||
int largestGrpColIdx; /* largest col required for hashing */
|
||||
AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */
|
||||
AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */
|
||||
Agg *aggnode; /* original Agg node, for numGroups etc. */
|
||||
} AggStatePerHashData;
|
||||
|
||||
@ -2373,8 +2373,7 @@ agg_retrieve_direct(AggState *aggstate)
|
||||
firstSlot,
|
||||
InvalidBuffer,
|
||||
true);
|
||||
aggstate->grp_firstTuple = NULL; /* don't keep two
|
||||
* pointers */
|
||||
aggstate->grp_firstTuple = NULL; /* don't keep two pointers */
|
||||
|
||||
/* set up for first advance_aggregates call */
|
||||
tmpcontext->ecxt_outertuple = firstSlot;
|
||||
|
@ -129,7 +129,7 @@ BitmapHeapNext(BitmapHeapScanState *node)
|
||||
node->prefetch_pages = 0;
|
||||
node->prefetch_target = -1;
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -182,7 +182,7 @@ BitmapHeapNext(BitmapHeapScanState *node)
|
||||
node->shared_prefetch_iterator =
|
||||
tbm_attach_shared_iterate(dsa, pstate->prefetch_iterator);
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
node->initialized = true;
|
||||
}
|
||||
@ -265,7 +265,7 @@ BitmapHeapNext(BitmapHeapScanState *node)
|
||||
pstate->prefetch_target++;
|
||||
SpinLockRelease(&pstate->mutex);
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -514,7 +514,7 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
|
||||
tbm_shared_iterate(prefetch_iterator);
|
||||
}
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -558,7 +558,7 @@ BitmapAdjustPrefetchTarget(BitmapHeapScanState *node)
|
||||
pstate->prefetch_target++;
|
||||
SpinLockRelease(&pstate->mutex);
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -634,7 +634,7 @@ BitmapPrefetch(BitmapHeapScanState *node, HeapScanDesc scan)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* USE_PREFETCH */
|
||||
#endif /* USE_PREFETCH */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -73,7 +73,7 @@ MultiExecBitmapIndexScan(BitmapIndexScanState *node)
|
||||
if (node->biss_result)
|
||||
{
|
||||
tbm = node->biss_result;
|
||||
node->biss_result = NULL; /* reset for next time */
|
||||
node->biss_result = NULL; /* reset for next time */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ MultiExecBitmapOr(BitmapOrState *node)
|
||||
elog(ERROR, "unrecognized result from subplan");
|
||||
|
||||
if (result == NULL)
|
||||
result = subresult; /* first subplan */
|
||||
result = subresult; /* first subplan */
|
||||
else
|
||||
{
|
||||
tbm_union(result, subresult);
|
||||
|
@ -258,7 +258,7 @@ gather_getnext(GatherState *gatherstate)
|
||||
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
ExecStoreTuple(tup, /* tuple to store */
|
||||
ExecStoreTuple(tup, /* tuple to store */
|
||||
fslot, /* slot in which to store the tuple */
|
||||
InvalidBuffer, /* buffer associated with this
|
||||
* tuple */
|
||||
|
@ -597,7 +597,7 @@ gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait)
|
||||
ExecStoreTuple(tup, /* tuple to store */
|
||||
gm_state->gm_slots[reader], /* slot in which to store the
|
||||
* tuple */
|
||||
InvalidBuffer, /* buffer associated with this tuple */
|
||||
InvalidBuffer, /* buffer associated with this tuple */
|
||||
true); /* pfree this pointer if not from heap */
|
||||
|
||||
return true;
|
||||
|
@ -1176,7 +1176,7 @@ ExecScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext)
|
||||
/* insert hashtable's tuple into exec slot */
|
||||
inntuple = ExecStoreMinimalTuple(HJTUPLE_MINTUPLE(hashTuple),
|
||||
hjstate->hj_HashTupleSlot,
|
||||
false); /* do not pfree */
|
||||
false); /* do not pfree */
|
||||
econtext->ecxt_innertuple = inntuple;
|
||||
|
||||
/*
|
||||
|
@ -618,7 +618,7 @@ ExecHashJoinOuterGetTuple(PlanState *outerNode,
|
||||
econtext->ecxt_outertuple = slot;
|
||||
if (ExecHashGetHashValue(hashtable, econtext,
|
||||
hjstate->hj_OuterHashKeys,
|
||||
true, /* outer tuple */
|
||||
true, /* outer tuple */
|
||||
HJ_FILL_OUTER(hjstate),
|
||||
hashvalue))
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ IndexNext(IndexScanState *node)
|
||||
*/
|
||||
ExecStoreTuple(tuple, /* tuple to store */
|
||||
slot, /* slot to store in */
|
||||
scandesc->xs_cbuf, /* buffer containing tuple */
|
||||
scandesc->xs_cbuf, /* buffer containing tuple */
|
||||
false); /* don't pfree */
|
||||
|
||||
/*
|
||||
@ -284,7 +284,7 @@ next_indextuple:
|
||||
*/
|
||||
ExecStoreTuple(tuple, /* tuple to store */
|
||||
slot, /* slot to store in */
|
||||
scandesc->xs_cbuf, /* buffer containing tuple */
|
||||
scandesc->xs_cbuf, /* buffer containing tuple */
|
||||
false); /* don't pfree */
|
||||
|
||||
/*
|
||||
@ -1296,7 +1296,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index,
|
||||
flags,
|
||||
varattno, /* attribute number to scan */
|
||||
op_strategy, /* op's strategy */
|
||||
op_righttype, /* strategy subtype */
|
||||
op_righttype, /* strategy subtype */
|
||||
((OpExpr *) clause)->inputcollid, /* collation */
|
||||
opfuncid, /* reg proc to use */
|
||||
scanvalue); /* constant */
|
||||
@ -1421,12 +1421,12 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index,
|
||||
*/
|
||||
ScanKeyEntryInitialize(this_sub_key,
|
||||
flags,
|
||||
varattno, /* attribute number */
|
||||
op_strategy, /* op's strategy */
|
||||
varattno, /* attribute number */
|
||||
op_strategy, /* op's strategy */
|
||||
op_righttype, /* strategy subtype */
|
||||
inputcollation, /* collation */
|
||||
opfuncid, /* reg proc to use */
|
||||
scanvalue); /* constant */
|
||||
opfuncid, /* reg proc to use */
|
||||
scanvalue); /* constant */
|
||||
n_sub_key++;
|
||||
}
|
||||
|
||||
@ -1558,7 +1558,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index,
|
||||
flags,
|
||||
varattno, /* attribute number to scan */
|
||||
op_strategy, /* op's strategy */
|
||||
op_righttype, /* strategy subtype */
|
||||
op_righttype, /* strategy subtype */
|
||||
saop->inputcollid, /* collation */
|
||||
opfuncid, /* reg proc to use */
|
||||
scanvalue); /* constant */
|
||||
@ -1608,7 +1608,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index,
|
||||
ScanKeyEntryInitialize(this_scan_key,
|
||||
flags,
|
||||
varattno, /* attribute number to scan */
|
||||
InvalidStrategy, /* no strategy */
|
||||
InvalidStrategy, /* no strategy */
|
||||
InvalidOid, /* no strategy subtype */
|
||||
InvalidOid, /* no collation */
|
||||
InvalidOid, /* no reg proc for this */
|
||||
|
@ -172,7 +172,7 @@ lnext:
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "unsupported rowmark type");
|
||||
lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
|
||||
lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ MJExamineQuals(List *mergeclauses,
|
||||
&op_strategy,
|
||||
&op_lefttype,
|
||||
&op_righttype);
|
||||
if (op_strategy != BTEqualStrategyNumber) /* should not happen */
|
||||
if (op_strategy != BTEqualStrategyNumber) /* should not happen */
|
||||
elog(ERROR, "cannot merge using non-equality operator %u",
|
||||
qual->opno);
|
||||
|
||||
@ -849,7 +849,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
|
||||
result = MJFillInner(node);
|
||||
if (result)
|
||||
@ -951,7 +951,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
|
||||
result = MJFillOuter(node);
|
||||
if (result)
|
||||
@ -1212,7 +1212,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
|
||||
result = MJFillOuter(node);
|
||||
if (result)
|
||||
@ -1274,7 +1274,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
|
||||
result = MJFillInner(node);
|
||||
if (result)
|
||||
@ -1344,7 +1344,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
node->mj_MatchedInner = true; /* do it only once */
|
||||
|
||||
result = MJFillInner(node);
|
||||
if (result)
|
||||
@ -1390,7 +1390,7 @@ ExecMergeJoin(MergeJoinState *node)
|
||||
*/
|
||||
TupleTableSlot *result;
|
||||
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
node->mj_MatchedOuter = true; /* do it only once */
|
||||
|
||||
result = MJFillOuter(node);
|
||||
if (result)
|
||||
|
@ -1561,8 +1561,7 @@ ExecModifyTable(ModifyTableState *node)
|
||||
elog(ERROR, "ctid is NULL");
|
||||
|
||||
tupleid = (ItemPointer) DatumGetPointer(datum);
|
||||
tuple_ctid = *tupleid; /* be sure we don't free
|
||||
* ctid!! */
|
||||
tuple_ctid = *tupleid; /* be sure we don't free ctid!! */
|
||||
tupleid = &tuple_ctid;
|
||||
}
|
||||
|
||||
@ -1775,7 +1774,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
|
||||
|
||||
root_rti = linitial_int(node->partitioned_rels);
|
||||
root_oid = getrelid(root_rti, estate->es_range_table);
|
||||
rel = heap_open(root_oid, NoLock); /* locked by InitPlan */
|
||||
rel = heap_open(root_oid, NoLock); /* locked by InitPlan */
|
||||
}
|
||||
else
|
||||
rel = mtstate->resultRelInfo->ri_RelationDesc;
|
||||
|
@ -415,7 +415,7 @@ tablesample_getnext(SampleScanState *scanstate)
|
||||
else
|
||||
{
|
||||
/* continue from previously returned page/tuple */
|
||||
blockno = scan->rs_cblock; /* current page */
|
||||
blockno = scan->rs_cblock; /* current page */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -90,8 +90,8 @@ SeqNext(SeqScanState *node)
|
||||
if (tuple)
|
||||
ExecStoreTuple(tuple, /* tuple to store */
|
||||
slot, /* slot to store in */
|
||||
scandesc->rs_cbuf, /* buffer associated with this
|
||||
* tuple */
|
||||
scandesc->rs_cbuf, /* buffer associated with this
|
||||
* tuple */
|
||||
false); /* don't pfree this pointer */
|
||||
else
|
||||
ExecClearTuple(slot);
|
||||
|
@ -263,7 +263,7 @@ setop_retrieve_direct(SetOpState *setopstate)
|
||||
resultTupleSlot,
|
||||
InvalidBuffer,
|
||||
true);
|
||||
setopstate->grp_firstTuple = NULL; /* don't keep two pointers */
|
||||
setopstate->grp_firstTuple = NULL; /* don't keep two pointers */
|
||||
|
||||
/* Initialize working state for a new input tuple group */
|
||||
initialize_counts(pergroup);
|
||||
|
@ -382,10 +382,10 @@ TidNext(TidScanState *node)
|
||||
* pointers onto disk pages and were not created with palloc() and
|
||||
* so should not be pfree()'d.
|
||||
*/
|
||||
ExecStoreTuple(tuple, /* tuple to store */
|
||||
ExecStoreTuple(tuple, /* tuple to store */
|
||||
slot, /* slot to store in */
|
||||
buffer, /* buffer associated with tuple */
|
||||
false); /* don't pfree */
|
||||
buffer, /* buffer associated with tuple */
|
||||
false); /* don't pfree */
|
||||
|
||||
/*
|
||||
* At this point we have an extra pin on the buffer, because
|
||||
@ -551,7 +551,7 @@ ExecInitTidScan(TidScan *node, EState *estate, int eflags)
|
||||
currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
|
||||
|
||||
tidstate->ss.ss_currentRelation = currentRelation;
|
||||
tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
|
||||
tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
|
||||
|
||||
/*
|
||||
* get the scan type from the relation descriptor.
|
||||
|
@ -1895,7 +1895,7 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
|
||||
AclResult aclresult;
|
||||
int i;
|
||||
|
||||
if (wfunc->winref != node->winref) /* planner screwed up? */
|
||||
if (wfunc->winref != node->winref) /* planner screwed up? */
|
||||
elog(ERROR, "WindowFunc with winref %u assigned to WindowAgg with winref %u",
|
||||
wfunc->winref, node->winref);
|
||||
|
||||
@ -2209,7 +2209,7 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc,
|
||||
/* build expression trees using actual argument & result types */
|
||||
build_aggregate_transfn_expr(inputTypes,
|
||||
numArguments,
|
||||
0, /* no ordered-set window functions yet */
|
||||
0, /* no ordered-set window functions yet */
|
||||
false, /* no variadic window functions yet */
|
||||
aggtranstype,
|
||||
wfunc->inputcollid,
|
||||
|
@ -43,7 +43,7 @@ int SPI_result;
|
||||
|
||||
static _SPI_connection *_SPI_stack = NULL;
|
||||
static _SPI_connection *_SPI_current = NULL;
|
||||
static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */
|
||||
static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */
|
||||
static int _SPI_connected = -1; /* current stack index */
|
||||
|
||||
static Portal SPI_cursor_open_internal(const char *name, SPIPlanPtr plan,
|
||||
@ -119,7 +119,7 @@ SPI_connect(void)
|
||||
_SPI_current->lastoid = InvalidOid;
|
||||
_SPI_current->tuptable = NULL;
|
||||
slist_init(&_SPI_current->tuptables);
|
||||
_SPI_current->procCxt = NULL; /* in case we fail to create 'em */
|
||||
_SPI_current->procCxt = NULL; /* in case we fail to create 'em */
|
||||
_SPI_current->execCxt = NULL;
|
||||
_SPI_current->connectSubid = GetCurrentSubTransactionId();
|
||||
_SPI_current->queryEnv = NULL;
|
||||
@ -149,7 +149,7 @@ SPI_finish(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = _SPI_begin_call(false); /* live in procedure memory */
|
||||
res = _SPI_begin_call(false); /* live in procedure memory */
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
@ -594,7 +594,7 @@ SPI_saveplan(SPIPlanPtr plan)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPI_result = _SPI_begin_call(false); /* don't change context */
|
||||
SPI_result = _SPI_begin_call(false); /* don't change context */
|
||||
if (SPI_result < 0)
|
||||
return NULL;
|
||||
|
||||
@ -1813,7 +1813,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan)
|
||||
plan->parserSetup,
|
||||
plan->parserSetupArg,
|
||||
plan->cursor_options,
|
||||
false); /* not fixed result */
|
||||
false); /* not fixed result */
|
||||
|
||||
plancache_list = lappend(plancache_list, plansource);
|
||||
}
|
||||
@ -2668,7 +2668,7 @@ SPI_register_relation(EphemeralNamedRelation enr)
|
||||
if (enr == NULL || enr->md.name == NULL)
|
||||
return SPI_ERROR_ARGUMENT;
|
||||
|
||||
res = _SPI_begin_call(false); /* keep current memory context */
|
||||
res = _SPI_begin_call(false); /* keep current memory context */
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
@ -2702,7 +2702,7 @@ SPI_unregister_relation(const char *name)
|
||||
if (name == NULL)
|
||||
return SPI_ERROR_ARGUMENT;
|
||||
|
||||
res = _SPI_begin_call(false); /* keep current memory context */
|
||||
res = _SPI_begin_call(false); /* keep current memory context */
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
@ -95,7 +95,7 @@ typedef struct ArrayRemapInfo
|
||||
int16 typlen; /* array element type's storage properties */
|
||||
bool typbyval;
|
||||
char typalign;
|
||||
TupleRemapInfo *element_remap; /* array element type's remap info */
|
||||
TupleRemapInfo *element_remap; /* array element type's remap info */
|
||||
} ArrayRemapInfo;
|
||||
|
||||
typedef struct RangeRemapInfo
|
||||
@ -113,7 +113,7 @@ typedef struct RecordRemapInfo
|
||||
int32 localtypmod;
|
||||
/* If no fields of the record require remapping, these are NULL: */
|
||||
TupleDesc tupledesc; /* copy of record's tupdesc */
|
||||
TupleRemapInfo **field_remap; /* each field's remap info */
|
||||
TupleRemapInfo **field_remap; /* each field's remap info */
|
||||
} RecordRemapInfo;
|
||||
|
||||
struct TupleRemapInfo
|
||||
|
Reference in New Issue
Block a user