postgres.git / summary / log / commit / refs

commit    48a7074a278656a786e082f13575ac223e1cdd56
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Mon Dec 14 19:44:40 2015 +0000
First released in: 9.6.0, 9.1.20, 9.2.15, 9.3.11, 9.4.6, 9.5.0

    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.


src/backend/utils/adt/geo_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 7ebcaaa0742..9bf11cbbcf0 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -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)) [parent: 1e23caae30f5]