1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix for ORDER BY in UNION.

This commit is contained in:
Bruce Momjian
1997-12-29 04:31:50 +00:00
parent 499b13c994
commit a1dd409053
4 changed files with 15 additions and 15 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.58 1997/12/29 01:12:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.59 1997/12/29 04:31:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -828,6 +828,7 @@ transformSelectStmt(ParseState *pstate, RetrieveStmt *stmt)
/* fix order clause */
qry->sortClause = transformSortClause(pstate,
stmt->sortClause,
NIL,
qry->targetList,
qry->uniqueFlag);
@ -842,9 +843,6 @@ transformSelectStmt(ParseState *pstate, RetrieveStmt *stmt)
qry->unionall = stmt->unionall; /* in child, so unionClause may be false */
qry->unionClause = transformUnionClause(stmt->unionClause, qry->targetList);
if (qry->unionClause && stmt->sortClause)
elog(WARN, "You can not use ORDER BY with UNION", NULL);
return (Query *) qry;
}
@ -918,6 +916,7 @@ transformCursorStmt(ParseState *pstate, CursorStmt *stmt)
/* fix order clause */
qry->sortClause = transformSortClause(pstate,
stmt->sortClause,
NIL,
qry->targetList,
qry->uniqueFlag);
/* fix group by clause */