diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-22 23:44:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-22 23:44:25 +0000 |
commit | cc77005df7177d9af1c23b7af1cac08102fcbca9 (patch) | |
tree | f3fa89de1b1e46d901bd0f17bbd3ceed4fa8a480 /src/backend/executor/nodeGroup.c | |
parent | 3c5985b473024f45005c8b4776d4d63ed2d39d82 (diff) | |
download | postgresql-cc77005df7177d9af1c23b7af1cac08102fcbca9.tar.gz postgresql-cc77005df7177d9af1c23b7af1cac08102fcbca9.zip |
Change Agg and Group nodes so that Vars contained in their targetlists
and quals have varno OUTER, rather than zero, to indicate a reference to
an output of their lefttree subplan. This is consistent with the way
that every other upper-level node type does it, and allows some simplifications
in setrefs.c and EXPLAIN.
Diffstat (limited to 'src/backend/executor/nodeGroup.c')
-rw-r--r-- | src/backend/executor/nodeGroup.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c index 0b636aa01e4..ce03f94e2e5 100644 --- a/src/backend/executor/nodeGroup.c +++ b/src/backend/executor/nodeGroup.c @@ -15,7 +15,7 @@ * locate group boundaries. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeGroup.c,v 1.68 2007/02/02 00:07:03 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeGroup.c,v 1.69 2007/02/22 23:44:24 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -72,9 +72,14 @@ ExecGroup(GroupState *node) node->grp_done = TRUE; return NULL; } - /* Copy tuple, set up as input for qual test and projection */ + /* Copy tuple into firsttupleslot */ ExecCopySlot(firsttupleslot, outerslot); - econtext->ecxt_scantuple = firsttupleslot; + + /* + * Set it up as input for qual test and projection. The expressions + * will access the input tuple as varno OUTER. + */ + econtext->ecxt_outertuple = firsttupleslot; /* * Check the qual (HAVING clause); if the group does not match, ignore @@ -126,7 +131,7 @@ ExecGroup(GroupState *node) */ /* Copy tuple, set up as input for qual test and projection */ ExecCopySlot(firsttupleslot, outerslot); - econtext->ecxt_scantuple = firsttupleslot; + econtext->ecxt_outertuple = firsttupleslot; /* * Check the qual (HAVING clause); if the group does not match, ignore |