File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -3545,7 +3545,6 @@ void SuspendTransaction(void)
3545
3545
MOVELEFT (sus -> CurTransactionContext , CurTransactionContext , NULL );
3546
3546
MOVELEFT (sus -> TransactionAbortContext , TransactionAbortContext , NULL );
3547
3547
3548
- MemoryContextSwitchTo (CurTransactionContext );
3549
3548
MOVELEFT (sus -> CurrentResourceOwner , CurrentResourceOwner , NULL );
3550
3549
MOVELEFT (sus -> CurTransactionResourceOwner , CurTransactionResourceOwner , NULL );
3551
3550
MOVELEFT (sus -> TopTransactionResourceOwner , TopTransactionResourceOwner , NULL );
@@ -3606,9 +3605,7 @@ bool ResumeTransaction(void)
3606
3605
CurTransactionContext = sus -> CurTransactionContext ;
3607
3606
TransactionAbortContext = sus -> TransactionAbortContext ;
3608
3607
3609
- //MemoryContextSwitchTo(CurTransactionContext);
3610
3608
CurrentResourceOwner = sus -> CurrentResourceOwner ;
3611
- Assert (* (unsigned long long * )CurrentResourceOwner != 0x7f7f7f7f7f7f7f7f );
3612
3609
CurTransactionResourceOwner = sus -> CurTransactionResourceOwner ;
3613
3610
TopTransactionResourceOwner = sus -> TopTransactionResourceOwner ;
3614
3611
Original file line number Diff line number Diff line change 21
21
#include "postgres.h"
22
22
23
23
#include "access/hash.h"
24
+ #include "access/xact.h"
24
25
#include "storage/predicate.h"
25
26
#include "storage/proc.h"
26
27
#include "utils/memutils.h"
@@ -555,7 +556,7 @@ ResourceOwnerReleaseInternal(ResourceOwner owner,
555
556
}
556
557
else if (phase == RESOURCE_RELEASE_LOCKS )
557
558
{
558
- if (isTopLevel )
559
+ if (isTopLevel && getNestLevelATX () == 0 )
559
560
{
560
561
/*
561
562
* For a top-level xact we are going to release all locks (or at
@@ -578,7 +579,7 @@ ResourceOwnerReleaseInternal(ResourceOwner owner,
578
579
LOCALLOCK * * locks ;
579
580
int nlocks ;
580
581
581
- Assert (owner -> parent != NULL );
582
+ // Assert(owner->parent != NULL);
582
583
583
584
/*
584
585
* Pass the list of locks owned by this resource owner to the lock
@@ -595,7 +596,7 @@ ResourceOwnerReleaseInternal(ResourceOwner owner,
595
596
nlocks = owner -> nlocks ;
596
597
}
597
598
598
- if (isCommit )
599
+ if (isCommit && ! isTopLevel )
599
600
LockReassignCurrentOwner (locks , nlocks );
600
601
else
601
602
LockReleaseCurrentOwner (locks , nlocks );
You can’t perform that action at this time.
0 commit comments