| Bug #15469 | UDF Documentation: unclear how to handle Item_result::DECIMAL_RESULT arguments | ||
|---|---|---|---|
| Submitted: | 4 Dec 2005 12:38 | Modified: | 6 Sep 2006 17:58 |
| Reporter: | Roland Bouman | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.0.16 | OS: | NA |
| Assigned to: | Paul DuBois | CPU Architecture: | Any |
[4 Dec 2005 12:38]
Roland Bouman
[4 Dec 2005 13:14]
Valeriy Kravchuk
Thank you for a documentation request. Yes, handling of DECIMAL_RESULT (and ROW_RESULT) should be described at http://dev.mysql.com/doc/refman/5.0/en/udf-arguments.html.
[5 Dec 2005 20:52]
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 product(s). Additional info: DECIMAL functions can be declared but their values are returned as strings, so you write them like STRING functions. ROW is unimplemented and cannot be used. The manual will not document a non-existent syntax.
[3 Feb 2006 15:09]
Roland Bouman
The documentation still does not reflect the addition of the DECIMAL_RESULT (http://dev.mysql.com/doc/refman/5.0/en/udf-arguments.html) shouldnt it be there already? it's been nearly 2 months...
[3 Feb 2006 15:10]
Roland Bouman
same goes for 5.1: http://dev.mysql.com/doc/refman/5.1/en/udf-arguments.html
[19 Aug 2006 3:01]
Morgan Tocker
Reopening original bug; When writing a udf with float arguments - ie sample_udf(4.5, 5.6) the arguments are reported to be of type DECIMAL_RESULT not REAL_RESULT as the docs suggest.
[25 Aug 2006 13:55]
Valeriy Kravchuk
DECIMAL_RESULT still have to be documented.
[6 Sep 2006 17:58]
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. DECIMAL_RESULT arguments are passed as strings, but you can use the init function to coerce them to numbers. I've added instructions at http://dev.mysql.com/doc/refman/5.0/en/udf-arguments.html, and also the following incompatibility note in the 5.0.3 changelog and the 5.0 upgrade section. Warning: Incompatible change: For user-defined functions, exact-value decimal arguments such as 1.3 or DECIMAL column values were passed as REAL_RESULT values prior to MySQL 5.0.3. As of 5.0.3, they are passed as strings with a type of DECIMAL_RESULT. If you upgrade to 5.0.3 and find that your UDF now receives string values, use the initialization function to coerce the arguments to numbers as described in http://dev.mysql.com/doc/refman/5.0/en/udf-arguments.html. Also added notes were appropriate that ROW_RESULT return values and arguments are not implemented.
