diff options
author | unknown <msvensson@devsrv-b.mysql.com> | 2006-03-24 11:12:32 +0100 |
---|---|---|
committer | unknown <msvensson@devsrv-b.mysql.com> | 2006-03-24 11:12:32 +0100 |
commit | 7c8acd5931d3dba654616af79b29d9d1f6d3d13e (patch) | |
tree | a7579f2286a34779eadfc97c05497cad3274772f | |
parent | e1da710d5b00172a42e56948ccda253e148fb0b9 (diff) | |
download | mariadb-git-7c8acd5931d3dba654616af79b29d9d1f6d3d13e.tar.gz |
Fix 'metaphon' function to correctly calculate the length of the returned string
sql/udf_example.cc:
Calculate length of returned string correctly
-rw-r--r-- | sql/udf_example.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/udf_example.cc b/sql/udf_example.cc index e6d272d9085..73e49aef178 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -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; } |