Changeset: 1edf23867d89 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1edf23867d89
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_result.c
Branch: nested
Log Message:

improved handling outputing multiset values (fixes ecommerce crash)


diffs (45 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
@@ -2657,7 +2657,7 @@ rel2bin_subtable(backend *be, sql_table 
                                if (s && s->type == st_list && 
c->type.multiset) { /* keep rowid at the end */
                                        stmt *ls = s->op4.lval->t->data;
                                        stmt *ns = stmt_col(be, c, dels, 
dels->partition);
-                                       ns->subtype = ls->subtype;
+                                       ns->subtype = ls->subtype; // TODO find 
correct type of rowid/msid (don't use msnr type
                                        list_append(s->op4.lval, ns);
                                        s->nr = ns->nr;
                                        s->subtype = *exp_subtype(exp);
@@ -2749,7 +2749,7 @@ rel2bin_basetable(backend *be, sql_rel *
                                if (s && s->type == st_list && 
c->type.multiset) { /* keep rowid at the end */
                                        stmt *ls = s->op4.lval->t->data;
                                        stmt *ns = (c == fcol) ? col : 
stmt_col(be, c, complex?dels:NULL, dels->partition);
-                                       ns->subtype = ls->subtype;
+                                       ns->subtype = ls->subtype; // TODO find 
correct type of rowid/msid (don't use msnr type
                                        list_append(s->op4.lval, ns);
                                        s->nr = ns->nr;
                                        s->subtype = *exp_subtype(exp);
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -1254,7 +1254,9 @@ output_complex_type(res_col *cols, Colum
 
                if (c->multiset) {
                        /* c rowid */
-                       j += output_complex_type(cols + j + 1, fmt + j + 1, 
c->composite?list_length(c->type.type->d.fields):1, true, composite);
+                       j++;
+                       if (c->composite)
+                               j += output_complex_type(cols + j, fmt + j, 
list_length(c->type.type->d.fields), true, composite);
                        j++;
                        if (c->multiset == MS_ARRAY)
                                j++;
@@ -1413,7 +1415,8 @@ mvc_export_table_(mvc *m, int output_for
                        if (c->multiset) {
                                /* c rowid */
                                i++;
-                               i += output_complex_type(t->cols + i, fmt + i + 
1,  c->composite?list_length(c->type.type->d.fields):1, true, false);
+                               if (c->composite)
+                                       i += output_complex_type(t->cols + i, 
fmt + i + 1,  list_length(c->type.type->d.fields), true, false);
                                i++;
                                if (c->multiset == MS_ARRAY)
                                        i++;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to