Content-Length: 283942 | pFad | http://github.com/postgrespro/postgres_cluster/commit/65a69dfa08e212556d11e44a5a8a1861fd826ccd

ED Fix bogus affix-merging code. · postgrespro/postgres_cluster@65a69df · GitHub
Skip to content

Commit 65a69df

Browse files
committed
Fix bogus affix-merging code.
NISortAffixes() compared successive compound affixes incorrectly, thus possibly failing to merge identical affixes, or (less likely) merging ones that shouldn't be merged. The user-visible effects of this are unclear, to me anyway. Per bug #15150 from Alexander Lakhin. It's been broken for a long time, so back-patch to all supported branches. Arthur Zakirov Discussion: https://postgr.es/m/152353327780.31225.13445405496721177988@wrigleys.postgresql.org
1 parent b8ca984 commit 65a69df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/tsearch/spell.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,16 +1963,18 @@ NISortAffixes(IspellDict *Conf)
19631963
if ((Affix->flagflags & FF_COMPOUNDFLAG) && Affix->replen > 0 &&
19641964
isAffixInUse(Conf, Affix->flag))
19651965
{
1966+
bool issuffix = (Affix->type == FF_SUFFIX);
1967+
19661968
if (ptr == Conf->CompoundAffix ||
1967-
ptr->issuffix != (ptr - 1)->issuffix ||
1969+
issuffix != (ptr - 1)->issuffix ||
19681970
strbncmp((const unsigned char *) (ptr - 1)->affix,
19691971
(const unsigned char *) Affix->repl,
19701972
(ptr - 1)->len))
19711973
{
19721974
/* leave only unique and minimals suffixes */
19731975
ptr->affix = Affix->repl;
19741976
ptr->len = Affix->replen;
1975-
ptr->issuffix = (Affix->type == FF_SUFFIX);
1977+
ptr->issuffix = issuffix;
19761978
ptr++;
19771979
}
19781980
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/65a69dfa08e212556d11e44a5a8a1861fd826ccd

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy