diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2008-04-20 09:17:57 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2008-04-20 09:17:57 +0000 |
commit | be939544a68f852107c912da2f35f5d36958deb2 (patch) | |
tree | fa7c4b63eaf95171a405c37919f6d06ece3dbf2b /src/backend/utils/adt/tsquery_gist.c | |
parent | dc192a5d8c062c657ed1884872c80cf00cc61baf (diff) | |
download | postgresql-be939544a68f852107c912da2f35f5d36958deb2.tar.gz postgresql-be939544a68f852107c912da2f35f5d36958deb2.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/backend/utils/adt/tsquery_gist.c')
-rw-r--r-- | src/backend/utils/adt/tsquery_gist.c | 7 |
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 df813b59223..52ba7716fff 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.5 2008/04/14 17:05:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.6 2008/04/20 09:17:57 teodor Exp $ * *------------------------------------------------------------------------- */ @@ -106,8 +106,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 |