summaryrefslogtreecommitdiff
path: root/contrib/pg_trgm/trgm_gist.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2016-03-16 17:44:58 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2016-03-16 17:44:58 +0300
commit5871b88487cfd07966e2ce08609a4d6d5ee9718e (patch)
tree98a15fc57482f770d710cd3e73894606c1879c66 /contrib/pg_trgm/trgm_gist.c
parentf9e5ed61ed1e27390051e8eb10bd9ec4cb40d7b2 (diff)
GUC variable pg_trgm.similarity_threshold insead of set_limit()
Use GUC variable pg_trgm.similarity_threshold insead of set_limit()/show_limit() which was introduced when defining GUC varuables by modules was absent. Author: Artur Zakirov
Diffstat (limited to 'contrib/pg_trgm/trgm_gist.c')
-rw-r--r--contrib/pg_trgm/trgm_gist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c
index 07d1dc308bb..cbd89586cda 100644
--- a/contrib/pg_trgm/trgm_gist.c
+++ b/contrib/pg_trgm/trgm_gist.c
@@ -294,7 +294,8 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
float4 tmpsml = cnt_sml(key, qtrg);
/* strange bug at freebsd 5.2.1 and gcc 3.3.3 */
- res = (*(int *) &tmpsml == *(int *) &trgm_limit || tmpsml > trgm_limit) ? true : false;
+ res = (*(int *) &tmpsml == *(int *) &similarity_threshold
+ || tmpsml > similarity_threshold) ? true : false;
}
else if (ISALLTRUE(key))
{ /* non-leaf contains signature */
@@ -308,7 +309,8 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
if (len == 0)
res = false;
else
- res = (((((float8) count) / ((float8) len))) >= trgm_limit) ? true : false;
+ res = (((((float8) count) / ((float8) len))) >= similarity_threshold)
+ ? true : false;
}
break;
case ILikeStrategyNumber: