mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Make the world safe for passing whole rows of views to functions. This
already worked fine for whole rows of tables, but not so well for views...
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.103 2001/04/01 22:37:19 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.104 2001/04/18 20:42:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -271,8 +271,12 @@ pull_up_subqueries(Query *parse, Node *jtnode)
|
||||
/*
|
||||
* Is this a subquery RTE, and if so, is the subquery simple
|
||||
* enough to pull up? (If not, do nothing at this node.)
|
||||
*
|
||||
* Note: even if the subquery itself is simple enough, we can't
|
||||
* pull it up if there is a reference to its whole tuple result.
|
||||
*/
|
||||
if (subquery && is_simple_subquery(subquery))
|
||||
if (subquery && is_simple_subquery(subquery) &&
|
||||
!contain_whole_tuple_var((Node *) parse, varno, 0))
|
||||
{
|
||||
int rtoffset;
|
||||
Node *subjointree;
|
||||
|
Reference in New Issue
Block a user