summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/clauses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r--src/backend/optimizer/util/clauses.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 02866f363d6..17844a3a480 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -1505,7 +1505,6 @@ contain_leaked_vars_walker(Node *node, void *context)
case T_Var:
case T_Const:
case T_Param:
- case T_ArrayRef:
case T_ArrayExpr:
case T_FieldSelect:
case T_FieldStore:
@@ -1544,6 +1543,23 @@ contain_leaked_vars_walker(Node *node, void *context)
return true;
break;
+ case T_ArrayRef:
+ {
+ ArrayRef *aref = (ArrayRef *) node;
+
+ /*
+ * array assignment is leaky, but subscripted fetches
+ * are not
+ */
+ if (aref->refassgnexpr != NULL)
+ {
+ /* Node is leaky, so reject if it contains Vars */
+ if (contain_var_clause(node))
+ return true;
+ }
+ }
+ break;
+
case T_RowCompareExpr:
{
/*