Bug #38376 Signatures for aggregate UDFs not properly documented
Submitted: 25 Jul 2008 14:35 Modified: 25 Jul 2008 16:51
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[25 Jul 2008 14:35] Roland Bouman
Description:
http://dev.mysql.com/doc/refman/5.1/en/udf-aggr-calling.html:

"
Declare xxx_clear() as follows:

char *xxx_clear(UDF_INIT *initid, char *is_null, char *error);
"
...

"
char *xxx_add(UDF_INIT *initid, UDF_ARGS *args,
              char *is_null, char *error);
"

However, comparing against sql_udf.h

typedef void (*Udf_func_clear)(UDF_INIT *, uchar *, uchar *);
typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *);

we can see that the return type is in fact void, not char *

How to repeat:
see http://dev.mysql.com/doc/refman/5.1/en/udf-aggr-calling.html:
compare against 
sql_udf.h (lines: 25, 26)

Suggested fix:
Please document the add and clear functions as void, not char *. Most likely this needs to be void for reset() too.
[25 Jul 2008 15:46] Roland Bouman
Actually, I think we should also document what happens if we set the error flag. Doe sthat abor processing of the group, or the entire UDF?
[25 Jul 2008 16:51] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.