summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/pg_trgm/trgm_op.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c
index 49b3609de93..c140fcdbbe8 100644
--- a/contrib/pg_trgm/trgm_op.c
+++ b/contrib/pg_trgm/trgm_op.c
@@ -7,6 +7,7 @@
#include "catalog/pg_type.h"
#include "lib/qunique.h"
+#include "miscadmin.h"
#include "trgm.h"
#include "tsearch/ts_locale.h"
#include "utils/lsyscache.h"
@@ -492,8 +493,12 @@ iterate_word_similarity(int *trg2indexes,
for (i = 0; i < len2; i++)
{
+ int trgindex;
+
+ CHECK_FOR_INTERRUPTS();
+
/* Get index of next trigram */
- int trgindex = trg2indexes[i];
+ trgindex = trg2indexes[i];
/* Update last position of this trigram */
if (lower >= 0 || found[trgindex])