aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2008-04-20 09:29:48 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2008-04-20 09:29:48 +0000
commit254d66e2f1b3d42f9afa0acebb04501c505ec5b6 (patch)
treec8b0445874b5a55fdcb0403d9933ffd99d947a66 /src
parent2101518516ff6bc2c21b7fb1323a409d09990014 (diff)
downloadpostgresql-254d66e2f1b3d42f9afa0acebb04501c505ec5b6.tar.gz
postgresql-254d66e2f1b3d42f9afa0acebb04501c505ec5b6.zip
Fix broken compare function for tsquery_ops. Per Tom's report.
I never understood why initial authors GiST in pgsql choose so stgrange signature for 'same' method: bool *sameFn(Datum a, Datum b, bool* result) instead of simple, logical bool sameFn(Datum a, Datum b) This change will break any existing GiST extension, so we still live with it and will live.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/tsquery_gist.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c
index fdefd92bae2..12b43c2c123 100644
--- a/src/backend/utils/adt/tsquery_gist.c
+++ b/src/backend/utils/adt/tsquery_gist.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.4 2008/01/01 19:45:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.4.2.1 2008/04/20 09:29:48 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -101,8 +101,11 @@ gtsquery_same(PG_FUNCTION_ARGS)
{
TSQuerySign *a = (TSQuerySign *) PG_GETARG_POINTER(0);
TSQuerySign *b = (TSQuerySign *) PG_GETARG_POINTER(1);
+ bool *result = (bool *) PG_GETARG_POINTER(2);
- PG_RETURN_POINTER(*a == *b);
+ *result = (*a == *b) ? true : false;
+
+ PG_RETURN_POINTER(result);
}
static int