diff --git a/Makefile b/Makefile index 5b1c4e2..88c082b 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,11 @@ DATA_built = $(RELEASE_SQL) \ pg_sphere--1.2.2--1.2.3.sql \ pg_sphere--1.2.3--1.3.0.sql \ pg_sphere--1.3.0--1.3.1.sql \ - pg_sphere--1.3.1--1.4.0.sql + pg_sphere--1.3.1--1.4.0.sql \ + pg_sphere--1.4.0--1.4.1.sql \ DOCS = README.pg_sphere COPYRIGHT.pg_sphere -TESTS = tables points euler circle line ellipse poly path box \ +TESTS = version tables points euler circle line ellipse poly path box \ index contains_ops contains_ops_compat bounding_box_gist gnomo \ epochprop contains overlaps spoint_brin sbox_brin selectivity REGRESS = init $(TESTS) @@ -204,6 +205,9 @@ endif pg_sphere--1.3.1--1.4.0.sql: pgs_circle_sel.sql.in pgs_hash.sql.in cat upgrade_scripts/$@.in $^ > $@ +pg_sphere--1.4.0--1.4.1.sql: + cat upgrade_scripts/$@.in $^ > $@ + # end of local stuff src/sscan.o : src/sparse.c diff --git a/Makefile.common.mk b/Makefile.common.mk index aaaf096..42c2376 100644 --- a/Makefile.common.mk +++ b/Makefile.common.mk @@ -5,4 +5,4 @@ #---------------------------------------------------------------------------- EXTENSION := pg_sphere -PGSPHERE_VERSION := 1.4.0 +PGSPHERE_VERSION := 1.4.1 diff --git a/expected/init.out b/expected/init.out index e4dcdfd..374e2a3 100644 --- a/expected/init.out +++ b/expected/init.out @@ -1,11 +1,4 @@ -- --- first, define the datatype. Turn off echoing so that expected file --- does not depend on contents of pg_sphere.sql. +-- Initialize the extension. -- CREATE EXTENSION pg_sphere; -select pg_sphere_version(); - pg_sphere_version -------------------- - 1.4.0 -(1 row) - diff --git a/expected/version.out b/expected/version.out new file mode 100644 index 0000000..c05ab96 --- /dev/null +++ b/expected/version.out @@ -0,0 +1,7 @@ +-- Check current pgsphere version +SELECT pg_sphere_version(); + pg_sphere_version +------------------- + 1.4.1 +(1 row) + diff --git a/pg_sphere.control b/pg_sphere.control index 41ae5a7..fdf8f98 100644 --- a/pg_sphere.control +++ b/pg_sphere.control @@ -1,5 +1,5 @@ # pg_sphere extension comment = 'spherical objects with useful functions, operators and index support' -default_version = '1.4.0' +default_version = '1.4.1' module_pathname = '$libdir/pg_sphere' relocatable = true diff --git a/sql/init.sql b/sql/init.sql index 05b3516..374e2a3 100644 --- a/sql/init.sql +++ b/sql/init.sql @@ -1,7 +1,4 @@ -- --- first, define the datatype. Turn off echoing so that expected file --- does not depend on contents of pg_sphere.sql. +-- Initialize the extension. -- CREATE EXTENSION pg_sphere; - -select pg_sphere_version(); diff --git a/sql/version.sql b/sql/version.sql new file mode 100644 index 0000000..89f6266 --- /dev/null +++ b/sql/version.sql @@ -0,0 +1,3 @@ +-- Check current pgsphere version +SELECT pg_sphere_version(); + diff --git a/src/point.c b/src/point.c index f4df15c..26ae5f5 100644 --- a/src/point.c +++ b/src/point.c @@ -315,8 +315,8 @@ Datum spherepoint_hash32(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); - Datum h1 = DirectFunctionCall1(hashfloat8, p1->lat); - Datum h2 = DirectFunctionCall1(hashfloat8, p1->lng); + Datum h1 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lat)); + Datum h2 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lng)); PG_RETURN_INT32(DatumGetInt32(h1) ^ DatumGetInt32(h2)); } diff --git a/upgrade_scripts/pg_sphere--1.4.0--1.4.1.sql.in b/upgrade_scripts/pg_sphere--1.4.0--1.4.1.sql.in new file mode 100644 index 0000000..8ea3baa --- /dev/null +++ b/upgrade_scripts/pg_sphere--1.4.0--1.4.1.sql.in @@ -0,0 +1 @@ +-- Nothing to upgrade in the schema