diff options
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index a7358425b47..7ca2a6c21e5 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -3,25 +3,16 @@ * spi.c-- * Server Programming Interface * - * $Id: spi.c,v 1.31 1999/01/27 00:36:21 tgl Exp $ + * $Id: spi.c,v 1.32 1999/01/27 16:15:20 wieck Exp $ * *------------------------------------------------------------------------- */ #include "executor/spi.h" +#include "executor/spi_priv.h" #include "catalog/pg_type.h" #include "access/printtup.h" #include "fmgr.h" -typedef struct -{ - QueryTreeList *qtlist; /* malloced */ - uint32 processed; /* by Executor */ - SPITupleTable *tuptable; - Portal portal; /* portal per procedure */ - MemoryContext savedcxt; - CommandId savedId; -} _SPI_connection; - static Portal _SPI_portal = (Portal) NULL; static _SPI_connection *_SPI_stack = NULL; static _SPI_connection *_SPI_current = NULL; @@ -32,24 +23,12 @@ uint32 SPI_processed = 0; SPITupleTable *SPI_tuptable; int SPI_result; -typedef struct -{ - QueryTreeList *qtlist; - List *ptlist; - int nargs; - Oid *argtypes; -} _SPI_plan; - static int _SPI_execute(char *src, int tcount, _SPI_plan *plan); static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount); static int _SPI_execute_plan(_SPI_plan *plan, Datum *Values, char *Nulls, int tcount); -#define _SPI_CPLAN_CURCXT 0 -#define _SPI_CPLAN_PROCXT 1 -#define _SPI_CPLAN_TOPCXT 2 - static _SPI_plan *_SPI_copy_plan(_SPI_plan *plan, int location); static int _SPI_begin_call(bool execmem); @@ -178,6 +157,18 @@ SPI_finish() } +void +SPI_push(void) +{ + _SPI_curid++; +} + +void +SPI_pop(void) +{ + _SPI_curid--; +} + int SPI_exec(char *src, int tcount) { |