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

Function ExecSetupTransitionCaptureState

src/backend/executor/nodeModifyTable.c:2541–2558  ·  view source on GitHub ↗

* Set up the state needed for collecting transition tuples for AFTER * triggers. */

Source from the content-addressed store, hash-verified

2539 * triggers.
2540 */
2541static void
2542ExecSetupTransitionCaptureState(ModifyTableState *mtstate, EState *estate)
2543{
2544 ModifyTable *plan = (ModifyTable *) mtstate->ps.plan;
2545 ResultRelInfo *targetRelInfo = mtstate->rootResultRelInfo;
2546
2547 /* Check for transition tables on the directly targeted relation. */
2548 mtstate->mt_transition_capture =
2549 MakeTransitionCaptureState(targetRelInfo->ri_TrigDesc,
2550 RelationGetRelid(targetRelInfo->ri_RelationDesc),
2551 mtstate->operation);
2552 if (plan->operation == CMD_INSERT &&
2553 plan->onConflictAction == ONCONFLICT_UPDATE)
2554 mtstate->mt_oc_transition_capture =
2555 MakeTransitionCaptureState(targetRelInfo->ri_TrigDesc,
2556 RelationGetRelid(targetRelInfo->ri_RelationDesc),
2557 CMD_UPDATE);
2558}
2559
2560/*
2561 * ExecPrepareTupleRouting --- prepare for routing one tuple

Callers 1

ExecInitModifyTableFunction · 0.85

Calls 1

Tested by

no test coverage detected