]> granicus.if.org Git - postgis/commitdiff
Be more explicit about the types we're passing around
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 20 Nov 2012 21:29:44 +0000 (21:29 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 20 Nov 2012 21:29:44 +0000 (21:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10722 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geometry_estimate.c
postgis/postgis.sql.in.c

index 7da85d8126fc68903def0edadf1c125f09b43cd7..c4070a040304cc9cd4d05ef288dfd23d7f8c1218 100644 (file)
@@ -617,8 +617,8 @@ Datum geometry_gist_read_selectivity(PG_FUNCTION_ARGS)
 {
        HeapTuple stats_tuple;
        float4 *floatptr;
-       int32 table_oid = PG_GETARG_INT32(0);
-       int32 attr_num = PG_GETARG_INT32(1);
+       Oid table_oid = PG_GETARG_INT32(0);
+       int16 attr_num = PG_GETARG_INT32(1);
        Datum geom_datum = PG_GETARG_DATUM(2);
        int rv;
        GBOX gbox;
@@ -630,7 +630,7 @@ Datum geometry_gist_read_selectivity(PG_FUNCTION_ARGS)
                elog(ERROR, "Unable to calculate search box from geometry");
        
        /* First pull the stats tuple */
-       stats_tuple = SearchSysCache2(STATRELATT, Int32GetDatum(table_oid), Int32GetDatum(attr_num));
+       stats_tuple = SearchSysCache2(STATRELATT, ObjectIdGetDatum(table_oid), Int16GetDatum(attr_num));
        if ( ! stats_tuple )
                elog(ERROR, "Unable to retreive stats tuple for oid(%d) attrnum(%d)", table_oid, attr_num);
                
index 664aeafb9bdd13a3cb8f716786adc51760b0fdcc..39c75bbe66fd3068a8137e5b613aeb6693a888c6 100644 (file)
@@ -429,7 +429,7 @@ CREATE OR REPLACE FUNCTION geometry_gist_joinsel_2d(internal, oid, internal, sma
        LANGUAGE 'c';
 
 -- Availability: 2.1.0
-CREATE OR REPLACE FUNCTION geometry_gist_read_selectivity(relid integer, attnum integer, geom geometry)
+CREATE OR REPLACE FUNCTION geometry_gist_read_selectivity(relid oid, attnum int2, geom geometry)
        RETURNS float8
        AS 'MODULE_PATHNAME', 'geometry_gist_read_selectivity'
        LANGUAGE 'c';
@@ -441,7 +441,7 @@ CREATE OR REPLACE FUNCTION geometry_gist_selectivity(schemaname varchar, tablena
          DECLARE
                selectivity float8;
          BEGIN
-               SELECT geometry_gist_read_selectivity(r.oid::integer, a.attnum::integer, 'SRID=4326;LINESTRING(0 0, 1 1)'::geometry)
+               SELECT geometry_gist_read_selectivity(r.oid, a.attnum, 'SRID=4326;LINESTRING(0 0, 1 1)'::geometry)
                INTO selectivity
                FROM pg_class r 
            JOIN pg_attribute a ON (r.oid = a.attrelid)