From be948af2e81d44290a15a0b8614fdd209924f698 Mon Sep 17 00:00:00 2001 From: Jan Wieck Date: Mon, 8 Feb 1999 14:14:32 +0000 Subject: Added LIMIT/OFFSET functionality including new regression test for it. Removed CURRENT keyword for rule queries and changed rules regression accordingly. CURRENT has beed announced to disappear in v6.5. Jan --- src/backend/commands/command.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/command.c') diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 1a65f4d4d0d..310325d2f81 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.36 1999/02/03 21:16:02 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.37 1999/02/08 14:14:08 wieck Exp $ * * NOTES * The PortalExecutorHeapMemory crap needs to be eliminated @@ -40,6 +40,7 @@ #include "utils/portal.h" #include "utils/syscache.h" #include "miscadmin.h" +#include "string.h" /* ---------------- * PortalExecutorHeapMemory stuff @@ -102,6 +103,7 @@ PerformPortalFetch(char *name, int feature; QueryDesc *queryDesc; MemoryContext context; + Const limcount; /* ---------------- * sanity checks @@ -113,6 +115,21 @@ PerformPortalFetch(char *name, return; } + /* ---------------- + * Create a const node from the given count value + * ---------------- + */ + memset(&limcount, 0, sizeof(limcount)); + limcount.type = T_Const; + limcount.consttype = INT4OID; + limcount.constlen = sizeof(int4); + limcount.constvalue = (Datum)count; + limcount.constisnull = FALSE; + limcount.constbyval = TRUE; + limcount.constisset = FALSE; + limcount.constiscast = FALSE; + + /* ---------------- * get the portal from the portal name * ---------------- @@ -176,7 +193,8 @@ PerformPortalFetch(char *name, PortalExecutorHeapMemory = (MemoryContext) PortalGetHeapMemory(portal); - ExecutorRun(queryDesc, PortalGetState(portal), feature, count); + ExecutorRun(queryDesc, PortalGetState(portal), feature, + (Node *)NULL, (Node *)&limcount); if (dest == None) /* MOVE */ pfree(queryDesc); -- cgit v1.2.3