diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-11-13 00:44:09 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-11-13 00:44:09 +0000 |
| commit | 4e5a947d1c0db0d826ec422c2aa899915c6f1758 (patch) | |
| tree | 5991452f43bbc43aa4359de0a56eeecd6e644474 /src/backend/commands | |
| parent | 9b12ab6d5dd6c40ac112456c820a8dc199fc6e16 (diff) | |
Make MOVE/FETCH 0 actually move/fetch 0. Add MOVE LAST to move to end
of cursor.
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/portalcmds.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 0454b21b11a..812cb05dacf 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -8,13 +8,15 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.3 2002/09/04 20:31:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.4 2002/11/13 00:44:08 momjian Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" +#include <limits.h> + #include "commands/portalcmds.h" #include "executor/executor.h" @@ -55,7 +57,7 @@ PortalCleanup(Portal portal) * * name: name of portal * forward: forward or backward fetch? - * count: # of tuples to fetch (0 implies all) + * count: # of tuples to fetch * dest: where to send results * completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE * in which to store a command completion status string. @@ -100,6 +102,14 @@ PerformPortalFetch(char *name, return; } + /* If zero count, we are done */ + if (count == 0) + return; + + /* Internally, zero count processes all portal rows */ + if (count == INT_MAX) + count = 0; + /* * switch into the portal context */ |
