* Return, and create if necessary, a slot for an EPQ test tuple. * * Note this only requires EvalPlanQualInit() to have been called, * EvalPlanQualBegin() is not necessary. */
| 3729 | * EvalPlanQualBegin() is not necessary. |
| 3730 | */ |
| 3731 | TupleTableSlot * |
| 3732 | EvalPlanQualSlot(EPQState *epqstate, |
| 3733 | Relation relation, Index rti) |
| 3734 | { |
| 3735 | TupleTableSlot **slot; |
| 3736 | |
| 3737 | Assert(relation); |
| 3738 | Assert(rti > 0 && rti <= epqstate->parentestate->es_range_table_size); |
| 3739 | slot = &epqstate->relsubs_slot[rti - 1]; |
| 3740 | |
| 3741 | if (*slot == NULL) |
| 3742 | { |
| 3743 | MemoryContext oldcontext; |
| 3744 | |
| 3745 | oldcontext = MemoryContextSwitchTo(epqstate->parentestate->es_query_cxt); |
| 3746 | *slot = table_slot_create(relation, &epqstate->tuple_table); |
| 3747 | MemoryContextSwitchTo(oldcontext); |
| 3748 | } |
| 3749 | |
| 3750 | return *slot; |
| 3751 | } |
| 3752 | |
| 3753 | /* |
| 3754 | * Fetch the current row value for a non-locked relation, identified by rti, |
no test coverage detected