Re: bug: fuzzystrmatch levenshtein is wrong

Marcin Mańk <marcin.mank@gmail.com>

From: marcin mank <marcin.mank@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2009-12-07T14:39:25Z
Lists: pgsql-hackers
also there is integer overflow:
postgres=# select levenshtein('aaaaaaaaaaaaaaaa','',1,1000000000,1);
 levenshtein
-------------
 -1179869184
(1 row)


should we reject arguments greater than,say, 10000 ?
maximum input length is 255 currently, so the maximum numbers involved
would be about 10000*255*2

This would leave some breathing room if we wanted to increase the
maximum input string length.

Greetings
Marcin