* create_resultscan_path * Creates a path corresponding to a scan of an RTE_RESULT relation, * returning the pathnode. */
| 3488 | * returning the pathnode. |
| 3489 | */ |
| 3490 | Path * |
| 3491 | create_resultscan_path(PlannerInfo *root, RelOptInfo *rel, |
| 3492 | Relids required_outer) |
| 3493 | { |
| 3494 | Path *pathnode = makeNode(Path); |
| 3495 | |
| 3496 | pathnode->pathtype = T_Result; |
| 3497 | pathnode->parent = rel; |
| 3498 | pathnode->pathtarget = rel->reltarget; |
| 3499 | pathnode->param_info = get_baserel_parampathinfo(root, rel, |
| 3500 | required_outer); |
| 3501 | pathnode->parallel_aware = false; |
| 3502 | pathnode->parallel_safe = rel->consider_parallel; |
| 3503 | pathnode->parallel_workers = 0; |
| 3504 | pathnode->pathkeys = NIL; /* result is always unordered */ |
| 3505 | pathnode->rescannable = true; |
| 3506 | |
| 3507 | { |
| 3508 | char exec_location; |
| 3509 | exec_location = check_execute_on_functions((Node *) rel->reltarget->exprs); |
| 3510 | |
| 3511 | /* |
| 3512 | * A function with EXECUTE ON { COORDINATOR | ALL SEGMENTS } attribute |
| 3513 | * must be a set-returning function, a subquery has set-returning |
| 3514 | * functions in tlist can't be pulled up as RTE_RESULT relation. |
| 3515 | */ |
| 3516 | Assert(exec_location == PROEXECLOCATION_ANY); |
| 3517 | CdbPathLocus_MakeGeneral(&pathnode->locus); |
| 3518 | } |
| 3519 | |
| 3520 | cost_resultscan(pathnode, root, rel, pathnode->param_info); |
| 3521 | |
| 3522 | return pathnode; |
| 3523 | } |
| 3524 | |
| 3525 | /* |
| 3526 | * create_worktablescan_path |
no test coverage detected