From e22b09c227d052994ab64cc04e8db677956587b0 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Tue, 6 Jan 1998 23:58:05 +0000
Subject: [PATCH] Fix sorting of multiple fields broken with UNION.

---
 src/backend/parser/parse_clause.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index edd98195a63..7b09518d4f9 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.7 1998/01/05 03:32:26 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.8 1998/01/06 23:58:05 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -263,7 +263,6 @@ transformSortClause(ParseState *pstate,
 		TargetEntry *restarget;
 		Resdom	   *resdom;
 
-		sortlist = NIL;	/* we create it on the fly here */
 		
 		restarget = find_targetlist_entry(pstate, sortby, targetlist);
 		if (restarget == NULL)
@@ -274,9 +273,7 @@ transformSortClause(ParseState *pstate,
 								   resdom->restype,
 								   resdom->restype, false));
 		if (sortlist == NIL)
-		{
 			s = sortlist = lcons(sortcl, NIL);
-		}
 		else
 		{
 			List	   *i;
-- 
GitLab