Check for interrupts in the oid generator loop.

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.
This commit is contained in:
Julien Rouhaud 2021-01-22 20:48:32 +08:00
parent 2bd376d6bd
commit 4b3d55df85

View file

@ -24,6 +24,7 @@
#include "utils/lsyscache.h"
#endif
#include "executor/spi.h"
#include "miscadmin.h"
#include "utils/elog.h"
#include "include/hypopg.h"
@ -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