Re: BUG #18654: From fuzzystrmatch, levenshtein function with costs parameters produce incorrect results

From: bjdev(dot)gthb(at)laposte(dot)net
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18654: From fuzzystrmatch, levenshtein function with costs parameters produce incorrect results
Date: 2024-10-16 10:10:40
Message-ID: 292395358.3411411.1729073440569@wlpnf0212.sys.meshcore.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Tom,

Thank you for this feedback,
Indeed, it works correctly. The problem comes from the other side of the keyboard...
I went a little fast and did not check the length of my input strings which contained "invisible" characters.
After cleaning up the results obtained are as expected.
Really sorry for this false alarm

Regards

Hmm, works for me:

u8=# create extension fuzzystrmatch;
CREATE EXTENSION
u8=# SELECT levenshtein('horses','shorse',1,1,1);
levenshtein
-------------
2
(1 row)

u8=# SELECT levenshtein('horses','shorse',100,10,1);
levenshtein
-------------
6
(1 row)

I confess bafflement about why you're getting wrong answers.
You seem to be using a slightly out of date Postgres, but
none of this code has changed meaningfully since about 2016.
Maybe you hit a compiler bug? Where did you get this copy
of Postgres from --- or if you built it yourself, what build
options did you use?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2024-10-16 12:00:19 Re: BUG #18657: Using JSON_OBJECTAGG with volatile function leads to segfault
Previous Message Thomas Munro 2024-10-16 09:19:14 Re: Reference to - BUG #18349: ERROR: invalid DSA memory alloc request size 1811939328, CONTEXT: parallel worker