8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.104 2003/09/16 00:50:09 tgl Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.105 2003/09/23 15:11:33 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -1270,7 +1270,8 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
1270
1270
elog (ERROR ,"invalid portal in SPI cursor operation" );
1271
1271
1272
1272
/* Push the SPI stack */
1273
- _SPI_begin_call (true);
1273
+ if (_SPI_begin_call (true)< 0 )
1274
+ elog (ERROR ,"SPI cursor operation called while not connected" );
1274
1275
1275
1276
/* Reset the SPI result */
1276
1277
SPI_processed = 0 ;
@@ -1320,8 +1321,7 @@ _SPI_procmem()
1320
1321
}
1321
1322
1322
1323
/*
1323
- * _SPI_begin_call
1324
- *
1324
+ * _SPI_begin_call: begin a SPI operation within a connected procedure
1325
1325
*/
1326
1326
static int
1327
1327
_SPI_begin_call (bool execmem )
@@ -1338,6 +1338,11 @@ _SPI_begin_call(bool execmem)
1338
1338
return 0 ;
1339
1339
}
1340
1340
1341
+ /*
1342
+ * _SPI_end_call: end a SPI operation within a connected procedure
1343
+ *
1344
+ * Note: this currently has no failure return cases, so callers don't check
1345
+ */
1341
1346
static int
1342
1347
_SPI_end_call (bool procmem )
1343
1348
{