From: Sandro Santilli Date: Thu, 19 Jan 2012 09:48:57 +0000 (+0000) Subject: Add test for cached version of point_in_ring (#852) X-Git-Tag: 2.0.0alpha1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aafbcf5eb3e5acda72933376c43c4c918b869a74;p=postgis Add test for cached version of point_in_ring (#852) git-svn-id: http://svn.osgeo.org/postgis/trunk@8874 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/regress/tickets.sql b/regress/tickets.sql index 03ce97fa0..40c38c9b3 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -536,13 +536,20 @@ SELECT '#1450', GeometryType('POINT(0 0)'::geography), GeometryType('POLYGON EMP select '#1482', ST_Srid('POINT(0 0)'::geography(point, 0)::geometry); -- #852 -select '#852', - st_intersects('POINT(0.5 0.5000000000001)'::geometry, 'POLYGON((0 0, 10 10, 1 0, 0 0))'::geometry), - st_intersects('POINT(0.6 0.6000000000001)'::geometry, 'POLYGON((0 0, 10 10, 1 0, 0 0))'::geometry), - st_intersects('POINT(0.5 0.500000000001)'::geometry, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry), - st_intersects('POINT(0.6 0.600000000001)'::geometry, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry), - st_intersects('POINT(0.600000000001 0.600000000001)'::geometry, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry), - st_intersects('POINT(0.5 0.5)'::geometry, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry); +CREATE TABLE cacheable (id int, g geometry); +COPY cacheable FROM STDIN; +1 POINT(0.5 0.5000000000001) +2 POINT(0.5 0.5000000000001) +\. +select '#852.1', id, -- first run is not cached, consequent are cached + st_intersects(g, 'POLYGON((0 0, 10 10, 1 0, 0 0))'::geometry), + st_intersects(g, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry) from cacheable; +UPDATE cacheable SET g = 'POINT(0.5 0.5)'; +-- New select, new cache +select '#852.2', id, -- first run is not cached, consequent are cached + st_intersects(g, 'POLYGON((0 0, 10 10, 1 0, 0 0))'::geometry), + st_intersects(g, 'POLYGON((0 0, 1 1, 1 0, 0 0))'::geometry) from cacheable; +DROP TABLE cacheable; -- Clean up DELETE FROM spatial_ref_sys; diff --git a/regress/tickets_expected b/regress/tickets_expected index 7adbab709..da7dbff43 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -179,4 +179,7 @@ ERROR: MultiSurface cannot contain MultiPoint element #745|GEOMETRYCOLLECTION(POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1))) #1450|POINT|POLYGON #1482|4326 -#852|f|f|f|f|t|t +#852.1|1|f|f +#852.1|2|f|f +#852.2|1|t|t +#852.2|2|t|t