]> granicus.if.org Git - postgis/commitdiff
Add test for cached version of point_in_ring (#852)
authorSandro Santilli <strk@keybit.net>
Thu, 19 Jan 2012 09:48:57 +0000 (09:48 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 19 Jan 2012 09:48:57 +0000 (09:48 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8874 b70326c6-7e19-0410-871a-916f4a2858ee

regress/tickets.sql
regress/tickets_expected

index 03ce97fa06e0a3bb6867db18072b287a2300ce8d..40c38c9b33740e3f03667fa91f91273bf348b354 100644 (file)
@@ -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;
index 7adbab709c6cfb432eb60eb58a4b3d5a2cff90d6..da7dbff43cea0fd69bc64f689897710f01cf26d4 100644 (file)
@@ -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