Bug #15567 documentation: signature of avgcost in udf_example.cc does not match manual
Submitted: 8 Dec 2005 0:39 Modified: 28 Nov 2009 14:32
Reporter: Roland Bouman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.16 OS:Any (na)
Assigned to: CPU Architecture:Any

[8 Dec 2005 0:39] Roland Bouman
Description:
The documentation for UDF aggregate functions (http://dev.mysql.com/doc/refman/5.0/en/udf-aggr-calling.html) describes the signatures for the aggregate UDF interface. 

The aggregate interface comprises xxx_clear and xxx_add functions (replaces the xxx_reset function for versions <= 5). All of these are described to return a char *, however, the sematics of the return value are never described.

The avgcost udf aggregate example in the file udf_example.cc uses different signatures: instead of char *, void * are used there. 

All in all, it's not clear what these functions should return. 

How to repeat:
NA

Suggested fix:
Please align the UDF aggregate function documentation and the avgcost example in udf_example.cc; 

If the return types of the aggregate function interface are indeed char *, please document the semantics of those.
[28 Nov 2009 14:32] Valeriy Kravchuk
With current 5.0.89 I see the following declarations in udf_example.c:

void avgcost_clear( UDF_INIT* initid, char* is_null, char *error );
void avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error );

So, these functions are void now, as described in the documentation, http://dev.mysql.com/doc/refman/5.0/en/udf-aggr-calling.html.