mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix failure with whole-row reference to a subquery.
Simple oversight in commit 1cb108efb0e60d87e4adec38e7636b6e8efbeb57 --- recursively examining a subquery output column is only sane if the original Var refers to a single output column. Found by Kevin Grittner.
This commit is contained in:
parent
0b7e660d6c
commit
ebefbb5fde
@ -4505,6 +4505,12 @@ examine_simple_variable(PlannerInfo *root, Var *var,
|
|||||||
RelOptInfo *rel;
|
RelOptInfo *rel;
|
||||||
TargetEntry *ste;
|
TargetEntry *ste;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Punt if it's a whole-row var rather than a plain column reference.
|
||||||
|
*/
|
||||||
|
if (var->varattno == InvalidAttrNumber)
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Punt if subquery uses set operations or GROUP BY, as these will
|
* Punt if subquery uses set operations or GROUP BY, as these will
|
||||||
* mash underlying columns' stats beyond recognition. (Set ops are
|
* mash underlying columns' stats beyond recognition. (Set ops are
|
||||||
|
Loading…
x
Reference in New Issue
Block a user