diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2008-04-20 09:39:38 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2008-04-20 09:39:38 +0000 |
commit | fc0a2b45d030f6aac942df3fcdde17d6d087cd93 (patch) | |
tree | 033857193b96dc2f8cbd183caec234a8ef96e9b8 /contrib/tsearch2/query_gist.c | |
parent | ce646d719246f03930da97bddf0065d868e1a02b (diff) | |
download | postgresql-fc0a2b45d030f6aac942df3fcdde17d6d087cd93.tar.gz postgresql-fc0a2b45d030f6aac942df3fcdde17d6d087cd93.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 'contrib/tsearch2/query_gist.c')
-rw-r--r-- | contrib/tsearch2/query_gist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/tsearch2/query_gist.c b/contrib/tsearch2/query_gist.c index aafb6901092..b49178aa835 100644 --- a/contrib/tsearch2/query_gist.c +++ b/contrib/tsearch2/query_gist.c @@ -231,8 +231,11 @@ gtsq_same(PG_FUNCTION_ARGS) { TPQTGist *a = (TPQTGist *) PG_GETARG_POINTER(0); TPQTGist *b = (TPQTGist *) 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 |