OSDN Git Service

Fix oversight in planning of GROUP queries: when an expression is used
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Jan 2001 03:48:51 +0000 (03:48 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Jan 2001 03:48:51 +0000 (03:48 +0000)
commit07c741e61c8cb1fd945907a225d15467a08aca70
tree68ab78fd412905df40da36058e4f35ec31858c6f
parent4cb0950cfe4055ca54d08b9639ee4e462cb009a3
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.
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/util/tlist.c
src/include/optimizer/tlist.h