| 399 | */ |
| 400 | #ifndef FRONTEND |
| 401 | static inline TupleTableSlot * |
| 402 | ExecProject(ProjectionInfo *projInfo) |
| 403 | { |
| 404 | ExprContext *econtext = projInfo->pi_exprContext; |
| 405 | ExprState *state = &projInfo->pi_state; |
| 406 | TupleTableSlot *slot = state->resultslot; |
| 407 | bool isnull; |
| 408 | |
| 409 | /* |
| 410 | * Clear any former contents of the result slot. This makes it safe for |
| 411 | * us to use the slot's Datum/isnull arrays as workspace. |
| 412 | */ |
| 413 | ExecClearTuple(slot); |
| 414 | |
| 415 | /* Run the expression, discarding scalar result from the last column. */ |
| 416 | (void) ExecEvalExprSwitchContext(state, econtext, &isnull); |
| 417 | |
| 418 | /* |
| 419 | * Successfully formed a result row. Mark the result slot as containing a |
| 420 | * valid virtual tuple (inlined version of ExecStoreVirtualTuple()). |
| 421 | */ |
| 422 | slot->tts_flags &= ~TTS_FLAG_EMPTY; |
| 423 | slot->tts_nvalid = slot->tts_tupleDescriptor->natts; |
| 424 | |
| 425 | return slot; |
| 426 | } |
| 427 | #endif |
| 428 | |
| 429 | /* |
no test coverage detected