Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d1af6a

Browse files
committed
build_subquery_pathkeys() was examining wrong copy of subquery target list,
causing it to fail to recognize the output ordering of subqueries thatcontain set operations (UNION/INTERSECT/EXPECT). Per example from Karel Zak.
1 parentf1d0269 commit5d1af6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/optimizer/path/pathkeys.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.55 2003/12/03 17:45:07 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.56 2004/04/07 17:42:28 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -757,6 +757,7 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery)
757757
List*retval=NIL;
758758
intretvallen=0;
759759
intouter_query_keys=length(root->query_pathkeys);
760+
List*sub_tlist=rel->subplan->targetlist;
760761
List*l;
761762

762763
foreach(l,subquery->query_pathkeys)
@@ -789,7 +790,7 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery)
789790
Node*sub_key=sub_item->key;
790791
List*k;
791792

792-
foreach(k,subquery->targetList)
793+
foreach(k,sub_tlist)
793794
{
794795
TargetEntry*tle= (TargetEntry*)lfirst(k);
795796

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp