]> granicus.if.org Git - postgresql/commitdiff
Fix broken compare function for tsquery_ops. Per Tom's report.
authorTeodor Sigaev <teodor@sigaev.ru>
Sun, 20 Apr 2008 09:39:38 +0000 (09:39 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Sun, 20 Apr 2008 09:39:38 +0000 (09:39 +0000)
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.

contrib/tsearch2/query_gist.c

index aafb6901092475404329bb6cfae01a5ccffbcb8f..b49178aa835a25d3fbd83332b9c47e6bc8b5276f 100644 (file)
@@ -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