MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecProcessReturning

Function ExecProcessReturning

src/backend/executor/nodeModifyTable.c:237–259  ·  view source on GitHub ↗

* ExecProcessReturning --- evaluate a RETURNING list * * resultRelInfo: current result rel * tupleSlot: slot holding tuple actually inserted/updated/deleted * planSlot: slot holding tuple returned by top subplan node * * Note: If tupleSlot is NULL, the FDW should have already provided econtext's * scan tuple. * * Returns a slot holding the result tuple */

Source from the content-addressed store, hash-verified

235 * Returns a slot holding the result tuple
236 */
237static TupleTableSlot *
238ExecProcessReturning(ResultRelInfo *resultRelInfo,
239 TupleTableSlot *tupleSlot,
240 TupleTableSlot *planSlot)
241{
242 ProjectionInfo *projectReturning = resultRelInfo->ri_projectReturning;
243 ExprContext *econtext = projectReturning->pi_exprContext;
244
245 /* Make tuple and any needed join variables available to ExecProject */
246 if (tupleSlot)
247 econtext->ecxt_scantuple = tupleSlot;
248 econtext->ecxt_outertuple = planSlot;
249
250 /*
251 * RETURNING expressions might reference the tableoid column, so
252 * reinitialize tts_tableOid before evaluating them.
253 */
254 econtext->ecxt_scantuple->tts_tableOid =
255 RelationGetRelid(resultRelInfo->ri_RelationDesc);
256
257 /* Compute the RETURNING expressions */
258 return ExecProject(projectReturning);
259}
260
261/*
262 * ExecCheckTupleVisible -- verify tuple is visible

Callers 4

ExecInsertFunction · 0.85
ExecDeleteFunction · 0.85
ExecUpdateFunction · 0.85
ExecModifyTableFunction · 0.85

Calls 1

ExecProjectFunction · 0.85

Tested by

no test coverage detected