Fix 'metaphon' function to correctly calculate the length of the returned string

sql/udf_example.cc:
  Calculate length of returned string correctly
This commit is contained in:
unknown 2006-03-24 11:12:32 +01:00
parent e1da710d5b
commit 7c8acd5931

View file

@ -497,7 +497,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
}
}
*length= (ulong) (result - org_result);
*length= (ulong) (max(0, result - org_result - 1));
return org_result;
}