diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2023-11-28 14:08:43 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2023-11-28 14:15:14 +0200 |
commit | 10a59925a378bd67aa3834c842dad19de9c5e4c0 (patch) | |
tree | 88690ad7a78f32b4aba8f12dbd4f96d81b864350 /src | |
parent | f36b63623db60e16b910658d6fde6b7931e0ac46 (diff) | |
download | postgresql-10a59925a378bd67aa3834c842dad19de9c5e4c0.tar.gz postgresql-10a59925a378bd67aa3834c842dad19de9c5e4c0.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/plan/setrefs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index fc3709510d2..4bb68ac90e7 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -2936,7 +2936,14 @@ search_indexed_tlist_for_sortgroupref(Expr *node, { TargetEntry *tle = (TargetEntry *) lfirst(lc); - /* The equal() check should be redundant, but let's be paranoid */ + /* + * Usually the equal() check is redundant, but in setop plans it may + * not be, since prepunion.c assigns ressortgroupref equal to the + * column resno without regard to whether that matches the topmost + * level's sortgrouprefs and without regard to whether any implicit + * coercions are added in the setop tree. We might have to clean that + * up someday; but for now, just ignore any false matches. + */ if (tle->ressortgroupref == sortgroupref && equal(node, tle->expr)) { |