Skip to content

Commit

Permalink
Check for interrupts in the oid generator loop.
Browse files Browse the repository at this point in the history
As this loop can take a significant amount of time to find a suitable oid in
some extreme case, it's important to make sure that the query is cancellable.
  • Loading branch information
rjuju committed Jan 22, 2021
1 parent 2bd376d commit 4b3d55d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hypopg.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "utils/lsyscache.h"
#endif
#include "executor/spi.h"
#include "miscadmin.h"
#include "utils/elog.h"

#include "include/hypopg.h"
Expand Down Expand Up @@ -229,6 +230,8 @@ hypo_getNewOid(Oid relid)

while(!OidIsValid(newoid))
{
CHECK_FOR_INTERRUPTS();

if (!OidIsValid(last_oid))
newoid = last_oid = min_fake_oid;
else
Expand Down

0 comments on commit 4b3d55d

Please sign in to comment.