From: Alvaro Herrera Date: Mon, 14 Dec 2015 19:44:40 +0000 (-0300) Subject: Add missing CHECK_FOR_INTERRUPTS in lseg_inside_poly X-Git-Tag: REL9_4_6~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9a46f8ba667556b7a9b34c8c36f5d465f3fc7a2;p=postgresql Add missing CHECK_FOR_INTERRUPTS in lseg_inside_poly Apparently, there are bugs in this code that cause it to loop endlessly. That bug still needs more research, but in the meantime it's clear that the loop is missing a check for interrupts so that it can be cancelled timely. Backpatch to 9.1 -- this has been missing since 49475aab8d0d. --- diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 6ef420d310..77871b10ff 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -20,6 +20,7 @@ #include #include "libpq/pqformat.h" +#include "miscadmin.h" #include "utils/builtins.h" #include "utils/geo_decls.h" @@ -3894,6 +3895,8 @@ lseg_inside_poly(Point *a, Point *b, POLYGON *poly, int start) { Point *interpt; + CHECK_FOR_INTERRUPTS(); + s.p[1] = poly->p[i]; if (on_ps_internal(t.p, &s))