Bug #19290 | NULL results from UDF agregate function combined with other functions | ||
---|---|---|---|
Submitted: | 24 Apr 2006 7:33 | Modified: | 23 Oct 2007 15:49 |
Reporter: | Wojciech Meler | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.20-max/5.0BK/5.1BK | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[24 Apr 2006 7:33]
Wojciech Meler
[25 Apr 2006 17:12]
MySQL Verification Team
Thank you for the bug report. I was able to repeat on 5.0/5.1. The version 4.1 not presents that bug. mysql> CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME 'udf_example.so'; Query OK, 0 rows affected (0.00 sec) mysql> select avgcost(q,p) from avgcost_test group by k1; +--------------+ | avgcost(q,p) | +--------------+ | 5.1286 | +--------------+ 1 row in set (0.01 sec) mysql> select sqrt(avgcost(q,p)) from avgcost_test group by k1; +--------------------+ | sqrt(avgcost(q,p)) | +--------------------+ | NULL | +--------------------+ 1 row in set (0.01 sec) -------------------------------------------------------------------- mysql> select avgcost(q,p) from avgcost_test group by k1; +--------------+ | avgcost(q,p) | +--------------+ | 5.1286 | +--------------+ 1 row in set (0.02 sec) mysql> select sqrt(avgcost(q,p)) from avgcost_test group by k1; +--------------------+ | sqrt(avgcost(q,p)) | +--------------------+ | 2.264634943776 | +--------------------+ 1 row in set (0.00 sec) mysql> select version(); +------------------+ | version() | +------------------+ | 4.1.19-debug-log | +------------------+ 1 row in set (0.00 sec) mysql>
[6 Nov 2006 4:05]
Maciej Babinski
We can reproduce this problem as well. Our MEDIAN() implementation is nearly useless because of it. I'd think that making aggregate UDF's non-functional in non-trivial queries would merit something more severe than a "Non-critical" severity.
[11 Oct 2007 9:35]
Sergei Glukhov
checked on latest 5.0 tree, can't repeat
[23 Oct 2007 15:49]
Sveta Smirnova
Bug is no longer repeatable with versions 5.0 and 5.1