* ExecProcessReturning --- evaluate a RETURNING list * * resultRelInfo: current result rel * tupleSlot: slot holding tuple actually inserted/updated/deleted * planSlot: slot holding tuple returned by top subplan node * * Note: If tupleSlot is NULL, the FDW should have already provided econtext's * scan tuple. * * Returns a slot holding the result tuple */
| 235 | * Returns a slot holding the result tuple |
| 236 | */ |
| 237 | static TupleTableSlot * |
| 238 | ExecProcessReturning(ResultRelInfo *resultRelInfo, |
| 239 | TupleTableSlot *tupleSlot, |
| 240 | TupleTableSlot *planSlot) |
| 241 | { |
| 242 | ProjectionInfo *projectReturning = resultRelInfo->ri_projectReturning; |
| 243 | ExprContext *econtext = projectReturning->pi_exprContext; |
| 244 | |
| 245 | /* Make tuple and any needed join variables available to ExecProject */ |
| 246 | if (tupleSlot) |
| 247 | econtext->ecxt_scantuple = tupleSlot; |
| 248 | econtext->ecxt_outertuple = planSlot; |
| 249 | |
| 250 | /* |
| 251 | * RETURNING expressions might reference the tableoid column, so |
| 252 | * reinitialize tts_tableOid before evaluating them. |
| 253 | */ |
| 254 | econtext->ecxt_scantuple->tts_tableOid = |
| 255 | RelationGetRelid(resultRelInfo->ri_RelationDesc); |
| 256 | |
| 257 | /* Compute the RETURNING expressions */ |
| 258 | return ExecProject(projectReturning); |
| 259 | } |
| 260 | |
| 261 | /* |
| 262 | * ExecCheckTupleVisible -- verify tuple is visible |
no test coverage detected