aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-14 11:10:05 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-14 11:10:05 -0400
commit8e72239e9d961c27f02b242e33fa832c364c7a4b (patch)
tree5060415d99b58597c4b1282b3f9226d9be83aec8 /src/backend
parenta571c7f661a7b601aafcb12196d004cdb8b8cb23 (diff)
downloadpostgresql-8e72239e9d961c27f02b242e33fa832c364c7a4b.tar.gz
postgresql-8e72239e9d961c27f02b242e33fa832c364c7a4b.zip
Fix no-longer-valid shortcuts in expression_returns_set().
expression_returns_set() used to short-circuit its recursion upon seeing certain node types, such as DistinctExpr, that it knew the executor did not support set-valued arguments for. That was never inherent, though, just a reflection of laziness in execQual.c. With the new implementation of SRFs there is no reason to think that any scalar-valued expression node could not have a set-valued subexpression, except for AggRefs and WindowFuncs where we know there is a parser check rejecting it. And indeed, the shortcut causes unexpected failures for cases such as a SRF underneath DistinctExpr, because the planner stops looking for SRFs too soon. Discussion: https://postgr.es/m/5259.1497044025@sss.pgh.pa.us
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/nodes/nodeFuncs.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index 41f3408cfcf..5af37a93885 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -694,39 +694,11 @@ expression_returns_set_walker(Node *node, void *context)
/* else fall through to check args */
}
- /* Avoid recursion for some cases that can't return a set */
+ /* Avoid recursion for some cases that parser checks not to return a set */
if (IsA(node, Aggref))
return false;
if (IsA(node, WindowFunc))
return false;
- if (IsA(node, DistinctExpr))
- return false;
- if (IsA(node, NullIfExpr))
- return false;
- if (IsA(node, ScalarArrayOpExpr))
- return false;
- if (IsA(node, BoolExpr))
- return false;
- if (IsA(node, SubLink))
- return false;
- if (IsA(node, SubPlan))
- return false;
- if (IsA(node, AlternativeSubPlan))
- return false;
- if (IsA(node, ArrayExpr))
- return false;
- if (IsA(node, RowExpr))
- return false;
- if (IsA(node, RowCompareExpr))
- return false;
- if (IsA(node, CoalesceExpr))
- return false;
- if (IsA(node, MinMaxExpr))
- return false;
- if (IsA(node, SQLValueFunction))
- return false;
- if (IsA(node, XmlExpr))
- return false;
return expression_tree_walker(node, expression_returns_set_walker,
context);