[postgis-tickets] [PostGIS] #4433: Regress Error on Bessie/Winnie 32-bit tickets full join test

PostGIS trac at osgeo.org
Mon Jul 1 07:54:59 PDT 2019


#4433: Regress Error on Bessie/Winnie 32-bit tickets full join test
----------------------+---------------------------
  Reporter:  robe     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  blocker  |  Milestone:  PostGIS 3.0.0
 Component:  postgis  |    Version:  trunk
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by Algunenano):

 I see an issue with integer conversion around the hash functions:

 The SQL function declares receiving an integer (32bits signed, according
 to the docs):
 {{{

 -- Availability: 2.5.0
 CREATE OR REPLACE FUNCTION geometry_hash(geometry)
         RETURNS integer
         AS 'MODULE_PATHNAME','lwgeom_hash'
         LANGUAGE 'c' STRICT IMMUTABLE _PARALLEL;

 -- Availability: 2.5.0
 CREATE OPERATOR CLASS hash_geometry_ops
         DEFAULT FOR TYPE geometry USING hash AS
     OPERATOR    1   = ,
     FUNCTION    1   geometry_hash(geometry);
 }}}


 The C function returns an Int64GetDatum, which is converted directly from
 an uint64_t:
 {{{
 PG_FUNCTION_INFO_V1(lwgeom_hash);
 Datum lwgeom_hash(PG_FUNCTION_ARGS)
 {
         GSERIALIZED *g1 = PG_GETARG_GSERIALIZED_P(0);
         uint64_t hval = gserialized_hash(g1);
         PG_FREE_IF_COPY(g1, 0);
         PG_RETURN_DATUM(Int64GetDatum(hval));
 }
 }}}

 So the output of gserialized_hash is doing uint64 -> int64 -> int32, which
 could be an issue.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4433#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list