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: f1d0269)
build_subquery_pathkeys() was examining wrong copy of subquery target list,
Wed, 7 Apr 2004 17:42:28 +0000 (17:42 +0000)
Wed, 7 Apr 2004 17:42:28 +0000 (17:42 +0000)
causing it to fail to recognize the output ordering of subqueries that
contain set operations (UNION/INTERSECT/EXPECT). Per example from Karel Zak.


diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c
index d6d83f7c761d2697214838c8b51896d10b79c212..65eb5cb8a6502e24f60207a78e304407bef30a53 100644 (file)
--- a/src/backend/optimizer/path/pathkeys.c
+++ b/src/backend/optimizer/path/pathkeys.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.55 2003年12月03日 17:45:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.56 2004年04月07日 17:42:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -757,6 +757,7 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery)
List *retval = NIL;
int retvallen = 0;
int outer_query_keys = length(root->query_pathkeys);
+ List *sub_tlist = rel->subplan->targetlist;
List *l;
foreach(l, subquery->query_pathkeys)
@@ -789,7 +790,7 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery)
Node *sub_key = sub_item->key;
List *k;
- foreach(k, subquery->targetList)
+ foreach(k, sub_tlist)
{
TargetEntry *tle = (TargetEntry *) lfirst(k);
This is the main PostgreSQL git repository.
RSS Atom

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