Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit267924e

Browse files
committed
_SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call. Per gripe from Tomasz Myrta.
1 parent5a5f0a6 commit267924e

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
staticint
13271327
_SPI_begin_call(boolexecmem)
@@ -1338,6 +1338,11 @@ _SPI_begin_call(bool execmem)
13381338
return0;
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
staticint
13421347
_SPI_end_call(boolprocmem)
13431348
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp