Changeset: 39e98a472fdc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=39e98a472fdc
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
Branch: Jul2017
Log Message:
small fix of the aggregation resolution fix.
diffs (59 lines):
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -3442,9 +3442,11 @@ static sql_exp *
a = sql_bind_aggr_(sql->sa, s, aname, exp_types(sql->sa, exps));
if (!a && list_length(exps) > 1) {
sql_subtype *t1 = exp_subtype(exps->h->data);
-
- if (!EC_NUMBER(t1->type->eclass) || list_length(exps) != 2) {
- a = sql_bind_member_aggr(sql->sa, s, aname,
exp_subtype(exps->h->data), list_length(exps));
+ a = sql_bind_member_aggr(sql->sa, s, aname,
exp_subtype(exps->h->data), list_length(exps));
+
+ if (list_length(exps) != 2 || (!EC_NUMBER(t1->type->eclass) ||
!a || subtype_cmp(
+
&((sql_arg*)a->aggr->ops->h->data)->type,
+
&((sql_arg*)a->aggr->ops->h->next->data)->type) != 0) ) {
if (a) {
node *n, *op = a->aggr->ops->h;
list *nexps = sa_list(sql->sa);
diff --git
a/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
b/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
---
a/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
+++
b/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
@@ -35,21 +35,21 @@ Ready.
% .plan # table_name
% rel # name
% clob # type
-% 93 # length
+% 100 # length
project (
| group by (
| | table(sys.x) [ "x"."y" ] COUNT
-| ) [ ] [ sys.quantile no nil (double["x"."y"] as "x"."y", double "0.000000")
as "L3"."L3" ]
+| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", double
"0.000000") as "L3"."L3" ]
) [ "L3" as "L4"."L3" ]
#plan select quantile(y, 0) from x;
% .plan # table_name
% rel # name
% clob # type
-% 94 # length
+% 100 # length
project (
| group by (
| | table(sys.x) [ "x"."y" ] COUNT
-| ) [ ] [ sys.quantile no nil (tinyint["x"."y"] as "x"."y", double
"0.000000") as "L3"."L3" ]
+| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", double
"0.000000") as "L3"."L3" ]
) [ "L3" as "L4"."L3" ]
#rollback;
diff --git a/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
--- a/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
+++ b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
@@ -81,7 +81,7 @@ Ready.
#select quantile(i,0.5),j from bug6218 group by j order by j;
% sys.L3, sys.bug6218 # table_name
% L2, j # name
-% hugeint, int # type
+% int, int # type
% 1, 1 # length
[ 1, 0 ]
[ NULL, 1 ]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list