From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: In the Snowball dictionary, don't try to stem excessively-long w |
Date: | 2022-08-31 14:42:21 |
Message-ID: | E1oTOv7-000llJ-1A@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
In the Snowball dictionary, don't try to stem excessively-long words.
If the input word exceeds 1000 bytes, don't pass it to the stemmer;
just return it as-is after case folding. Such an input is surely
not a word in any human language, so whatever the stemmer might
do to it would be pretty dubious in the first place. Adding this
restriction protects us against a known recursion-to-stack-overflow
problem in the Turkish stemmer, and it seems like good insurance
against any other safety or performance issues that may exist in
the Snowball stemmers. (I note, for example, that they contain no
CHECK_FOR_INTERRUPTS calls, so we really don't want them running
for a long time.) The threshold of 1000 bytes is arbitrary.
An alternative definition could have been to treat such words as
stopwords, but that seems like a bigger break from the old behavior.
Per report from Egor Chindyaskin and Alexander Lakhin.
Thanks to Olly Betts for the recommendation to fix it this way.
Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f5aa855cd8a63cd695c5f9ff097c7bc445872cdf
Modified Files
--------------
src/backend/snowball/dict_snowball.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2022-08-31 16:42:27 | pgsql: Fix MSVC warning in compat_informix/rnull.pgc |
Previous Message | Robert Haas | 2022-08-31 12:29:00 | pgsql: Fix a bug in roles_is_member_of. |