summaryrefslogtreecommitdiff
path: root/contrib/pg_trgm/trgm_gist.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_trgm/trgm_gist.c')
-rw-r--r--contrib/pg_trgm/trgm_gist.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c
index 4286928d348..9cf88dc45bd 100644
--- a/contrib/pg_trgm/trgm_gist.c
+++ b/contrib/pg_trgm/trgm_gist.c
@@ -159,12 +159,19 @@ gtrgm_decompress(PG_FUNCTION_ARGS)
Datum
gtrgm_consistent(PG_FUNCTION_ARGS)
{
- text *query = (text *) PG_GETARG_TEXT_P(1);
- TRGM *key = (TRGM *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
+ GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
+ text *query = PG_GETARG_TEXT_P(1);
+ /* StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); */
+ /* Oid subtype = PG_GETARG_OID(3); */
+ bool *recheck = (bool *) PG_GETARG_POINTER(4);
+ TRGM *key = (TRGM *) DatumGetPointer(entry->key);
TRGM *qtrg = generate_trgm(VARDATA(query), VARSIZE(query) - VARHDRSZ);
- int res = false;
+ bool res = false;
+
+ /* All cases served by this function are exact */
+ *recheck = false;
- if (GIST_LEAF((GISTENTRY *) PG_GETARG_POINTER(0)))
+ if (GIST_LEAF(entry))
{ /* all leafs contains orig trgm */
float4 tmpsml = cnt_sml(key, qtrg);