Bugs item #2826015, was opened at 2009-07-23 14:44
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2826015&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Matthew W. Jones (matburt)
Assigned to: Niels Nes (nielsnes)
Summary: count distinct incorrect

Initial Comment:
With the latest May 2009 SP1 release I see this:

create table testdistinct (testcol varchar(10));
... inserts ...

sql>select * from testdistinct ;
+---------+
| testcol |
+=========+
| test    |
| test    |
| test    |
| other   |
| other   |
| other   |
+---------+
6 tuples

sql>select distinct(testcol) from testdistinct ;
+---------+
| testcol |
+=========+
| test    |
| other   |
+---------+
2 tuples

sql>select count(distinct(testcol)) from testdistinct ;
+----+
| L2 |
+====+
|  6 |
+----+
1 tuple

This seems incorrect, I would expect count() to return just 2.

----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2009-08-07 07:39

Message:
added test to
src/test/BugTracker-2009/Tests/count_distinct_bug.SF-2826015.sql

bug was fixed by cleanup of parser code (function handling)

----------------------------------------------------------------------

Comment By: Matthew W. Jones (matburt)
Date: 2009-07-23 18:36

Message:
should not, rather.

----------------------------------------------------------------------

Comment By: Matthew W. Jones (matburt)
Date: 2009-07-23 18:36

Message:
It does indeed work... but there should be a disparity between the two.

sql>select count(distinct testcol) from testdistinct ;
+----+
| L2 |
+====+
|  2 |
+----+
1 tuple
sql>select count(distinct(testcol)) from testdistinct ;
+----+
| L3 |
+====+
|  6 |
+----+
1 tuple


----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2009-07-23 18:13

Message:
select count ( distinct testcol) from testdistinct; seems to work just
fine.


----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2009-07-23 15:24

Message:
I would expect the same.

I added the test script to CVS:
sql/src/test/BugTracker-2009/count_distinct.SF-2826015.sql

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2826015&group_id=56967

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to