mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
Fix crash on NULL item in ND index (#1734)
Add regression testing for the case git-svn-id: http://svn.osgeo.org/postgis/trunk@9577 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
4756ab8789
commit
504c4ac404
|
@ -212,17 +212,17 @@ static float gidx_union_volume(GIDX *a, GIDX *b)
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
if ( gidx_is_unknown(a) && gidx_is_unknown(b) )
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if ( a == NULL || gidx_is_unknown(a) )
|
||||
return gidx_volume(b);
|
||||
|
||||
if ( b == NULL || gidx_is_unknown(b) )
|
||||
return gidx_volume(a);
|
||||
|
||||
if ( gidx_is_unknown(a) && gidx_is_unknown(b) )
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* Ensure 'a' has the most dimensions. */
|
||||
gidx_dimensionality_check(&a, &b);
|
||||
|
||||
|
|
|
@ -644,5 +644,15 @@ 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;
|
||||
|
||||
-- #1734 --
|
||||
create table eg (g geography);
|
||||
create index egi on eg using gist (g);
|
||||
INSERT INTO eg(g) VALUES (NULL);
|
||||
INSERT INTO eg (g) VALUES ('POINT(0 0)'::geography);
|
||||
INSERT INTO eg (g) select 'POINT(0 0)'::geography
|
||||
FROM generate_series(1,1024);
|
||||
SELECT '#1734.1', count(*) FROM eg;
|
||||
DROP table eg;
|
||||
|
||||
-- Clean up
|
||||
DELETE FROM spatial_ref_sys;
|
||||
|
|
|
@ -213,3 +213,4 @@ NOTICE: SRID value -1 converted to the officially unknown SRID value 0
|
|||
#1697.1|0
|
||||
#1697.2|0
|
||||
#1697.3|1024
|
||||
#1734.1|1026
|
||||
|
|
Loading…
Reference in a new issue