Changeset: 7ae5c92bbcd7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ae5c92bbcd7 Modified Files: sql/server/rel_optimizer.c sql/test/miscellaneous/Tests/groupby_error.sql sql/test/miscellaneous/Tests/groupby_error.stable.out Branch: Oct2020 Log Message:
Reverting my changes. The distinct property cannot be removed on constants diffs (45 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -5983,15 +5983,6 @@ rel_groupby_distinct(visitor *v, sql_rel } } - /*if the input expressions are atoms, drop distinct property */ - if (is_groupby(rel->op) && !list_empty(rel->exps)) { - for (n=rel->exps->h; n ; n = n->next) { - sql_exp *e = n->data; - if (e->type == e_aggr && need_distinct(e) && (!e->l || exps_are_atoms(e->l))) - set_nodistinct(e); - } - } - if (is_groupby(rel->op)) { sql_rel *l = rel->l; if (!l || is_groupby(l->op)) diff --git a/sql/test/miscellaneous/Tests/groupby_error.sql b/sql/test/miscellaneous/Tests/groupby_error.sql --- a/sql/test/miscellaneous/Tests/groupby_error.sql +++ b/sql/test/miscellaneous/Tests/groupby_error.sql @@ -193,7 +193,7 @@ SELECT CAST(COUNT ( DISTINCT + CAST ( NU -- 93 -- 93 select group_concat(distinct 'a') from tab0; - -- a,a,a + -- a INSERT INTO "tab0" VALUES (83, 0, 38), (26, 0, 79), (43, 81, 24); select group_concat(distinct col1, col2) from tab0 group by col0; -- 0 diff --git a/sql/test/miscellaneous/Tests/groupby_error.stable.out b/sql/test/miscellaneous/Tests/groupby_error.stable.out --- a/sql/test/miscellaneous/Tests/groupby_error.stable.out +++ b/sql/test/miscellaneous/Tests/groupby_error.stable.out @@ -501,8 +501,8 @@ project ( % .%1 # table_name % %1 # name % clob # type -% 5 # length -[ "a,a,a" ] +% 1 # length +[ "a" ] #INSERT INTO "tab0" VALUES (83, 0, 38), (26, 0, 79), (43, 81, 24); [ 3 ] #ROLLBACK; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list