diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-09 03:48:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-09 03:48:51 +0000 |
commit | 07c741e61c8cb1fd945907a225d15467a08aca70 (patch) | |
tree | 68ab78fd412905df40da36058e4f35ec31858c6f /src/backend/optimizer/util | |
parent | 4cb0950cfe4055ca54d08b9639ee4e462cb009a3 (diff) |
Fix oversight in planning of GROUP queries: when an expression is used
as both a GROUP BY item and an output expression, the top-level Group
node should just copy up the evaluated expression value from its input,
rather than re-evaluating the expression. Aside from any performance
benefit this might offer, this avoids a crash when there is a sub-SELECT
in said expression.
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r-- | src/backend/optimizer/util/tlist.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 93b3fc6f568..fa542a8828a 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.47 2000/08/08 15:41:53 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.48 2001/01/09 03:48:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -18,7 +18,6 @@ #include "optimizer/tlist.h" #include "optimizer/var.h" -static TargetEntry *tlistentry_member(Node *node, List *targetlist); /***************************************************************************** * ---------- RELATION node target list routines ---------- @@ -29,7 +28,7 @@ static TargetEntry *tlistentry_member(Node *node, List *targetlist); * Finds the (first) member of the given tlist whose expression is * equal() to the given expression. Result is NULL if no such member. */ -static TargetEntry * +TargetEntry * tlistentry_member(Node *node, List *targetlist) { List *temp; |