Bug #7015 Views: selection fails if sum(distinct)
Submitted: 5 Dec 2004 0:47 Modified: 21 Jun 2005 16:22
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug OS:Linux (SUSE 9.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[5 Dec 2004 0:47] Peter Gulutzan
Description:
If a view's selection includes SUM(DISTINCT ...), I get an error when I try 
to SELECT from the view. 
 

How to repeat:
mysql> create table t (s1 int); 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> create view  v as select sum(distinct s1) from t; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> select * from v; 
ERROR 1305 (42000): FUNCTION db19.sum_distinct does not exist
[13 Dec 2004 1:12] Peter Gulutzan
I believe it would be more convenient to fix bug#7211 before bug#7015.
[14 Jun 2005 19:09] Peter Gulutzan
If a view containing SUM(DISTINCT) exists, then
select * from information_schema.tables;
causes a crash.
[14 Jun 2005 21:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26002
[16 Jun 2005 15:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26077
[18 Jun 2005 19:23] Oleksandr Byelkin
pushed to 5.0.8
[21 Jun 2005 16:22] Jon Stephens
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

Additional info:

Documented in 5.0.8 change history; marked as Closed.