Changeset: 46d3e30ea21c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/46d3e30ea21c
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/server/rel_unnest.c
Branch: Mar2025
Log Message:

2 small fixes on order by in aggregates
* reorder all columns
* keep order by direction in rewriters


diffs (26 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1813,8 +1813,8 @@ exp_bin(backend *be, sql_exp *e, stmt *l
                                                orderby_grp = stmt_result(be, 
orderby, 2);
                                        }
                                        /* depending on type of aggr project 
input or ordered column */
-                                       stmt *h = l->h->data;
-                                       l->h->data = h = stmt_project(be, 
orderby_ids, h);
+                                       for (node *n = l->h; n; n = n->next)
+                                               n->data = stmt_project(be, 
orderby_ids, n->data);
                                        if (grp)
                                                grp = stmt_project(be, 
orderby_ids, grp);
                                        (void)orderby_vals;
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
@@ -2639,6 +2639,8 @@ aggrs_split_args(mvc *sql, list *aggrs, 
                                                        e1 = exp_label(sql->sa, 
e1, ++sql->label);
                                                append(exps, e1);
                                        } else {
+                                               found->ascending = 
e1->ascending;
+                                               found->nulls_last = 
e1->nulls_last;
                                                e1 = found;
                                        }
                                        if (!e1->alias.label)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to