From: Bruce Momjian Date: Fri, 6 Dec 2002 05:15:32 +0000 (+0000) Subject: Thank you very much, you catch it :). This bug had a long life, because it X-Git-Tag: REL7_3_1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab6e38e40a4c45fd4be3bb52a87b0267de0ce16d;p=postgresql Thank you very much, you catch it :). This bug had a long life, because it exists if and only if locale of postmaster was a different from C (or ru_RU.KOI8-R). Please, apply patch for current CVS & 7.3.1 Magnus Naeslund(f) wrote: > Ok, I nailed the bug, but i'm not sure what the correct fix is. > Attached tsearch_morph.diff that remedies this problem by avoiding it. > Also there's a debug aid patch if someone would like to know how i > finally found it out :) > > There problem in the lemmatize() function is that GETDICT(...) returned > a value not handled (BYLOCALE). > The value (-1) and later used as an index into the dicts[] array. > After that everything went berserk stack went crazy somehow so trapping > the fault sent me to the wrong place, and every time i read the value it > was positive ;) > > So now i just return the initial word passed to the lemmatize function, > because i don't know what to do with it. Magnus Naeslund --- diff --git a/contrib/tsearch/morph.c b/contrib/tsearch/morph.c index 4394448737..3acbef9862 100644 --- a/contrib/tsearch/morph.c +++ b/contrib/tsearch/morph.c @@ -173,6 +173,10 @@ lemmatize(char *word, int *len, int type) /* word is stopword */ return NULL; } + else if (nd == BYLOCALE) + { + continue; /* no dict for current locale */ + } else { dict = &dicts[nd];