aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-07-20 13:09:00 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-07-20 13:10:58 -0400
commit8e617e29aaccfdd1b85af7f50dc83aa6dd7ef550 (patch)
treecae7a269c2f0e1d0489b02af1301ea8c4a95fb3f /src/backend/executor/execUtils.c
parent3a0e4d36ebd7f477822d5bae41ba121a40d22ccc (diff)
downloadpostgresql-8e617e29aaccfdd1b85af7f50dc83aa6dd7ef550.tar.gz
postgresql-8e617e29aaccfdd1b85af7f50dc83aa6dd7ef550.zip
Fix whole-row Var evaluation to cope with resjunk columns (again).
When a whole-row Var is reading the result of a subquery, we need it to ignore any "resjunk" columns that the subquery might have evaluated for GROUP BY or ORDER BY purposes. We've hacked this area before, in commit 68e40998d058c1f6662800a648ff1e1ce5d99cba, but that fix only covered whole-row Vars of named composite types, not those of RECORD type; and it was mighty klugy anyway, since it just assumed without checking that any extra columns in the result must be resjunk. A proper fix requires getting hold of the subquery's targetlist so we can actually see which columns are resjunk (whereupon we can use a JunkFilter to get rid of them). So bite the bullet and add some infrastructure to make that possible. Per report from Andrew Dunstan and additional testing by Merlin Moncure. Back-patch to all supported branches. In 8.3, also back-patch commit 292176a118da6979e5d368a4baf27f26896c99a5, which for some reason I had not done at the time, but it's a prerequisite for this change.
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 2bd8b428359..0bbd0d46402 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -524,8 +524,8 @@ ExecBuildProjectionInfo(List *targetList,
* We separate the target list elements into simple Var references and
* expressions which require the full ExecTargetList machinery. To be a
* simple Var, a Var has to be a user attribute and not mismatch the
- * inputDesc. (Note: if there is a type mismatch then ExecEvalVar will
- * probably throw an error at runtime, but we leave that to it.)
+ * inputDesc. (Note: if there is a type mismatch then ExecEvalScalarVar
+ * will probably throw an error at runtime, but we leave that to it.)
*/
exprlist = NIL;
numSimpleVars = 0;