diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 52e41e1b89..412b88af8f 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -1,5 +1,5 @@ @@ -292,7 +292,7 @@ void SPI_pop(void) -int SPI_execute(const char * command, bool read_only, int count) +int SPI_execute(const char * command, bool read_only, long count) @@ -423,7 +423,7 @@ typedef struct - int count + long count maximum number of rows to process or return @@ -598,7 +598,7 @@ typedef struct -int SPI_exec(const char * command, int count) +int SPI_exec(const char * command, long count) @@ -627,7 +627,7 @@ int SPI_exec(const char * command, int count - int count + long count maximum number of rows to process or return @@ -963,7 +963,7 @@ bool SPI_is_cursor_plan(void * plan) int SPI_execute_plan(void * plan, Datum * values, const char * nulls, - bool read_only, int count) + bool read_only, long count) @@ -1030,7 +1030,7 @@ int SPI_execute_plan(void * plan, Datum * valu - int count + long count maximum number of rows to process or return @@ -1104,7 +1104,7 @@ int SPI_execute_plan(void * plan, Datum * valu -int SPI_execp(void * plan, Datum * values, const char * nulls, int count) +int SPI_execp(void * plan, Datum * values, const char * nulls, long count) @@ -1162,7 +1162,7 @@ int SPI_execp(void * plan, Datum * values - int count + long count maximum number of rows to process or return @@ -1375,7 +1375,7 @@ Portal SPI_cursor_find(const char * name) -void SPI_cursor_fetch(Portal portal, bool forward, int count) +void SPI_cursor_fetch(Portal portal, bool forward, long count) @@ -1411,7 +1411,7 @@ void SPI_cursor_fetch(Portal portal, bool forw - int count + long count maximum number of rows to fetch @@ -1448,7 +1448,7 @@ void SPI_cursor_fetch(Portal portal, bool forw -void SPI_cursor_move(Portal portal, bool forward, int count) +void SPI_cursor_move(Portal portal, bool forward, long count) @@ -1485,7 +1485,7 @@ void SPI_cursor_move(Portal portal, bool forwa - int count + long count maximum number of rows to move diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 0a9bede0e0..71a4392a9a 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.138 2005/05/01 18:56:18 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.139 2005/05/02 00:37:06 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -39,13 +39,13 @@ static void _SPI_prepare_plan(const char *src, _SPI_plan *plan); static int _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls, Snapshot snapshot, Snapshot crosscheck_snapshot, - bool read_only, int tcount); + bool read_only, long tcount); -static int _SPI_pquery(QueryDesc *queryDesc, int tcount); +static int _SPI_pquery(QueryDesc *queryDesc, long tcount); static void _SPI_error_callback(void *arg); -static void _SPI_cursor_operation(Portal portal, bool forward, int count, +static void _SPI_cursor_operation(Portal portal, bool forward, long count, DestReceiver *dest); static _SPI_plan *_SPI_copy_plan(_SPI_plan *plan, int location); @@ -278,9 +278,9 @@ SPI_restore_connection(void) _SPI_curid = _SPI_connected - 1; } -/* Parse, plan, and execute a querystring */ +/* Parse, plan, and execute a query string */ int -SPI_execute(const char *src, bool read_only, int tcount) +SPI_execute(const char *src, bool read_only, long tcount) { _SPI_plan plan; int res; @@ -309,7 +309,7 @@ SPI_execute(const char *src, bool read_only, int tcount) /* Obsolete version of SPI_execute */ int -SPI_exec(const char *src, int tcount) +SPI_exec(const char *src, long tcount) { return SPI_execute(src, false, tcount); } @@ -317,7 +317,7 @@ SPI_exec(const char *src, int tcount) /* Execute a previously prepared plan */ int SPI_execute_plan(void *plan, Datum *Values, const char *Nulls, - bool read_only, int tcount) + bool read_only, long tcount) { int res; @@ -342,7 +342,7 @@ SPI_execute_plan(void *plan, Datum *Values, const char *Nulls, /* Obsolete version of SPI_execute_plan */ int -SPI_execp(void *plan, Datum *Values, const char *Nulls, int tcount) +SPI_execp(void *plan, Datum *Values, const char *Nulls, long tcount) { return SPI_execute_plan(plan, Values, Nulls, false, tcount); } @@ -360,7 +360,7 @@ int SPI_execute_snapshot(void *plan, Datum *Values, const char *Nulls, Snapshot snapshot, Snapshot crosscheck_snapshot, - bool read_only, int tcount) + bool read_only, long tcount) { int res; @@ -979,7 +979,7 @@ SPI_cursor_find(const char *name) * Fetch rows in a cursor */ void -SPI_cursor_fetch(Portal portal, bool forward, int count) +SPI_cursor_fetch(Portal portal, bool forward, long count) { _SPI_cursor_operation(portal, forward, count, CreateDestReceiver(SPI, NULL)); @@ -993,7 +993,7 @@ SPI_cursor_fetch(Portal portal, bool forward, int count) * Move in a cursor */ void -SPI_cursor_move(Portal portal, bool forward, int count) +SPI_cursor_move(Portal portal, bool forward, long count) { _SPI_cursor_operation(portal, forward, count, None_Receiver); } @@ -1309,7 +1309,7 @@ _SPI_prepare_plan(const char *src, _SPI_plan *plan) static int _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls, Snapshot snapshot, Snapshot crosscheck_snapshot, - bool read_only, int tcount) + bool read_only, long tcount) { volatile int res = 0; Snapshot saveActiveSnapshot; @@ -1493,7 +1493,7 @@ fail: } static int -_SPI_pquery(QueryDesc *queryDesc, int tcount) +_SPI_pquery(QueryDesc *queryDesc, long tcount) { int operation = queryDesc->operation; int res; @@ -1531,7 +1531,7 @@ _SPI_pquery(QueryDesc *queryDesc, int tcount) ExecutorStart(queryDesc, false); - ExecutorRun(queryDesc, ForwardScanDirection, (long) tcount); + ExecutorRun(queryDesc, ForwardScanDirection, tcount); _SPI_current->processed = queryDesc->estate->es_processed; save_lastoid = queryDesc->estate->es_lastoid; @@ -1599,7 +1599,7 @@ _SPI_error_callback(void *arg) * Do a FETCH or MOVE in a cursor */ static void -_SPI_cursor_operation(Portal portal, bool forward, int count, +_SPI_cursor_operation(Portal portal, bool forward, long count, DestReceiver *dest) { long nfetched; @@ -1621,7 +1621,7 @@ _SPI_cursor_operation(Portal portal, bool forward, int count, /* Run the cursor */ nfetched = PortalRunFetch(portal, forward ? FETCH_FORWARD : FETCH_BACKWARD, - (long) count, + count, dest); /* diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index 10e4747dd9..23562c75e5 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -2,7 +2,7 @@ * * spi.h * - * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.51 2005/03/29 02:53:53 neilc Exp $ + * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.52 2005/05/02 00:37:06 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -82,17 +82,17 @@ extern int SPI_finish(void); extern void SPI_push(void); extern void SPI_pop(void); extern void SPI_restore_connection(void); -extern int SPI_execute(const char *src, bool read_only, int tcount); +extern int SPI_execute(const char *src, bool read_only, long tcount); extern int SPI_execute_plan(void *plan, Datum *Values, const char *Nulls, - bool read_only, int tcount); -extern int SPI_exec(const char *src, int tcount); + bool read_only, long tcount); +extern int SPI_exec(const char *src, long tcount); extern int SPI_execp(void *plan, Datum *Values, const char *Nulls, - int tcount); + long tcount); extern int SPI_execute_snapshot(void *plan, Datum *Values, const char *Nulls, Snapshot snapshot, Snapshot crosscheck_snapshot, - bool read_only, int tcount); + bool read_only, long tcount); extern void *SPI_prepare(const char *src, int nargs, Oid *argtypes); extern void *SPI_saveplan(void *plan); extern int SPI_freeplan(void *plan); @@ -123,8 +123,8 @@ extern void SPI_freetuptable(SPITupleTable *tuptable); extern Portal SPI_cursor_open(const char *name, void *plan, Datum *Values, const char *Nulls, bool read_only); extern Portal SPI_cursor_find(const char *name); -extern void SPI_cursor_fetch(Portal portal, bool forward, int count); -extern void SPI_cursor_move(Portal portal, bool forward, int count); +extern void SPI_cursor_fetch(Portal portal, bool forward, long count); +extern void SPI_cursor_move(Portal portal, bool forward, long count); extern void SPI_cursor_close(Portal portal); extern void AtEOXact_SPI(bool isCommit); diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 71ded9da05..1b42e8bd44 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.136 2005/05/01 18:56:19 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.137 2005/05/02 00:37:07 neilc Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -158,7 +158,7 @@ static Datum exec_eval_expr(PLpgSQL_execstate *estate, bool *isNull, Oid *rettype); static int exec_run_select(PLpgSQL_execstate *estate, - PLpgSQL_expr *expr, int maxtuples, Portal *portalP); + PLpgSQL_expr *expr, long maxtuples, Portal *portalP); static void exec_move_row(PLpgSQL_execstate *estate, PLpgSQL_rec *rec, PLpgSQL_row *row, @@ -3482,7 +3482,7 @@ exec_eval_expr(PLpgSQL_execstate *estate, */ static int exec_run_select(PLpgSQL_execstate *estate, - PLpgSQL_expr *expr, int maxtuples, Portal *portalP) + PLpgSQL_expr *expr, long maxtuples, Portal *portalP) { int i; Datum *values; diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 9fb4e114de..27310feda8 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.60 2005/03/29 00:17:24 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.61 2005/05/02 00:37:07 neilc Exp $ * ********************************************************************* */ @@ -1546,8 +1546,8 @@ static int PLy_result_ass_slice(PyObject *, int, int, PyObject *); static PyObject *PLy_spi_prepare(PyObject *, PyObject *); static PyObject *PLy_spi_execute(PyObject *, PyObject *); -static PyObject *PLy_spi_execute_query(char *query, int limit); -static PyObject *PLy_spi_execute_plan(PyObject *, PyObject *, int); +static PyObject *PLy_spi_execute_query(char *query, long limit); +static PyObject *PLy_spi_execute_plan(PyObject *, PyObject *, long); static PyObject *PLy_spi_execute_fetch_result(SPITupleTable *, int, int); @@ -1965,7 +1965,7 @@ PLy_spi_execute(PyObject * self, PyObject * args) char *query; PyObject *plan; PyObject *list = NULL; - int limit = 0; + long limit = 0; /* Can't execute more if we have an unhandled error */ if (PLy_error_in_progress) @@ -1974,12 +1974,12 @@ PLy_spi_execute(PyObject * self, PyObject * args) return NULL; } - if (PyArg_ParseTuple(args, "s|i", &query, &limit)) + if (PyArg_ParseTuple(args, "s|l", &query, &limit)) return PLy_spi_execute_query(query, limit); PyErr_Clear(); - if ((PyArg_ParseTuple(args, "O|Oi", &plan, &list, &limit)) && + if ((PyArg_ParseTuple(args, "O|Ol", &plan, &list, &limit)) && (is_PLyPlanObject(plan))) return PLy_spi_execute_plan(plan, list, limit); @@ -1988,7 +1988,7 @@ PLy_spi_execute(PyObject * self, PyObject * args) } static PyObject * -PLy_spi_execute_plan(PyObject * ob, PyObject * list, int limit) +PLy_spi_execute_plan(PyObject * ob, PyObject * list, long limit) { volatile int nargs; int i, @@ -2123,7 +2123,7 @@ PLy_spi_execute_plan(PyObject * ob, PyObject * list, int limit) } static PyObject * -PLy_spi_execute_query(char *query, int limit) +PLy_spi_execute_query(char *query, long limit) { int rv; MemoryContext oldcontext;