aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-09-23 15:11:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-09-23 15:11:33 +0000
commit267924ead889ba0412b878043be23613b8abedab (patch)
treecc9a2ef66e822eb0e599298c402b8023b9133ec6 /src/backend/executor
parent5a5f0a6168d60c5c161634afc2309ce41ebdfbcd (diff)
downloadpostgresql-267924ead889ba0412b878043be23613b8abedab.tar.gz
postgresql-267924ead889ba0412b878043be23613b8abedab.zip
_SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call. Per gripe from Tomasz Myrta.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/spi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index aed70ee4bca..d2b07d484ac 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.104 2003/09/16 00:50:09 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.105 2003/09/23 15:11:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1270,7 +1270,8 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
elog(ERROR, "invalid portal in SPI cursor operation");
/* Push the SPI stack */
- _SPI_begin_call(true);
+ if (_SPI_begin_call(true) < 0)
+ elog(ERROR, "SPI cursor operation called while not connected");
/* Reset the SPI result */
SPI_processed = 0;
@@ -1320,8 +1321,7 @@ _SPI_procmem()
}
/*
- * _SPI_begin_call
- *
+ * _SPI_begin_call: begin a SPI operation within a connected procedure
*/
static int
_SPI_begin_call(bool execmem)
@@ -1338,6 +1338,11 @@ _SPI_begin_call(bool execmem)
return 0;
}
+/*
+ * _SPI_end_call: end a SPI operation within a connected procedure
+ *
+ * Note: this currently has no failure return cases, so callers don't check
+ */
static int
_SPI_end_call(bool procmem)
{