Bug #9800 Rollup crash with distinct avg()
Submitted: 11 Apr 2005 0:33 Modified: 17 May 2005 20:35
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:5.0.5-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Jani Tolonen CPU Architecture:Any

[11 Apr 2005 0:33] Peter Gulutzan
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 1:12] MySQL Verification Team
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 14: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
[17 May 2005 20:35] Paul Dubois
Noted in 5.0.6 changelog.