You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DROP table a;
CREATE table a (k int,b int);
INSERT into a values (1,2);
INSERT into a values (2,2);
INSERT into a values (3,3);
INSERT into a values (4,65);
INSERT into a values (5,21);
SELECT k as c,count(distinct b) from a group by c;
fixed a bug in the relational optimizer. Rewriting of some special case of distinct with count incorrectly used the expressions of the lower relation. Now it correctly uses the alias names.
Date: 2014-01-20 20:51:03 +0100
From: Klaudiusz <>
To: SQL devs <>
Version: 11.17.9 (Jan2014)
CC: @njnes
Last updated: 2014-02-20 15:02:26 +0100
Comment 19474
Date: 2014-01-20 20:51:03 +0100
From: Klaudiusz <>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36
Build Identifier:
Using alias in "group by" clause with count(distinct x) causes that query doesn't work.
Probably introduced by
http://dev.monetdb.org/hg/MonetDB/rev/78eca92f6d68
Reproducible: Always
Steps to Reproduce:
DROP table a;
CREATE table a (k int,b int);
INSERT into a values (1,2);
INSERT into a values (2,2);
INSERT into a values (3,3);
INSERT into a values (4,65);
INSERT into a values (5,21);
SELECT k as c,count(distinct b) from a group by c;
Actual Results:
nothing happens
Expected Results:
+------+------+
| c | L1 |
+======+======+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 5 | 1 |
+------+------+
5 tuples (1.538ms)
MonetDB 5 server v11.17.1 "Jan2014" (64-bit, 64-bit oids)
Copyright (c) 1993-July 2008 CWI
Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Found 252.2GiB available memory, 32 available cpu cores
Libraries:
libpcre: 7.8 2008-09-05 (compiled with 7.8)
openssl: OpenSSL 1.0.1e 11 Feb 2013 (compiled with OpenSSL 1.0.1e-fips 11 Feb 2013)
libxml2: 2.7.6 (compiled with 2.7.6)
Compiled by: @ (x86_64-redhat-linux-gnu)
Compilation: gcc -O3 -fomit-frame-pointer -pipe -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wp,-D_FORTIFY_SOURCE=2
Linking : /usr/bin/ld -m elf_x86_64
Comment 19482
Date: 2014-01-22 12:13:17 +0100
From: @njnes
fixed a bug in the relational optimizer. Rewriting of some special case of distinct with count incorrectly used the expressions of the lower relation. Now it correctly uses the alias names.
Comment 19486
Date: 2014-01-22 13:08:59 +0100
From: @sjoerdmullender
Since this bug was reported against the RC, we need the NEXTRELEASE resolution (assuming the fix will appear in the correct branch).
Comment 19488
Date: 2014-01-22 13:17:00 +0100
From: MonetDB Mercurial Repository <>
Changeset 9d8906d9166d made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=9d8906d9166d
Changeset description:
Comment 19594
Date: 2014-02-20 15:02:26 +0100
From: @sjoerdmullender
Jan2014 has been released.
The text was updated successfully, but these errors were encountered: