From bab88c82e39a3972d80f044b63e19eadbacc9db3 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 30 Nov 2005 16:58:14 +0000 Subject: [PATCH] Back-ported support for PGSQL8.2 git-svn-id: http://svn.osgeo.org/postgis/branches/pgis_1_0@2102 b70326c6-7e19-0410-871a-916f4a2858ee --- CHANGES | 1 + lwgeom/lwgeom_box2dfloat4.c | 1 - lwgeom/lwgeom_chip.c | 1 - lwgeom/lwgeom_functions_basic.c | 7 +++++-- lwgeom/lwgeom_gist.c | 2 +- lwgeom/lwgeom_inout.c | 1 - lwgeom/lwgeom_ogc.c | 1 - lwgeom/lwgeom_pg.h | 4 ++++ lwgeom/lwgeom_spheroid.c | 1 - 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 324716922..caa865541 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ PostGIS 1.0.6CVS problem with --enable-cassert) - Fixed bbox cache handling bugs - Fixed geom_accum(NULL, NULL) segfault + - Initial support for postgresql 8.2 PostGIS 1.0.5 2005/11/25 diff --git a/lwgeom/lwgeom_box2dfloat4.c b/lwgeom/lwgeom_box2dfloat4.c index 7e8c44955..a1077f1ba 100644 --- a/lwgeom/lwgeom_box2dfloat4.c +++ b/lwgeom/lwgeom_box2dfloat4.c @@ -7,7 +7,6 @@ #include "postgres.h" #include "access/gist.h" #include "access/itup.h" -#include "access/rtree.h" #include "fmgr.h" #include "utils/elog.h" #include "utils/geo_decls.h" diff --git a/lwgeom/lwgeom_chip.c b/lwgeom/lwgeom_chip.c index b540a0d57..3f1baceaa 100644 --- a/lwgeom/lwgeom_chip.c +++ b/lwgeom/lwgeom_chip.c @@ -7,7 +7,6 @@ #include "postgres.h" #include "access/gist.h" #include "access/itup.h" -#include "access/rtree.h" #include "fmgr.h" #include "utils/elog.h" diff --git a/lwgeom/lwgeom_functions_basic.c b/lwgeom/lwgeom_functions_basic.c index 8fb3920b2..917477c15 100644 --- a/lwgeom/lwgeom_functions_basic.c +++ b/lwgeom/lwgeom_functions_basic.c @@ -1805,7 +1805,7 @@ Datum LWGEOM_accum(PG_FUNCTION_ARGS) */ ++nelems; if ( nelems == 1 || ! array ) { - nbytes = ARR_OVERHEAD(1)+INTALIGN(geom->size); + nbytes = ARR_OVERHEAD_NONULLS(1)+INTALIGN(geom->size); #ifdef PGIS_DEBUG elog(NOTICE, "geom_accum: adding %p (nelems=%d; nbytes=%d)", geom, nelems, nbytes); @@ -1822,6 +1822,9 @@ Datum LWGEOM_accum(PG_FUNCTION_ARGS) #if USE_VERSION > 72 result->elemtype = oid; +#endif +#if USE_VERSION > 81 + result->dataoffset = 0; #endif memcpy(ARR_DIMS(result), &nelems, sizeof(int)); memcpy(ARR_LBOUND(result), &lbs, sizeof(int)); @@ -1912,7 +1915,7 @@ Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS) #ifdef PGIS_DEBUG elog(NOTICE, " array is %d-bytes in size, %d w/out header", - array->size, array->size-ARR_OVERHEAD(ARR_NDIM(array))); + array->size, array->size-ARR_OVERHEAD_NONULLS(ARR_NDIM(array))); #endif diff --git a/lwgeom/lwgeom_gist.c b/lwgeom/lwgeom_gist.c index a09b4935f..902aba0e7 100644 --- a/lwgeom/lwgeom_gist.c +++ b/lwgeom/lwgeom_gist.c @@ -8,7 +8,7 @@ #include "access/gist.h" #include "access/itup.h" #if USE_VERSION > 80 -#include "access/rtree.h" +#include "access/skey.h" #endif #include "fmgr.h" #include "utils/elog.h" diff --git a/lwgeom/lwgeom_inout.c b/lwgeom/lwgeom_inout.c index f218d5d66..5d2e0f99a 100644 --- a/lwgeom/lwgeom_inout.c +++ b/lwgeom/lwgeom_inout.c @@ -10,7 +10,6 @@ #include "access/gist.h" #include "access/itup.h" -#include "access/rtree.h" #include "fmgr.h" #include "utils/elog.h" diff --git a/lwgeom/lwgeom_ogc.c b/lwgeom/lwgeom_ogc.c index b3cb5a8bb..bb676b279 100644 --- a/lwgeom/lwgeom_ogc.c +++ b/lwgeom/lwgeom_ogc.c @@ -8,7 +8,6 @@ #include "access/gist.h" #include "access/itup.h" -#include "access/rtree.h" #include "fmgr.h" #include "utils/elog.h" diff --git a/lwgeom/lwgeom_pg.h b/lwgeom/lwgeom_pg.h index 6999f0190..46e54eab7 100644 --- a/lwgeom/lwgeom_pg.h +++ b/lwgeom/lwgeom_pg.h @@ -11,6 +11,10 @@ #define PG_NARGS() (fcinfo->nargs) #endif +#if USE_VERSION < 82 +#define ARR_OVERHEAD_NONULLS(x) ARR_OVERHEAD((x)) +#endif + void *pg_alloc(size_t size); void *pg_realloc(void *ptr, size_t size); void pg_free(void *ptr); diff --git a/lwgeom/lwgeom_spheroid.c b/lwgeom/lwgeom_spheroid.c index d3dda2af4..57e90bb33 100644 --- a/lwgeom/lwgeom_spheroid.c +++ b/lwgeom/lwgeom_spheroid.c @@ -21,7 +21,6 @@ #include "access/gist.h" #include "access/itup.h" -#include "access/rtree.h" #include "fmgr.h" -- 2.40.0