mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Back-patch LIMIT + INTERSECT fix into 6.5.*.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.88.2.3 1999/09/24 15:08:59 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.88.2.4 1999/10/19 04:38:07 tgl Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -2768,6 +2768,8 @@ SelectStmt: select_clause sort_clause for_update_clause opt_select_limit
|
||||
/* finally attach the sort clause */
|
||||
first_select->sortClause = $2;
|
||||
first_select->forUpdate = $3;
|
||||
first_select->limitOffset = nth(0, $4);
|
||||
first_select->limitCount = nth(1, $4);
|
||||
$$ = (Node *)first_select;
|
||||
}
|
||||
if (((SelectStmt *)$$)->forUpdate != NULL && QueryIsRule)
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.48 1999/07/11 17:54:30 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.48.2.1 1999/10/19 04:38:05 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2859,6 +2859,8 @@ Except_Intersect_Rewrite(Query *parsetree)
|
||||
bool isBinary,
|
||||
isPortal,
|
||||
isTemp;
|
||||
Node *limitOffset,
|
||||
*limitCount;
|
||||
CmdType commandType = CMD_SELECT;
|
||||
List *rtable_insert = NIL;
|
||||
|
||||
@@ -2909,6 +2911,8 @@ Except_Intersect_Rewrite(Query *parsetree)
|
||||
isBinary = parsetree->isBinary;
|
||||
isPortal = parsetree->isPortal;
|
||||
isTemp = parsetree->isTemp;
|
||||
limitOffset = parsetree->limitOffset;
|
||||
limitCount = parsetree->limitCount;
|
||||
|
||||
/*
|
||||
* The operator tree attached to parsetree->intersectClause is still
|
||||
@@ -3094,6 +3098,8 @@ Except_Intersect_Rewrite(Query *parsetree)
|
||||
result->isPortal = isPortal;
|
||||
result->isBinary = isBinary;
|
||||
result->isTemp = isTemp;
|
||||
result->limitOffset = limitOffset;
|
||||
result->limitCount = limitCount;
|
||||
|
||||
/*
|
||||
* The relation to insert into is attached to the range table of the
|
||||
|
Reference in New Issue
Block a user