Add LIMIT syntax for Jan.
This commit is contained in:
parent
ca2995be7b
commit
002657f7ed
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.48 1998/09/01 04:29:00 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.49 1998/10/22 13:52:20 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1578,6 +1578,9 @@ _copyQuery(Query *from)
|
|||||||
newnode->unionClause = temp_list;
|
newnode->unionClause = temp_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node_Copy(from, newnode, limitOffset);
|
||||||
|
Node_Copy(from, newnode, limitCount);
|
||||||
|
|
||||||
return newnode;
|
return newnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.46 1998/09/01 04:29:07 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.47 1998/10/22 13:52:21 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||||
@ -259,6 +259,10 @@ _outQuery(StringInfo str, Query *node)
|
|||||||
appendStringInfo(str, (node->hasSubLinks ? "true" : "false"));
|
appendStringInfo(str, (node->hasSubLinks ? "true" : "false"));
|
||||||
appendStringInfo(str, " :unionClause ");
|
appendStringInfo(str, " :unionClause ");
|
||||||
_outNode(str, node->unionClause);
|
_outNode(str, node->unionClause);
|
||||||
|
appendStringInfo(str, " :limitOffset ");
|
||||||
|
_outNode(str, node->limitOffset);
|
||||||
|
appendStringInfo(str, " :limitCount ");
|
||||||
|
_outNode(str, node->limitCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.37 1998/09/01 04:29:12 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.38 1998/10/22 13:52:22 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||||
@ -163,6 +163,12 @@ _readQuery()
|
|||||||
token = lsptok(NULL, &length); /* skip :unionClause */
|
token = lsptok(NULL, &length); /* skip :unionClause */
|
||||||
local_node->unionClause = nodeRead(true);
|
local_node->unionClause = nodeRead(true);
|
||||||
|
|
||||||
|
token = lsptok(NULL, &length); /* skip :limitOffset */
|
||||||
|
local_node->limitOffset = nodeRead(true);
|
||||||
|
|
||||||
|
token = lsptok(NULL, &length); /* skip :limitCount */
|
||||||
|
local_node->limitCount = nodeRead(true);
|
||||||
|
|
||||||
return local_node;
|
return local_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parsenodes.h,v 1.60 1998/10/02 16:23:07 momjian Exp $
|
* $Id: parsenodes.h,v 1.61 1998/10/22 13:52:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -60,6 +60,8 @@ typedef struct Query
|
|||||||
|
|
||||||
List *unionClause; /* unions are linked under the previous
|
List *unionClause; /* unions are linked under the previous
|
||||||
* query */
|
* query */
|
||||||
|
Node *limitOffset; /* # of result tuples to skip */
|
||||||
|
Node *limitCount; /* # of result tuples to return */
|
||||||
|
|
||||||
/* internal to planner */
|
/* internal to planner */
|
||||||
List *base_rel_list; /* base relation list */
|
List *base_rel_list; /* base relation list */
|
||||||
@ -639,6 +641,8 @@ typedef struct SelectStmt
|
|||||||
char *portalname; /* the portal (cursor) to create */
|
char *portalname; /* the portal (cursor) to create */
|
||||||
bool binary; /* a binary (internal) portal? */
|
bool binary; /* a binary (internal) portal? */
|
||||||
bool unionall; /* union without unique sort */
|
bool unionall; /* union without unique sort */
|
||||||
|
Node *limitOffset; /* # of result tuples to skip */
|
||||||
|
Node *limitCount; /* # of result tuples to return */
|
||||||
} SelectStmt;
|
} SelectStmt;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user