From 2205ea6887b83c3c4cb797e9ca2d4c38bf959926 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 15 Jun 2005 16:04:11 +0000 Subject: [PATCH] fault tolerant btree ops git-svn-id: http://svn.osgeo.org/postgis/trunk@1761 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_btree.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/lwgeom/lwgeom_btree.c b/lwgeom/lwgeom_btree.c index 70598fae7..ae6fe73ca 100644 --- a/lwgeom/lwgeom_btree.c +++ b/lwgeom/lwgeom_btree.c @@ -29,6 +29,16 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS); //#define PGIS_DEBUG +#if USE_VERSION == 72 +#define BTREE_SRID_MISMATCH_SEVERITY NOTICE +#else +#if USE_VERSION < 80 +#define BTREE_SRID_MISMATCH_SEVERITY WARNING +#else +#define BTREE_SRID_MISMATCH_SEVERITY ERROR +#endif +#endif + PG_FUNCTION_INFO_V1(lwgeom_lt); Datum lwgeom_lt(PG_FUNCTION_ARGS) { @@ -43,7 +53,7 @@ Datum lwgeom_lt(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -100,7 +110,7 @@ Datum lwgeom_le(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -180,7 +190,7 @@ Datum lwgeom_eq(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -240,7 +250,7 @@ Datum lwgeom_ge(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -312,7 +322,7 @@ Datum lwgeom_gt(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -380,7 +390,7 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS) if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2)) { - elog(ERROR, + elog(BTREE_SRID_MISMATCH_SEVERITY, "Operation on two GEOMETRIES with different SRIDs\n"); if ( (Pointer *)PG_GETARG_DATUM(0) != (Pointer *)geom1 ) pfree(geom1); @@ -449,6 +459,9 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS) /*********************************************************** * * $Log$ + * Revision 1.8 2005/06/15 16:04:11 strk + * fault tolerant btree ops + * * Revision 1.7 2005/02/07 13:21:10 strk * Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG * -- 2.50.1