Re-add SPICleanup for ABI compatibility in stable branch
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 18 Jul 2022 14:23:48 +0000 (16:23 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 18 Jul 2022 17:20:07 +0000 (19:20 +0200)
This fixes an ABI break introduced by
cfc86f987349372dbbfc0391f9f519c0a7b27b84.

Author: Markus Wanner <markus.wanner@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/defd749a-8410-841d-1126-21398686d63d@enterprisedb.com

src/backend/executor/spi.c
src/include/executor/spi.h

index 5f89a9a2aa1edf2b53b6e9d3e01baadb0c2789e1..f2b3b3df98a522f100e3a432a62da15a9209cfe1 100644 (file)
@@ -416,6 +416,16 @@ SPI_rollback_and_chain(void)
    _SPI_rollback(true);
 }
 
+/*
+ * SPICleanup is a no-op, kept for backwards compatibility. We rely on
+ * AtEOXact_SPI to cleanup. Extensions should not (need to) fiddle with the
+ * internal SPI state directly.
+ */
+void
+SPICleanup(void)
+{
+}
+
 /*
  * Clean up SPI state at transaction commit or abort.
  */
index 0bf9b0c26e9dafe791913557c65e38e40033401c..06de20ada5e4da8e95369956fd22beff99225a0c 100644 (file)
@@ -167,6 +167,7 @@ extern void SPI_commit_and_chain(void);
 extern void SPI_rollback(void);
 extern void SPI_rollback_and_chain(void);
 
+extern void SPICleanup(void);
 extern void AtEOXact_SPI(bool isCommit);
 extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
 extern bool SPI_inside_nonatomic_context(void);