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

Function ExecGetUpdateNewTuple

src/backend/executor/nodeModifyTable.c:623–640  ·  view source on GitHub ↗

* ExecGetUpdateNewTuple * This prepares a "new" tuple by combining an UPDATE subplan's output * tuple (which contains values of changed columns) with unchanged * columns taken from the old tuple. * * The subplan tuple might also contain junk columns, which are ignored. * Note that the projection also ensures we have a slot of the right type. */

Source from the content-addressed store, hash-verified

621 * Note that the projection also ensures we have a slot of the right type.
622 */
623TupleTableSlot *
624ExecGetUpdateNewTuple(ResultRelInfo *relinfo,
625 TupleTableSlot *planSlot,
626 TupleTableSlot *oldSlot)
627{
628 ProjectionInfo *newProj = relinfo->ri_projectNew;
629 ExprContext *econtext;
630
631 /* Use a few extra Asserts to protect against outside callers */
632 Assert(relinfo->ri_projectNewInfoValid);
633 Assert(planSlot != NULL && !TTS_EMPTY(planSlot));
634 Assert(oldSlot != NULL && !TTS_EMPTY(oldSlot));
635
636 econtext = newProj->pi_exprContext;
637 econtext->ecxt_outertuple = planSlot;
638 econtext->ecxt_scantuple = oldSlot;
639 return ExecProject(newProj);
640}
641
642
643/* ----------------------------------------------------------------

Callers 4

ExecBRUpdateTriggersFunction · 0.85
ExecCrossPartitionUpdateFunction · 0.85
ExecUpdateFunction · 0.85
ExecModifyTableFunction · 0.85

Calls 1

ExecProjectFunction · 0.85

Tested by

no test coverage detected