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

Commit566480a

Browse files
committed
Avoid double free of _SPI_current->tuptable. AtEOSubXact_SPI() now tries to
release it in a subtransaction abort, but this neglects possibility thatsomeone outside SPI already did. Fix is for spi.c to forget about a tuptableas soon as it's handed it back to the caller.Per bug #2817 from Michael Andreen.
1 parent8124215 commit566480a

File tree

1 file changed

+7
-1
lines changed
  • src/backend/executor

1 file changed

+7
-1
lines changed

‎src/backend/executor/spi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.165 2006/11/21 22:35:29 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.166 2006/12/08 00:40:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1543,6 +1543,9 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
15431543
SPI_lastoid=my_lastoid;
15441544
SPI_tuptable=my_tuptable;
15451545

1546+
/* tuptable now is caller's responsibility, not SPI's */
1547+
_SPI_current->tuptable=NULL;
1548+
15461549
returnmy_res;
15471550
}
15481551

@@ -1695,6 +1698,9 @@ _SPI_cursor_operation(Portal portal, bool forward, long count,
16951698
SPI_processed=_SPI_current->processed;
16961699
SPI_tuptable=_SPI_current->tuptable;
16971700

1701+
/* tuptable now is caller's responsibility, not SPI's */
1702+
_SPI_current->tuptable=NULL;
1703+
16981704
/* Pop the SPI stack */
16991705
_SPI_end_call(true);
17001706
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp