diff options
| author | Bruce Momjian | 2006-09-02 18:17:18 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2006-09-02 18:17:18 +0000 |
| commit | 6c785d599d2053d27a8d3395dd3802e6ca2be9b1 (patch) | |
| tree | 49529f76003c6d9cfeb1fb2cb79deddf682b7d37 /src/backend/tcop | |
| parent | 87eb130ad86465b7b9719bdc178eb2dcc0493a22 (diff) | |
Change FETCH/MOVE to use int8.
Dhanaraj M
Diffstat (limited to 'src/backend/tcop')
| -rw-r--r-- | src/backend/tcop/postgres.c | 8 | ||||
| -rw-r--r-- | src/backend/tcop/pquery.c | 50 |
2 files changed, 29 insertions, 29 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 6552d943431..62ad35bc00c 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.503 2006/08/30 18:22:02 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.504 2006/09/02 18:17:17 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1687,7 +1687,7 @@ exec_bind_message(StringInfo input_message) * Process an "Execute" message for a portal */ static void -exec_execute_message(const char *portal_name, long max_rows) +exec_execute_message(const char *portal_name, int64 max_rows) { CommandDest dest; DestReceiver *receiver; @@ -3308,13 +3308,13 @@ PostgresMain(int argc, char *argv[], const char *username) case 'E': /* execute */ { const char *portal_name; - int max_rows; + int64 max_rows; /* Set statement_timestamp() */ SetCurrentStatementStartTimestamp(); portal_name = pq_getmsgstring(&input_message); - max_rows = pq_getmsgint(&input_message, 4); + max_rows = pq_getmsgint64(&input_message); pq_getmsgend(&input_message); exec_execute_message(portal_name, max_rows); diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 3ede40570ab..257655ddb0f 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.107 2006/08/14 22:57:15 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.108 2006/09/02 18:17:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -38,18 +38,18 @@ static void ProcessQuery(Query *parsetree, DestReceiver *dest, char *completionTag); static void FillPortalStore(Portal portal); -static uint32 RunFromStore(Portal portal, ScanDirection direction, long count, +static uint64 RunFromStore(Portal portal, ScanDirection direction, int64 count, DestReceiver *dest); -static long PortalRunSelect(Portal portal, bool forward, long count, +static int64 PortalRunSelect(Portal portal, bool forward, int64 count, DestReceiver *dest); static void PortalRunUtility(Portal portal, Query *query, DestReceiver *dest, char *completionTag); static void PortalRunMulti(Portal portal, DestReceiver *dest, DestReceiver *altdest, char *completionTag); -static long DoPortalRunFetch(Portal portal, +static int64 DoPortalRunFetch(Portal portal, FetchDirection fdirection, - long count, + int64 count, DestReceiver *dest); static void DoPortalRewind(Portal portal); @@ -581,7 +581,7 @@ PortalSetResultFormat(Portal portal, int nFormats, int16 *formats) * suspended due to exhaustion of the count parameter. */ bool -PortalRun(Portal portal, long count, +PortalRun(Portal portal, int64 count, DestReceiver *dest, DestReceiver *altdest, char *completionTag) { @@ -773,15 +773,15 @@ PortalRun(Portal portal, long count, * * Returns number of rows processed (suitable for use in result tag) */ -static long +static int64 PortalRunSelect(Portal portal, bool forward, - long count, + int64 count, DestReceiver *dest) { QueryDesc *queryDesc; ScanDirection direction; - uint32 nprocessed; + uint64 nprocessed; /* * NB: queryDesc will be NULL if we are fetching from a held cursor or a @@ -834,12 +834,12 @@ PortalRunSelect(Portal portal, if (!ScanDirectionIsNoMovement(direction)) { - long oldPos; + int64 oldPos; if (nprocessed > 0) portal->atStart = false; /* OK to go backward now */ if (count == 0 || - (unsigned long) nprocessed < (unsigned long) count) + (uint64) nprocessed < (uint64) count) portal->atEnd = true; /* we retrieved 'em all */ oldPos = portal->portalPos; portal->portalPos += nprocessed; @@ -882,7 +882,7 @@ PortalRunSelect(Portal portal, portal->portalPos++; /* adjust for endpoint case */ } if (count == 0 || - (unsigned long) nprocessed < (unsigned long) count) + (uint64) nprocessed < (uint64) count) { portal->atStart = true; /* we retrieved 'em all */ portal->portalPos = 0; @@ -890,7 +890,7 @@ PortalRunSelect(Portal portal, } else { - long oldPos; + int64 oldPos; oldPos = portal->portalPos; portal->portalPos -= nprocessed; @@ -958,11 +958,11 @@ FillPortalStore(Portal portal) * are run in the caller's memory context (since we have no estate). Watch * out for memory leaks. */ -static uint32 -RunFromStore(Portal portal, ScanDirection direction, long count, +static uint64 +RunFromStore(Portal portal, ScanDirection direction, int64 count, DestReceiver *dest) { - long current_tuple_count = 0; + int64 current_tuple_count = 0; TupleTableSlot *slot; slot = MakeSingleTupleTableSlot(portal->tupDesc); @@ -1010,7 +1010,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count, ExecDropSingleTupleTableSlot(slot); - return (uint32) current_tuple_count; + return (uint64) current_tuple_count; } /* @@ -1200,13 +1200,13 @@ PortalRunMulti(Portal portal, * * Returns number of rows processed (suitable for use in result tag) */ -long +int64 PortalRunFetch(Portal portal, FetchDirection fdirection, - long count, + int64 count, DestReceiver *dest) { - long result; + int64 result; Portal saveActivePortal; Snapshot saveActiveSnapshot; ResourceOwner saveResourceOwner; @@ -1307,10 +1307,10 @@ PortalRunFetch(Portal portal, * * Returns number of rows processed (suitable for use in result tag) */ -static long +static int64 DoPortalRunFetch(Portal portal, FetchDirection fdirection, - long count, + int64 count, DestReceiver *dest) { bool forward; @@ -1347,7 +1347,7 @@ DoPortalRunFetch(Portal portal, * we are. In any case, we arrange to fetch the target row * going forwards. */ - if (portal->posOverflow || portal->portalPos == LONG_MAX || + if (portal->posOverflow || portal->portalPos == LLONG_MAX || count - 1 <= portal->portalPos / 2) { DoPortalRewind(portal); @@ -1357,7 +1357,7 @@ DoPortalRunFetch(Portal portal, } else { - long pos = portal->portalPos; + int64 pos = portal->portalPos; if (portal->atEnd) pos++; /* need one extra fetch if off end */ @@ -1469,7 +1469,7 @@ DoPortalRunFetch(Portal portal, */ if (!forward && count == FETCH_ALL && dest->mydest == DestNone) { - long result = portal->portalPos; + int64 result = portal->portalPos; if (result > 0 && !portal->atEnd) result--; |
