summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/optimizer/path/joinpath.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index 7a2c20b1450..0367e1aacdb 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -1382,6 +1382,10 @@ sort_inner_and_outer(PlannerInfo *root,
List *all_pathkeys;
ListCell *l;
+ /* Nothing to do if there are no available mergejoin clauses */
+ if (extra->mergeclause_list == NIL)
+ return;
+
/*
* We only consider the cheapest-total-cost input paths, since we are
* assuming here that a sort is required. We will consider