mysql UDF implementation of levenshtein function