* Identify the cross-references of a list of WITH RECURSIVE items, * and sort into an order that has no forward references. */
| 645 | * and sort into an order that has no forward references. |
| 646 | */ |
| 647 | static void |
| 648 | makeDependencyGraph(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 |
no test coverage detected