Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
HAWQ-1803. Fix sub-transcation rollback in SP
Browse files Browse the repository at this point in the history
  • Loading branch information
ztao1987 committed Aug 27, 2021
1 parent fac6938 commit b116d03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/executor/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid)
* If we are aborting a subtransaction and there is an open SPI context
* surrounding the subxact, clean up to prevent memory leakage.
*/
if (_SPI_current && !isCommit)
if (_SPI_current && !isCommit && _SPI_current->connectSubid >= mySubid)
{
/* free Executor memory the same as _SPI_end_call would do */
MemoryContextResetAndDeleteChildren(_SPI_current->execCxt);
Expand Down

0 comments on commit b116d03

Please sign in to comment.