Changeset: c502d6138998 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c502d6138998
Modified Files:
        sql/backends/monet5/rel_weld.c
Branch: rel-weld
Log Message:

rel_weld: op_basetable can also columns with aliases


diffs (26 lines):

diff --git a/sql/backends/monet5/rel_weld.c b/sql/backends/monet5/rel_weld.c
--- a/sql/backends/monet5/rel_weld.c
+++ b/sql/backends/monet5/rel_weld.c
@@ -403,7 +403,12 @@ base_table_produce(backend *be, sql_rel 
        wprintf(wstate, "for(zip(");
        for (en = rel->exps->h; en; en = en->next) {
                exp = en->data;
-               stmt *col = bin_find_column(be, sub, exp->l, exp->r);
+               stmt *col;
+               if (exp->name) {
+                       col = bin_find_column(be, sub, exp->rname ? exp->rname 
: exp->name, exp->name);
+               } else {
+                       col = bin_find_column(be, sub, exp->l, exp->r);
+               }
                wprintf(wstate, "in%d", col->nr);
                if (en->next != NULL) {
                        wprintf(wstate, ", ");
@@ -423,7 +428,7 @@ base_table_produce(backend *be, sql_rel 
        /* extract named values from the tuple */
        for (en = rel->exps->h, count = 0; en; en = en->next, count++) {
                exp = en->data;
-               str col_name = get_col_name(wstate->sa, exp, REL);
+               str col_name = get_col_name(wstate->sa, exp, ANY);
                if (rel->exps->h->next == NULL) {
                        /* just a single column so n.$0 doesn't work */
                        sprintf(struct_mbr, "n%d", wstate->num_loops);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to