fixed patter matches of mysql's function