Changeset: a94d42c89de6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a94d42c89de6
Modified Files:
sql/server/rel_select.c
sql/server/rel_unnest.c
Branch: default
Log Message:
- allow aggregation on the outer, while inside a subquery
- fixed crash, ie pass names of removed not(not()) removal.
diffs (27 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
@@ -3187,7 +3187,7 @@ static sql_exp *
if (uaname)
GDKfree(uaname);
return e;
- } else if (is_sql_join(f)) { /* the is_sql_join test must come before
is_sql_where, because the join conditions are handled with sql_where */
+ } else if (!query_has_outer(query) && is_sql_join(f)) { /* the
is_sql_join test must come before is_sql_where, because the join conditions are
handled with sql_where */
char *uaname = GDKmalloc(strlen(aname) + 1);
sql_exp *e = sql_error(sql, 02, SQLSTATE(42000) "%s: aggregate
functions not allowed in JOIN conditions",
uaname ? toUpperCopy(uaname, aname) :
aname);
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -1479,7 +1479,10 @@ rewrite_simplify_exp(mvc *sql, sql_rel *
if (is_func(ie->type) && list_length(ie->l) == 1 &&
is_not_func(sf)) {
args = ie->l;
- return args->h->data;
+ ie = args->h->data;
+ if (exp_name(e))
+ exp_prop_alias(sql->sa, ie, e);
+ return ie;
}
}
return e;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list