]> granicus.if.org Git - postgis/commitdiff
Add regression test for GiST index crash on empty (#1697)
authorSandro Santilli <strk@keybit.net>
Wed, 28 Mar 2012 09:19:22 +0000 (09:19 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 28 Mar 2012 09:19:22 +0000 (09:19 +0000)
Also tests you can query all empty items from an index

git-svn-id: http://svn.osgeo.org/postgis/trunk@9567 b70326c6-7e19-0410-871a-916f4a2858ee

regress/tickets.sql
regress/tickets_expected

index 5eac147fc74b8f49405e0425edce7865181f26db..fffa365249117f97ae599fed2bf949438c931467 100644 (file)
@@ -631,5 +631,18 @@ WITH inp AS ( SELECT
 -- #1695
 SELECT '#1695', ST_AsEWKT(ST_SnapToGrid('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))'::geometry, 20));
 
+-- #1697 --
+CREATE TABLE eg(g geography, gm geometry);
+CREATE INDEX egi on eg using gist (g);
+CREATE INDEX egind on eg using gist (gm gist_geometry_ops_nd);
+INSERT INTO eg (g, gm)
+ select 'POINT EMPTY'::geography,
+        'POINT EMPTY'::geometry
+ from generate_series(1,1024);
+SELECT '#1697.1', count(*) FROM eg WHERE g && 'POINT(0 0)'::geography;
+SELECT '#1697.2', count(*) FROM eg WHERE gm && 'POINT(0 0)'::geometry;
+SELECT '#1697.3', count(*) FROM eg WHERE gm ~= 'POINT EMPTY'::geometry;
+DROP TABLE eg;
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
index 7a5d15c6a893c878643c45d1d9d8c16efbe82e7c..07ee581babb43d216f8e251ed09fff4b9afb22e6 100644 (file)
@@ -210,3 +210,6 @@ NOTICE:  SRID value -1 converted to the officially unknown SRID value 0
 #1596.7|0
 #1596|Point[BG]
 #1695|MULTIPOLYGON EMPTY
+#1697.1|0
+#1697.2|0
+#1697.3|1024