Skip to content

Commit

Permalink
Fix SPI clean up incase of errors for insert into execute with @table…
Browse files Browse the repository at this point in the history
…varible (#274)

Introduce functions to fetch SPI connected value (spi stack depth). 

Extension PR: babelfish-for-postgresql/babelfish_extensions#2183

Issues Resolved: BABEL-4360

Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 authored Jan 9, 2024
1 parent e00cbef commit 50fba00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/executor/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3432,3 +3432,9 @@ SPI_setCurrentInternalTxnMode(bool mode)
{
_SPI_current->internal_xact = mode;
}

int
SPI_get_depth(void)
{
return _SPI_connected;
}
1 change: 1 addition & 0 deletions src/include/executor/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,5 @@ extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
extern bool SPI_inside_nonatomic_context(void);

extern void SPI_setCurrentInternalTxnMode(bool mode);
extern int SPI_get_depth(void);
#endif /* SPI_H */

0 comments on commit 50fba00

Please sign in to comment.