|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.3 2002/09/04 20:31:15 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.4 2002/11/13 00:44:08 momjian Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
15 | 15 |
|
16 | 16 | #include"postgres.h" |
17 | 17 |
|
| 18 | +#include<limits.h> |
| 19 | + |
18 | 20 | #include"commands/portalcmds.h" |
19 | 21 | #include"executor/executor.h" |
20 | 22 |
|
@@ -55,7 +57,7 @@ PortalCleanup(Portal portal) |
55 | 57 | * |
56 | 58 | *name: name of portal |
57 | 59 | *forward: forward or backward fetch? |
58 | | - *count: # of tuples to fetch (0 implies all) |
| 60 | + *count: # of tuples to fetch |
59 | 61 | *dest: where to send results |
60 | 62 | *completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE |
61 | 63 | *in which to store a command completion status string. |
@@ -100,6 +102,14 @@ PerformPortalFetch(char *name, |
100 | 102 | return; |
101 | 103 | } |
102 | 104 |
|
| 105 | +/* If zero count, we are done */ |
| 106 | +if (count==0) |
| 107 | +return; |
| 108 | + |
| 109 | +/* Internally, zero count processes all portal rows */ |
| 110 | +if (count==INT_MAX) |
| 111 | +count=0; |
| 112 | + |
103 | 113 | /* |
104 | 114 | * switch into the portal context |
105 | 115 | */ |
|