]> granicus.if.org Git - postgresql/commitdiff
Add missing CHECK_FOR_INTERRUPTS in lseg_inside_poly
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 14 Dec 2015 19:44:40 +0000 (16:44 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 14 Dec 2015 19:44:40 +0000 (16:44 -0300)
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.

src/backend/utils/adt/geo_ops.c

index ca03947bc83b35c50ee751e2ed71d8760e4d4a9c..f7fe27a4fb31bff8bb6c9bc3b4f892e0b193eec6 100644 (file)
@@ -20,6 +20,7 @@
 #include <ctype.h>
 
 #include "libpq/pqformat.h"
+#include "miscadmin.h"
 #include "utils/builtins.h"
 #include "utils/geo_decls.h"
 
@@ -3927,6 +3928,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))