mirror of
https://github.com/postgres/postgres.git
synced 2025-08-12 15:23:02 +03:00
Back-patch LIMIT + INTERSECT fix into 6.5.*.
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@@ -2768,6 +2768,8 @@ SelectStmt: select_clause sort_clause for_update_clause opt_select_limit
|
|||||||
/* finally attach the sort clause */
|
/* finally attach the sort clause */
|
||||||
first_select->sortClause = $2;
|
first_select->sortClause = $2;
|
||||||
first_select->forUpdate = $3;
|
first_select->forUpdate = $3;
|
||||||
|
first_select->limitOffset = nth(0, $4);
|
||||||
|
first_select->limitCount = nth(1, $4);
|
||||||
$$ = (Node *)first_select;
|
$$ = (Node *)first_select;
|
||||||
}
|
}
|
||||||
if (((SelectStmt *)$$)->forUpdate != NULL && QueryIsRule)
|
if (((SelectStmt *)$$)->forUpdate != NULL && QueryIsRule)
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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,
|
bool isBinary,
|
||||||
isPortal,
|
isPortal,
|
||||||
isTemp;
|
isTemp;
|
||||||
|
Node *limitOffset,
|
||||||
|
*limitCount;
|
||||||
CmdType commandType = CMD_SELECT;
|
CmdType commandType = CMD_SELECT;
|
||||||
List *rtable_insert = NIL;
|
List *rtable_insert = NIL;
|
||||||
|
|
||||||
@@ -2909,6 +2911,8 @@ Except_Intersect_Rewrite(Query *parsetree)
|
|||||||
isBinary = parsetree->isBinary;
|
isBinary = parsetree->isBinary;
|
||||||
isPortal = parsetree->isPortal;
|
isPortal = parsetree->isPortal;
|
||||||
isTemp = parsetree->isTemp;
|
isTemp = parsetree->isTemp;
|
||||||
|
limitOffset = parsetree->limitOffset;
|
||||||
|
limitCount = parsetree->limitCount;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The operator tree attached to parsetree->intersectClause is still
|
* The operator tree attached to parsetree->intersectClause is still
|
||||||
@@ -3094,6 +3098,8 @@ Except_Intersect_Rewrite(Query *parsetree)
|
|||||||
result->isPortal = isPortal;
|
result->isPortal = isPortal;
|
||||||
result->isBinary = isBinary;
|
result->isBinary = isBinary;
|
||||||
result->isTemp = isTemp;
|
result->isTemp = isTemp;
|
||||||
|
result->limitOffset = limitOffset;
|
||||||
|
result->limitCount = limitCount;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The relation to insert into is attached to the range table of the
|
* The relation to insert into is attached to the range table of the
|
||||||
|
Reference in New Issue
Block a user