Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3d5079c

Browse files
committed
Except_Intersect_Rewrite() forgot to move LIMIT info to new
topmost SELECT node after rearranging query tree.
1 parent e1c76c2 commit 3d5079c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/rewrite/rewriteHandler.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.60 1999/10/07 04:23:15 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.61 1999/10/17 23:50:43 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -1806,6 +1806,8 @@ Except_Intersect_Rewrite(Query *parsetree)
18061806
bool isBinary,
18071807
isPortal,
18081808
isTemp;
1809+
Node *limitOffset,
1810+
*limitCount;
18091811
CmdType commandType = CMD_SELECT;
18101812
List *rtable_insert = NIL;
18111813

@@ -1856,6 +1858,8 @@ Except_Intersect_Rewrite(Query *parsetree)
18561858
isBinary = parsetree->isBinary;
18571859
isPortal = parsetree->isPortal;
18581860
isTemp = parsetree->isTemp;
1861+
limitOffset = parsetree->limitOffset;
1862+
limitCount = parsetree->limitCount;
18591863

18601864
/*
18611865
* The operator tree attached to parsetree->intersectClause is still
@@ -2057,6 +2061,8 @@ Except_Intersect_Rewrite(Query *parsetree)
20572061
result->isPortal = isPortal;
20582062
result->isBinary = isBinary;
20592063
result->isTemp = isTemp;
2064+
result->limitOffset = limitOffset;
2065+
result->limitCount = limitCount;
20602066

20612067
/*
20622068
* The relation to insert into is attached to the range table of the
@@ -2080,6 +2086,7 @@ Except_Intersect_Rewrite(Query *parsetree)
20802086
tent->resdom->resname = lfirst(resnames);
20812087
resnames = lnext(resnames);
20822088
}
2089+
20832090
return result;
20842091
}
20852092

0 commit comments

Comments
 (0)