]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Avoid generating relid lists with duplicate entries. Fixes bugs
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Feb 2003 00:02:43 +0000 (00:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Feb 2003 00:02:43 +0000 (00:02 +0000)
reported by Stefanos Harhalakis 2/2/2003.

src/backend/optimizer/plan/initsplan.c

index e06282c126533c829f05ae2129270049997e3282..60269e62fc1df7269105a4ef5aaa8c3243b208d9 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.75 2002/09/04 20:31:21 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.75.2.1 2003/02/07 00:02:43 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -443,7 +443,8 @@ distribute_qual_to_rels(Query *root, Node *clause,
                        else
                        {
                                /* this relid is for a true baserel */
-                               newrelids = lappendi(newrelids, lfirsti(relid));
+                               if (!intMember(lfirsti(relid), newrelids))
+                                       newrelids = lappendi(newrelids, lfirsti(relid));
                        }
                }
                relids = newrelids;