Bug #9800 Rollup crash with distinct avg()
Submitted: 11 Apr 2005 2:33 Modified: 17 May 2005 22:35
Reporter: Peter Gulutzan
Status: Closed
Category:Server: Optimizer Severity:S3 (Non-critical)
Version:5.0.5-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Bugs System Target Version:

[11 Apr 2005 2:33] Peter Gulutzan
Description:
If I have a table with at least two rows, one of which contains NULL, and I do SELECT
DISTINCT AVG(...) ... GROUP BY ... WITH ROLLUP, crash.

I know that "distinct avg()" sounds similar to "avg(distinct)" which is bug#9799, but the
circumstances are different.

How to repeat:
mysql> create table t6 (s1 int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t6 values (null),(1);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select distinct avg(s1) as x from t5 group by s1 with rollup;
ERROR 2013 (HY000): Lost connection to MySQL server during query
[11 Apr 2005 3:12] Miguel Solorzano
Thank you for the bug report.
The last query in the test case changed the table name t5->t6:

select distinct avg(s1) as x from t6 group by s1 with rollup;
[6 May 2005 16:57] Jani Tolonen
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[17 May 2005 22:35] Paul DuBois
Noted in 5.0.6 changelog.