Skip to content

Commit 0fd849f

Browse files
committed
resolve merge conflicts
2 parents 6ca6feb + bbb1178 commit 0fd849f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/hooks.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
#include "utils/lsyscache.h"
3434

3535

36+
/* Borrowed from joinpath.c */
37+
#define PATH_PARAM_BY_REL(path, rel) \
38+
((path)->param_info && bms_overlap(PATH_REQ_OUTER(path), (rel)->relids))
39+
40+
3641
set_join_pathlist_hook_type set_join_pathlist_next = NULL;
3742
set_rel_pathlist_hook_type set_rel_pathlist_hook_next = NULL;
3843
planner_hook_type planner_hook_next = NULL;
@@ -130,7 +135,11 @@ pathman_join_pathlist_hook(PlannerInfo *root,
130135
/* Select cheapest path for outerrel */
131136
outer = outerrel->cheapest_total_path;
132137

133-
/* Wrap outer path with Unique if needed */
138+
/* We cannot use an outer path that is parameterized by the inner rel */
139+
if (PATH_PARAM_BY_REL(outer, innerrel))
140+
continue;
141+
142+
/* Wrap 'outer' in unique path if needed */
134143
if (saved_jointype == JOIN_UNIQUE_OUTER)
135144
{
136145
outer = (Path *) create_unique_path(root, outerrel,

0 commit comments

Comments
 (0)