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:
parent
e1da710d5b
commit
7c8acd5931
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user