Changeset: c27aeb35d6c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c27aeb35d6c6
Modified Files:
        sql/server/rel_dump.c
        sql/server/rel_select.c
Branch: sciql
Log Message:

Two fixes concerning (e_column)->f for arrays

- corrected checks for array sliced range and groupby range due to changes in 
the structure of (e_column)->f
- when printing a dimension range, pass the correct values to exp_print to 
avoid printing superfluous ','


diffs (47 lines):

diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c
--- a/sql/server/rel_dump.c
+++ b/sql/server/rel_dump.c
@@ -151,11 +151,11 @@ exp_print(mvc *sql, stream *fout, sql_ex
                        alias = 0;
                if (e->f) { /* the dimension constraints */
                        /* If a slicing has been applied on this dimension, 
print the sliced range; otherwise the original range */
-                       list *range = 
((list*)e->f)->h->next?((list*)e->f)->h->next->data:((list*)e->f)->h->data;
+                       list *range = ((list*)e->f)->h->next && 
list_length(((list*)e->f)->h->next->data) > 0 
?((list*)e->f)->h->next->data:((list*)e->f)->h->data;
                        mnstr_printf(fout, "[");
 #define PRINT_DIM_CONSTRAINT(EXP, C) \
                        if (EXP->data) \
-                         exp_print(sql, fout, (sql_exp*)EXP->data, depth, 
alias, 1); \
+                         exp_print(sql, fout, (sql_exp*)EXP->data, depth, 0, 
alias); \
                        else \
                                mnstr_printf(fout, "*"); \
                        mnstr_printf(fout, C);
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
@@ -1011,7 +1011,7 @@ rel_groupby(mvc *sql, sql_rel *l, list *
                        sql_exp *e = en->data, *ne;
 
                        /* the cardinality only reduces after a normal SQL 
group by */
-                       if (e->type == e_column && e->f)
+                       if (e->type == e_column && e->f && list_length(e->f) == 
3)
                                rel->card = CARD_MULTI;
                        e->card = rel->card;
                        if (!exp_name(e))
@@ -4310,7 +4310,7 @@ _rel_aggr(mvc *sql, sql_rel **rel, int d
        }
 
        if (groupby->r && ((list*)groupby->r)->h && 
((sql_exp*)((list*)groupby->r)->h->data)->type == e_column && 
((sql_exp*)((list*)groupby->r)->h->data)->f && 
list_length(((sql_exp*)((list*)groupby->r)->h->data)->f) == 3) {
-               /* e_column->f has been "misused" => an aggragation over array 
tiles */
+               /* ((sql_exp*)((list*)groupby->r)->h->data) is a dimensional 
column with three range lists => an aggragation over array tiles */
                return _rel_tiling_aggr(sql, rel, groupby, distinct, aggrstr, 
args->data.sym, f);
        }
 
@@ -5384,7 +5384,7 @@ is_tiling_groupby (sql_exp *e)
                        return 1;
                return 0;
        } else if (e->type == e_column) {
-               if (e->f)
+               if (e->f && list_length(e->f) == 3)
                        return 1;
        }
        return 0;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to