1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

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.
This commit is contained in:
Tom Lane
2001-01-09 03:48:51 +00:00
parent 4cb0950cfe
commit 07c741e61c
4 changed files with 67 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: tlist.h,v 1.26 2000/06/08 22:37:51 momjian Exp $
* $Id: tlist.h,v 1.27 2001/01/09 03:48:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,6 +16,7 @@
#include "nodes/relation.h"
extern TargetEntry *tlistentry_member(Node *node, List *targetlist);
extern Resdom *tlist_member(Node *node, List *targetlist);
extern void add_var_to_tlist(RelOptInfo *rel, Var *var);