Skip to content

Commit 9af9e20

Browse files
committed
Re-add SPICleanup for ABI compatibility in stable branch
This fixes an ABI break introduced by 293f5c5. Author: Markus Wanner <markus.wanner@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/defd749a-8410-841d-1126-21398686d63d@enterprisedb.com
1 parent 288e499 commit 9af9e20

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/backend/executor/spi.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ SPI_rollback_and_chain(void)
416416
_SPI_rollback(true);
417417
}
418418

419+
/*
420+
* SPICleanup is a no-op, kept for backwards compatibility. We rely on
421+
* AtEOXact_SPI to cleanup. Extensions should not (need to) fiddle with the
422+
* internal SPI state directly.
423+
*/
424+
void
425+
SPICleanup(void)
426+
{
427+
}
428+
419429
/*
420430
* Clean up SPI state at transaction commit or abort.
421431
*/

src/include/executor/spi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extern void SPI_commit_and_chain(void);
164164
extern void SPI_rollback(void);
165165
extern void SPI_rollback_and_chain(void);
166166

167+
extern void SPICleanup(void);
167168
extern void AtEOXact_SPI(bool isCommit);
168169
extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
169170
extern bool SPI_inside_nonatomic_context(void);

0 commit comments

Comments
 (0)