mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Make MOVE/FETCH 0 actually move/fetch 0. Add MOVE LAST to move to end
of cursor.
This commit is contained in:
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user