postgresql/contrib/pg_trgm
Tom Lane 9c852566a3 Fix comparison of similarity to threshold in GIST trigram searches.
There was some very strange code here, dating to commit b525bf77, that
purported to work around an ancient gcc bug by forcing a float4 comparison
to be done as int instead.  Commit 5871b8848 broke that when it changed
one side of the comparison to "double" but left the comparison code alone.
Commit f576b17cd doubled down on the weirdness by introducing a "volatile"
marker, which had nothing to do with the actual problem.

Guess that the gcc bug, even if it's still present in the wild, was
triggered by comparison of float4's and can be avoided if we store the
result of cnt_sml() into a double before comparing to the double "nlimit".
This will at least work correctly on non-broken compilers, and it's way
more readable.

Per bug #14202 from Greg Navis.  Add a regression test based on his
example.

Report: <20160620115321.5792.10766@wrigleys.postgresql.org>
2016-06-20 10:49:19 -04:00
..
data Add files forgotten in f576b17cd6 2016-03-16 19:23:41 +03:00
expected Fix comparison of similarity to threshold in GIST trigram searches. 2016-06-20 10:49:19 -04:00
sql Fix comparison of similarity to threshold in GIST trigram searches. 2016-06-20 10:49:19 -04:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Handle contrib's GIN/GIST support function signature changes honestly. 2016-06-09 16:44:25 -04:00
pg_trgm--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
pg_trgm--1.1--1.2.sql Add word_similarity to pg_trgm contrib module. 2016-03-16 18:59:21 +03:00
pg_trgm--1.2--1.3.sql Update extensions with GIN/GIST support for parallel query. 2016-06-14 13:34:37 -04:00
pg_trgm--1.3.sql Update extensions with GIN/GIST support for parallel query. 2016-06-14 13:34:37 -04:00
pg_trgm--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pg_trgm.control Handle contrib's GIN/GIST support function signature changes honestly. 2016-06-09 16:44:25 -04:00
trgm.h Add word_similarity to pg_trgm contrib module. 2016-03-16 18:59:21 +03:00
trgm_gin.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
trgm_gist.c Fix comparison of similarity to threshold in GIST trigram searches. 2016-06-20 10:49:19 -04:00
trgm_op.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
trgm_regexp.c Update copyright for 2016 2016-01-02 13:33:40 -05:00