Skip to content

Commit be93954

Browse files
committed
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.
1 parent dc192a5 commit be93954

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/adt/tsquery_gist.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.5 2008/04/14 17:05:33 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.6 2008/04/20 09:17:57 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -106,8 +106,11 @@ gtsquery_same(PG_FUNCTION_ARGS)
106106
{
107107
TSQuerySign *a = (TSQuerySign *) PG_GETARG_POINTER(0);
108108
TSQuerySign *b = (TSQuerySign *) PG_GETARG_POINTER(1);
109+
bool *result = (bool *) PG_GETARG_POINTER(2);
109110

110-
PG_RETURN_POINTER(*a == *b);
111+
*result = (*a == *b) ? true : false;
112+
113+
PG_RETURN_POINTER(result);
111114
}
112115

113116
static int

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy