From 94e4778a31daf3524a2f807b4f830f23a9c2a889 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 23 Jan 2005 02:21:36 +0000 Subject: The result of a FULL or RIGHT join can't be assumed to be sorted by the left input's sorting, because null rows may be inserted at various points. Per report from Ferenc Lutischá¸n. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/optimizer/path/joinpath.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/backend/optimizer/path/joinpath.c') diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index 65c7690af47..97e4d7dda87 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.91 2004/12/31 22:00:04 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.92 2005/01/23 02:21:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -271,7 +271,8 @@ sort_inner_and_outer(Query *root, cur_mergeclauses, innerrel); /* Build pathkeys representing output sort order. */ - merge_pathkeys = build_join_pathkeys(root, joinrel, outerkeys); + merge_pathkeys = build_join_pathkeys(root, joinrel, jointype, + outerkeys); /* * And now we can make the path. @@ -431,7 +432,7 @@ match_unsorted_outer(Query *root, * as a nestloop, and even if some of the mergeclauses are * implemented by qpquals rather than as true mergeclauses): */ - merge_pathkeys = build_join_pathkeys(root, joinrel, + merge_pathkeys = build_join_pathkeys(root, joinrel, jointype, outerpath->pathkeys); if (nestjoinOK) -- cgit v1.2.3