Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d968d2

Browse files
committed
Make compat version of exec_append_common
1 parent3fb2583 commit6d968d2

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

‎src/nodes_common.c‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -659,39 +659,54 @@ exec_append_common(CustomScanState *node,
659659
void (*fetch_next_tuple) (CustomScanState*node))
660660
{
661661
RuntimeAppendState*scan_state= (RuntimeAppendState*)node;
662+
TupleTableSlot*result;
662663

663664
/* ReScan if no plans are selected */
664665
if (scan_state->ncur_plans==0)
665666
ExecReScan(&node->ss.ps);
666667

668+
#ifPG_VERSION_NUM >=100000
669+
fetch_next_tuple(node);/* use specific callback */
670+
671+
if (TupIsNull(scan_state->slot))
672+
returnNULL;
673+
674+
if (!node->ss.ps.ps_ProjInfo)
675+
returnscan_state->slot;
676+
677+
/*
678+
* Assuming that current projection doesn't involve SRF
679+
*
680+
* Any SFR functions are evaluated in the specialized parent node ProjectSet
681+
*/
682+
ResetExprContext(node->ss.ps.ps_ExprContext);
683+
node->ss.ps.ps_ProjInfo->pi_exprContext->ecxt_scantuple=
684+
scan_state->slot;
685+
result=ExecProject(node->ss.ps.ps_ProjInfo);
686+
687+
returnresult;
688+
#elifPG_VERSION_NUM >=90500
667689
for (;;)
668690
{
669691
/* Fetch next tuple if we're done with Projections */
670-
#ifPG_VERSION_NUM<100000
671692
if (!node->ss.ps.ps_TupFromTlist)
672693
{
673694
fetch_next_tuple(node);/* use specific callback */
674695

675696
if (TupIsNull(scan_state->slot))
676697
returnNULL;
677698
}
678-
#endif
679699

680700
if (node->ss.ps.ps_ProjInfo)
681701
{
682702
ExprDoneCondisDone;
683-
TupleTableSlot*result;
684703

685704
ResetExprContext(node->ss.ps.ps_ExprContext);
686705

687-
node->ss.ps.ps_ProjInfo->pi_exprContext->ecxt_scantuple=scan_state->slot;
688-
#ifPG_VERSION_NUM >=100000
689-
result=ExecProject(node->ss.ps.ps_ProjInfo);
690-
#else
706+
node->ss.ps.ps_ProjInfo->pi_exprContext->ecxt_scantuple=
707+
scan_state->slot;
691708
result=ExecProject(node->ss.ps.ps_ProjInfo,&isDone);
692-
#endif
693709

694-
#ifPG_VERSION_NUM<100000
695710
if (isDone!=ExprEndResult)
696711
{
697712
node->ss.ps.ps_TupFromTlist= (isDone==ExprMultipleResult);
@@ -700,14 +715,11 @@ exec_append_common(CustomScanState *node,
700715
}
701716
else
702717
node->ss.ps.ps_TupFromTlist= false;
703-
#else
704-
if (isDone!=ExprEndResult)
705-
returnresult;
706-
#endif
707718
}
708719
else
709720
returnscan_state->slot;
710721
}
722+
#endif
711723
}
712724

713725
void

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp