MCPcopy Create free account
hub / github.com/apache/cloudberry / makeDependencyGraph

Function makeDependencyGraph

src/backend/parser/parse_cte.c:647–663  ·  view source on GitHub ↗

* Identify the cross-references of a list of WITH RECURSIVE items, * and sort into an order that has no forward references. */

Source from the content-addressed store, hash-verified

645 * and sort into an order that has no forward references.
646 */
647static void
648makeDependencyGraph(CteState *cstate)
649{
650 int i;
651
652 for (i = 0; i < cstate->numitems; i++)
653 {
654 CommonTableExpr *cte = cstate->items[i].cte;
655
656 cstate->curitem = i;
657 cstate->innerwiths = NIL;
658 makeDependencyGraphWalker((Node *) cte->ctequery, cstate);
659 Assert(cstate->innerwiths == NIL);
660 }
661
662 TopologicalSort(cstate->pstate, cstate->items, cstate->numitems);
663}
664
665/*
666 * Tree walker function to detect cross-references and self-references of the

Callers 1

transformWithClauseFunction · 0.85

Calls 2

TopologicalSortFunction · 0.85

Tested by

no test coverage detected