Content-Length: 270428 | pFad | http://github.com/postgrespro/postgres/commit/10a59925a378bd67aa3834c842dad19de9c5e4c0

16 Fix comment about ressortgrouprefs being unique in setop plans. · postgrespro/postgres@10a5992 · GitHub
Skip to content

Commit 10a5992

Browse files
committed
Fix comment about ressortgrouprefs being unique in setop plans.
Author: Richard Guo, Tom Lane Discussion: https://www.postgresql.org/message-id/CAMbWs49rAfFS-yd7=QxtDUrZDFfRBGy4rGBJNyGDH7=CLipFPg@mail.gmail.com
1 parent f36b636 commit 10a5992

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/optimizer/plan/setrefs.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,14 @@ search_indexed_tlist_for_sortgroupref(Expr *node,
29362936
{
29372937
TargetEntry *tle = (TargetEntry *) lfirst(lc);
29382938

2939-
/* The equal() check should be redundant, but let's be paranoid */
2939+
/*
2940+
* Usually the equal() check is redundant, but in setop plans it may
2941+
* not be, since prepunion.c assigns ressortgroupref equal to the
2942+
* column resno without regard to whether that matches the topmost
2943+
* level's sortgrouprefs and without regard to whether any implicit
2944+
* coercions are added in the setop tree. We might have to clean that
2945+
* up someday; but for now, just ignore any false matches.
2946+
*/
29402947
if (tle->ressortgroupref == sortgroupref &&
29412948
equal(node, tle->expr))
29422949
{

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/10a59925a378bd67aa3834c842dad19de9c5e4c0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy