aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/joinpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/path/joinpath.c')
-rw-r--r--src/backend/optimizer/path/joinpath.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index c09f0e1df3e..37b74d43733 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -611,6 +611,23 @@ get_memoize_path(PlannerInfo *root, RelOptInfo *innerrel,
}
/*
+ * Also check the parameterized path restrictinfos for volatile functions.
+ * Indexed functions must be immutable so shouldn't have any volatile
+ * functions, however, with a lateral join the inner scan may not be an
+ * index scan.
+ */
+ if (inner_path->param_info != NULL)
+ {
+ foreach(lc, inner_path->param_info->ppi_clauses)
+ {
+ RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc);
+
+ if (contain_volatile_functions((Node *) rinfo))
+ return NULL;
+ }
+ }
+
+ /*
* When considering a partitionwise join, we have clauses that reference
* the outerrel's top parent not outerrel itself.
*/