Skip to content

Commit

Permalink
BABEL: fix babelfish commit/rollback inside subtransaction post commi…
Browse files Browse the repository at this point in the history
…t 25d639ee

Signed-off-by: Tanzeel Khan <[email protected]>
(cherry picked from commit 831461774c33b0845df71e7473e51ca8dfe0019e)
(cherry picked from commit f11c2b9)
  • Loading branch information
tanscorpio7 authored and shardgupta committed Dec 11, 2024
1 parent e18d34a commit d0c5bcc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/backend/executor/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2442,8 +2442,15 @@ _SPI_execute_plan(SPIPlanPtr plan, const SPIExecuteOptions *options,
* not inside a subtransaction. The latter two tests match whether
* _SPI_commit() would allow a commit; see there for more commentary.
*/
allow_nonatomic = options->allow_nonatomic &&
!_SPI_current->atomic && !IsSubTransaction();
if (check_pltsql_support_tsql_transactions_hook && (*check_pltsql_support_tsql_transactions_hook)())
{
allow_nonatomic = options->allow_nonatomic && !_SPI_current->atomic;
}
else
{
allow_nonatomic = options->allow_nonatomic &&
!_SPI_current->atomic && !IsSubTransaction();
}

/*
* Setup error traceback support for ereport()
Expand Down

0 comments on commit d0c5bcc

Please sign in to comment.