File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -900,6 +900,8 @@ remove_variable(PG_FUNCTION_ARGS)
900900 }
901901 GetActualState (variable )-> is_valid = false;
902902 numOfTransVars (package )-- ;
903+ if ((numOfTransVars (package ) + numOfRegVars (package )) == 0 )
904+ GetActualState (package )-> is_valid = false;
903905 }
904906 else
905907 removeObject (& variable -> transObject , TRANS_VARIABLE );
@@ -1380,9 +1382,11 @@ getPackage(text *name, bool strict)
13801382 {
13811383 package = (Package * ) hash_search (packagesHash , key , HASH_FIND , & found );
13821384
1383- if (found && GetActualState (package )-> is_valid &&
1384- numOfTransVars (package ) + numOfRegVars (package ))
1385+ if (found && GetActualState (package )-> is_valid )
1386+ {
1387+ Assert (numOfTransVars (package ) + numOfRegVars (package ) > 0 );
13851388 return package ;
1389+ }
13861390 }
13871391 /* Package not found or it's current state is "invalid" */
13881392 if (strict )
@@ -1778,7 +1782,7 @@ rollbackSavepoint(TransObject *object, TransObjectType type)
17781782
17791783 if (dlist_is_empty (& object -> states ))
17801784 {
1781- if (type == TRANS_PACKAGE && numOfRegVars ((Package * )object ))
1785+ if (type == TRANS_PACKAGE && numOfRegVars ((Package * )object ) > 0 )
17821786 {
17831787 initObjectHistory (object , type );
17841788 GetActualState (object )-> level = GetCurrentTransactionNestLevel () - 1 ;
You can’t perform that action at this time.
0 commit comments