* 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. */
| 621 | * Note that the projection also ensures we have a slot of the right type. |
| 622 | */ |
| 623 | TupleTableSlot * |
| 624 | ExecGetUpdateNewTuple(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 | /* ---------------------------------------------------------------- |
no test coverage detected