diff options
| author | Andres Freund | 2018-09-25 23:27:48 +0000 |
|---|---|---|
| committer | Andres Freund | 2018-09-25 23:27:48 +0000 |
| commit | 29c94e03c7d05d2b29afa1de32795ce178531246 (patch) | |
| tree | 9599ede8229db1171da69f40fe9842e7af84cd6e /src/backend/commands | |
| parent | bbdfbb9154fccf5b58ecbbdf4e8989e2fed206f8 (diff) | |
Split ExecStoreTuple into ExecStoreHeapTuple and ExecStoreBufferHeapTuple.
Upcoming changes introduce further types of tuple table slots, in
preparation of making table storage pluggable. New storage methods
will have different representation of tuples, therefore the slot
accessor should refer explicitly to heap tuples.
Instead of just renaming the functions, split it into one function
that accepts heap tuples not residing in buffers, and one accepting
ones in buffers. Previously one function was used for both, but that
was a bit awkward already, and splitting will allow us to represent
slot types for tuples in buffers and normal memory separately.
This is split out from the patch introducing abstract slots, as this
largely consists out of mechanical changes.
Author: Ashutosh Bapat
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/20180220224318.gw4oe5jadhpmcdnm@alap3.anarazel.de
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/analyze.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/constraint.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/copy.c | 4 | ||||
| -rw-r--r-- | src/backend/commands/functioncmds.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/tablecmds.c | 6 | ||||
| -rw-r--r-- | src/backend/commands/trigger.c | 12 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 2503ac65102..d11b559b20a 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -799,7 +799,7 @@ compute_index_stats(Relation onerel, double totalrows, ResetExprContext(econtext); /* Set up for predicate or expression evaluation */ - ExecStoreTuple(heapTuple, slot, InvalidBuffer, false); + ExecStoreHeapTuple(heapTuple, slot, false); /* If index is partial, check predicate */ if (predicate != NULL) diff --git a/src/backend/commands/constraint.c b/src/backend/commands/constraint.c index 90f19ad3dd9..f472355b48f 100644 --- a/src/backend/commands/constraint.c +++ b/src/backend/commands/constraint.c @@ -124,7 +124,7 @@ unique_key_recheck(PG_FUNCTION_ARGS) */ slot = MakeSingleTupleTableSlot(RelationGetDescr(trigdata->tg_relation)); - ExecStoreTuple(new_row, slot, InvalidBuffer, false); + ExecStoreHeapTuple(new_row, slot, false); /* * Typically the index won't have expressions, but if it does we need an diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 9bc67ce60fe..d06662bd32e 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -2684,7 +2684,7 @@ CopyFrom(CopyState cstate) /* Place tuple in tuple slot --- but slot shouldn't free it */ slot = myslot; - ExecStoreTuple(tuple, slot, InvalidBuffer, false); + ExecStoreHeapTuple(tuple, slot, false); /* Determine the partition to heap_insert the tuple into */ if (proute) @@ -3119,7 +3119,7 @@ CopyFromInsertBatch(CopyState cstate, EState *estate, CommandId mycid, List *recheckIndexes; cstate->cur_lineno = firstBufferedLineNo + i; - ExecStoreTuple(bufferedTuples[i], myslot, InvalidBuffer, false); + ExecStoreHeapTuple(bufferedTuples[i], myslot, false); recheckIndexes = ExecInsertIndexTuples(myslot, &(bufferedTuples[i]->t_self), estate, false, NULL, NIL); diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 68109bfda06..6f629a00e8a 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -2337,7 +2337,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver rettupdata.t_tableOid = InvalidOid; rettupdata.t_data = td; - slot = ExecStoreTuple(&rettupdata, tstate->slot, InvalidBuffer, false); + slot = ExecStoreHeapTuple(&rettupdata, tstate->slot, false); tstate->dest->receiveSlot(slot, tstate->dest); end_tup_output(tstate); diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 03c0b739b36..1205dbc0b5e 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -4776,7 +4776,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode) * Process supplied expressions to replace selected columns. * Expression inputs come from the old tuple. */ - ExecStoreTuple(tuple, oldslot, InvalidBuffer, false); + ExecStoreHeapTuple(tuple, oldslot, false); econtext->ecxt_scantuple = oldslot; foreach(l, tab->newvals) @@ -4806,7 +4806,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode) } /* Now check any constraints on the possibly-changed tuple */ - ExecStoreTuple(tuple, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(tuple, newslot, false); econtext->ecxt_scantuple = newslot; foreach(l, notnull_attrs) @@ -8526,7 +8526,7 @@ validateCheckConstraint(Relation rel, HeapTuple constrtup) while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL) { - ExecStoreTuple(tuple, slot, InvalidBuffer, false); + ExecStoreHeapTuple(tuple, slot, false); if (!ExecCheck(exprstate, econtext)) ereport(ERROR, diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 0665f110ba3..36778b6f4d5 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -2571,7 +2571,7 @@ ExecBRInsertTriggers(EState *estate, ResultRelInfo *relinfo, if (newslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(newslot, tupdesc); - ExecStoreTuple(newtuple, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(newtuple, newslot, false); slot = newslot; } return slot; @@ -2652,7 +2652,7 @@ ExecIRInsertTriggers(EState *estate, ResultRelInfo *relinfo, if (newslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(newslot, tupdesc); - ExecStoreTuple(newtuple, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(newtuple, newslot, false); slot = newslot; } return slot; @@ -3078,7 +3078,7 @@ ExecBRUpdateTriggers(EState *estate, EPQState *epqstate, if (newslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(newslot, tupdesc); - ExecStoreTuple(newtuple, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(newtuple, newslot, false); slot = newslot; } return slot; @@ -3186,7 +3186,7 @@ ExecIRUpdateTriggers(EState *estate, ResultRelInfo *relinfo, if (newslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(newslot, tupdesc); - ExecStoreTuple(newtuple, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(newtuple, newslot, false); slot = newslot; } return slot; @@ -3514,7 +3514,7 @@ TriggerEnabled(EState *estate, ResultRelInfo *relinfo, oldslot = estate->es_trig_oldtup_slot; if (oldslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(oldslot, tupdesc); - ExecStoreTuple(oldtup, oldslot, InvalidBuffer, false); + ExecStoreHeapTuple(oldtup, oldslot, false); } if (HeapTupleIsValid(newtup)) { @@ -3528,7 +3528,7 @@ TriggerEnabled(EState *estate, ResultRelInfo *relinfo, newslot = estate->es_trig_newtup_slot; if (newslot->tts_tupleDescriptor != tupdesc) ExecSetSlotDescriptor(newslot, tupdesc); - ExecStoreTuple(newtup, newslot, InvalidBuffer, false); + ExecStoreHeapTuple(newtup, newslot, false); } /* |
