Re: bug: fuzzystrmatch levenshtein is wrong

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: bug: fuzzystrmatch levenshtein is wrong
Дата
Msg-id 603c8f070912081804y16268436t3e1b12d7d2ac4bf4@mail.gmail.com
обсуждение исходный текст
Ответ на bug: fuzzystrmatch levenshtein is wrong  (marcin mank <marcin.mank@gmail.com>)
Ответы Re: bug: fuzzystrmatch levenshtein is wrong
Список pgsql-hackers
On Mon, Dec 7, 2009 at 8:33 AM, marcin mank <marcin.mank@gmail.com> wrote:
> The current behavior of levenshtein(text,text,int,int,int) is wrong. Consider:
>
> leki_dev=# select levenshtein('','a',2,4,5);
>  levenshtein
> -------------
>           1
> (1 row)
>
>
> leki_dev=# select levenshtein('a','',2,4,5);
>  levenshtein
> -------------
>           1
> (1 row)
>
>
> leki_dev=# select levenshtein('aa','a',2,4,5);
>  levenshtein
> -------------
>           1
> (1 row)
>
>
> leki_dev=# select levenshtein('a','aa',2,4,5);
>  levenshtein
> -------------
>           1
> (1 row)
>
> versus (after patch)
>
> postgres=# select levenshtein('','a',2,4,5);
>  levenshtein
> -------------
>           2
> (1 row)
>
> postgres=# select levenshtein('a','',2,4,5);
>  levenshtein
> -------------
>           4
> (1 row)
>
> postgres=# select levenshtein('aa','a',2,4,5);
>  levenshtein
> -------------
>           4
> (1 row)
>
> postgres=# select levenshtein('a','aa',2,4,5);
>  levenshtein
> -------------
>           2
> (1 row)
>
> patch attached.

I cannot get this patch to apply for anything.  All 4 hunks fail, both
on HEAD and on the the pre-8.4-pgindent version of fuzzystrmatch.c.
Either I'm doing something wrong here, or there's something wrong with
this patch file.

...Robert


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Streaming replication, some small issues
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: bug: fuzzystrmatch levenshtein is wrong