Skip to content

Commit ebefbb5

Browse files
committed
Fix failure with whole-row reference to a subquery.
Simple oversight in commit 1cb108e --- recursively examining a subquery output column is only sane if the original Var refers to a single output column. Found by Kevin Grittner.
1 parent 0b7e660 commit ebefbb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/utils/adt/selfuncs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,6 +4505,12 @@ examine_simple_variable(PlannerInfo *root, Var *var,
45054505
RelOptInfo *rel;
45064506
TargetEntry *ste;
45074507

4508+
/*
4509+
* Punt if it's a whole-row var rather than a plain column reference.
4510+
*/
4511+
if (var->varattno == InvalidAttrNumber)
4512+
return;
4513+
45084514
/*
45094515
* Punt if subquery uses set operations or GROUP BY, as these will
45104516
* mash underlying columns' stats beyond recognition. (Set ops are

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy