* Generate a fake join tuple with nulls for the outer tuple, * and return it if it passes the non-join quals. */
| 515 | * and return it if it passes the non-join quals. |
| 516 | */ |
| 517 | static TupleTableSlot * |
| 518 | MJFillInner(MergeJoinState *node) |
| 519 | { |
| 520 | ExprContext *econtext = node->js.ps.ps_ExprContext; |
| 521 | ExprState *otherqual = node->js.ps.qual; |
| 522 | |
| 523 | ResetExprContext(econtext); |
| 524 | |
| 525 | /* If we don't have an inner, return NULL */ |
| 526 | if(TupIsNull(node->mj_InnerTupleSlot)) |
| 527 | return NULL; |
| 528 | |
| 529 | econtext->ecxt_outertuple = node->mj_NullOuterTupleSlot; |
| 530 | econtext->ecxt_innertuple = node->mj_InnerTupleSlot; |
| 531 | |
| 532 | if (ExecQual(otherqual, econtext)) |
| 533 | { |
| 534 | /* |
| 535 | * qualification succeeded. now form the desired projection tuple and |
| 536 | * return the slot containing it. |
| 537 | */ |
| 538 | MJ_printf("ExecMergeJoin: returning inner fill tuple\n"); |
| 539 | |
| 540 | return ExecProject(node->js.ps.ps_ProjInfo); |
| 541 | } |
| 542 | else |
| 543 | InstrCountFiltered2(node, 1); |
| 544 | |
| 545 | return NULL; |
| 546 | } |
| 547 | |
| 548 | |
| 549 | /* |
no test coverage detected