Bugs item #1876779, was opened at 2008-01-21 21:48
Message generated for change (Settings changed) made by nielsnes
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1876779&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: SQL/Core
Group: MonetDB5 CVS Head
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Bob Ippolito (etrepum)
Assigned to: Niels Nes (nielsnes)
Summary: Unexpected results with COALESCE and aggregates
Initial Comment:
MonetDB SR5 behaves unexpectedly when we've tried to use COALESCE with
aggregates, here's an example:
sql>CREATE TABLE tmp(a int);
sql>SELECT SUM(a) FROM tmp;
+-------+
| sum_a |
+=======+
| 0 |
+-------+
sql>SELECT MIN(a) FROM tmp;
+-------------+
| min_a |
+=============+
| null |
+-------------+
sql>SELECT COALESCE(MIN(a), 0) FROM tmp;
sql>
For the first SELECT I would expect NULL, the second SELECT is okay,
but I expect a result for the third!
Here's what PosgreSQL does:
bob=# CREATE TABLE tmp(a int);
CREATE TABLE
bob=# SELECT SUM(A) FROM tmp;
sum
-----
(1 row)
bob=# SELECT MIN(a) FROM tmp;
min
-----
(1 row)
bob=# SELECT COALESCE(MIN(a), 0) FROM tmp;
coalesce
----------
0
----------------------------------------------------------------------
>Comment By: Niels Nes (nielsnes)
Date: 2008-03-14 13:25
Message:
Logged In: YES
user_id=43556
Originator: NO
fixed the sum implementation.
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2008-02-20 10:29
Message:
Logged In: YES
user_id=43556
Originator: NO
The coalesce part of the problem is fixed now .
Test added to src/test/BugTracker/Tests/case_with_aggr.SF-1876779.sql
The sum result of 0 for empty columns is still open.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1876779&group_id=56967
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs