Back-patch LIMIT + INTERSECT fix into 6.5.*.
authorTom Lane <[email protected]>
Tue, 19 Oct 1999 04:38:07 +0000 (04:38 +0000)
committerTom Lane <[email protected]>
Tue, 19 Oct 1999 04:38:07 +0000 (04:38 +0000)
src/backend/parser/gram.y
src/backend/rewrite/rewriteHandler.c

index 7dc68d3f44bde8089ae3e1de8c319271ace097e2..5c9e74ba271c6dc85272f2970d71ef7dcc886368 100644 (file)
@@ -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)
index b4cfe96f5bce0fc04c4660f424f1c0084232c68a..c84dc3f5ca2aa8874f957e7c87913a6ea4db84ef 100644 (file)
@@ -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