fix wrong answer in connectby nocycle & siblings case

This commit is contained in:
Zongtian Hou
2023-02-01 16:35:32 +08:00
committed by ZongtianHou
parent 3d3de895c6
commit d3a9de055f
11 changed files with 873 additions and 997 deletions

View File

@ -406,27 +406,6 @@ static TupleTableSlot* ExecRecursiveUnion(PlanState* state)
/* Not satisfy connect_by_level_qual,skip this tuple */
continue;
}
/*
* In ORDER SIBLINGS case, as we add SORT-Operator(material) on top of
* RecursiveUnion, so we have to do nocycle check here
*/
if (swplan->swoptions->siblings_orderby_clause) {
StartWithOpState *swstate = (StartWithOpState *)node->swstate;
if (swstate->sw_nocycleStopOrderSiblings) {
return (TupleTableSlot*)NULL;
}
if (CheckCycleExeception(swstate, slot)) {
/*
* Mark execution stop for order siblings, note we let the cycle-causing
* tuple return to upper node and stop next one
*/
swstate->sw_nocycleStopOrderSiblings = true;
elog(DEBUG1, "nocycle option take effect on RecursiveUnion for Order Siblings! %s",
swstate->sw_curKeyArrayStr);
}
}
}
tuplestore_puttupleslot(node->intermediate_table, slot);