Skip to content

Commit 267924e

Browse files
committed
_SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call. Per gripe from Tomasz Myrta.
1 parent 5a5f0a6 commit 267924e

File tree

1 file changed

+9
-4
lines changed
  • src/backend/executor

1 file changed

+9
-4
lines changed

src/backend/executor/spi.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* 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 $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1270,7 +1270,8 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
12701270
elog(ERROR, "invalid portal in SPI cursor operation");
12711271

12721272
/* 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");
12741275

12751276
/* Reset the SPI result */
12761277
SPI_processed = 0;
@@ -1320,8 +1321,7 @@ _SPI_procmem()
13201321
}
13211322

13221323
/*
1323-
* _SPI_begin_call
1324-
*
1324+
* _SPI_begin_call: begin a SPI operation within a connected procedure
13251325
*/
13261326
static int
13271327
_SPI_begin_call(bool execmem)
@@ -1338,6 +1338,11 @@ _SPI_begin_call(bool execmem)
13381338
return 0;
13391339
}
13401340

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+
*/
13411346
static int
13421347
_SPI_end_call(bool procmem)
13431348
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy