Re: bug: fuzzystrmatch levenshtein is wrong

From: marcin mank <marcin(dot)mank(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug: fuzzystrmatch levenshtein is wrong
Date: 2009-12-07 14:39:25
Message-ID: b1b9fac60912070639r2fdf9a60wd507bf3e9ead9136@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2009-12-07 14:46:11 Re: Writeable CTE patch
Previous Message Robert Haas 2009-12-07 14:24:55 Re: EXPLAIN BUFFERS