Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count distinct giving wrong results #6790

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Count distinct giving wrong results #6790

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2019-11-27 10:17:23 +0100
From: @PedroTadim
To: SQL devs <>
Version: -- development

Last updated: 2019-12-20 15:36:33 +0100

Comment 27420

Date: 2019-11-27 10:17:23 +0100
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0
Build Identifier:

See the reproducible example bellow. I'm going to commit the test in a few minutes.

Reproducible: Always

Steps to Reproduce:

1.CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER);
2.INSERT INTO tab0 VALUES (97,1,99), (15,81,47),(87,21,10);
3.SELECT COUNT ( DISTINCT + 45 ) AS col2 FROM tab0;

Actual Results:

3

Expected Results:

1

Comment 27421

Date: 2019-11-27 10:42:30 +0100
From: MonetDB Mercurial Repository <>

Changeset 6ad525e8e28a made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6ad525e8e28a

Changeset description:

Added test for bug #6790

Comment 27422

Date: 2019-11-27 11:14:24 +0100
From: MonetDB Mercurial Repository <>

Changeset f389a425dd85 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f389a425dd85

Changeset description:

Fix for bug #6790. At rel_distinct_aggregate_on_unique_values optimizer, ignore constants because on a column projection they won't be distinct anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant