From 37fb161ae9a88b4bd46d3c3d0609cc068ae57c0d Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 20 Nov 2012 21:29:44 +0000 Subject: [PATCH] Be more explicit about the types we're passing around git-svn-id: http://svn.osgeo.org/postgis/trunk@10722 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geometry_estimate.c | 6 +++--- postgis/postgis.sql.in.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/postgis/geometry_estimate.c b/postgis/geometry_estimate.c index 7da85d812..c4070a040 100644 --- a/postgis/geometry_estimate.c +++ b/postgis/geometry_estimate.c @@ -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); diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index 664aeafb9..39c75bbe6 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -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) -- 2.50.1