diff options
author | Jan Wieck <JanWieck@Yahoo.com> | 1999-12-16 22:20:03 +0000 |
---|---|---|
committer | Jan Wieck <JanWieck@Yahoo.com> | 1999-12-16 22:20:03 +0000 |
commit | 397e9b32a3c2b2c72dcb9cb99cbf2a162aadcb73 (patch) | |
tree | 17583111e0e7c2ca83b94040d48a1036f870b9a4 /src/backend/executor/spi.c | |
parent | 5ca971a18a708341dd49f27c23fec40ea4342d13 (diff) |
Some changes to prepare for LONG attributes.
Jan
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index c0231ce317a..7c65c66814f 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -3,7 +3,7 @@ * spi.c * Server Programming Interface * - * $Id: spi.c,v 1.43 1999/12/10 03:55:51 momjian Exp $ + * $Id: spi.c,v 1.44 1999/12/16 22:19:44 wieck Exp $ * *------------------------------------------------------------------------- */ @@ -543,6 +543,26 @@ SPI_pfree(void *pointer) return; } +void +SPI_freetuple(HeapTuple tuple) +{ + MemoryContext oldcxt = NULL; + + if (_SPI_curid + 1 == _SPI_connected) /* connected */ + { + if (_SPI_current != &(_SPI_stack[_SPI_curid + 1])) + elog(FATAL, "SPI: stack corrupted"); + oldcxt = MemoryContextSwitchTo(_SPI_current->savedcxt); + } + + heap_freetuple(tuple); + + if (oldcxt) + MemoryContextSwitchTo(oldcxt); + + return; +} + /* =================== private functions =================== */ /* |