git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f36b636)
Fix comment about ressortgrouprefs being unique in setop plans.
2023年11月28日 12:08:43 +0000 (14:08 +0200)
2023年11月28日 12:15:14 +0000 (14:15 +0200)
Author: Richard Guo, Tom Lane
Discussion: https://www.postgresql.org/message-id/CAMbWs49rAfFS-yd7=QxtDUrZDFfRBGy4rGBJNyGDH7=CLipFPg@mail.gmail.com


diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index fc3709510d2c673b5a299fc52db745c1f071cc7a..4bb68ac90e7d6223936b548e25537567e9903aba 100644 (file)
--- 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))
{
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /