Changeset: f60e9c15b7da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f60e9c15b7da
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
Branch: pushcands
Log Message:
st_table fixes
diffs (43 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
@@ -1147,16 +1147,17 @@ exp_bin(backend *be, sql_exp *e, rel_bin
return NULL;
/* handle table returning functions */
if (l->type == e_psm && l->flag & PSM_REL) {
- stmt *lst = r->op1;
+ rel_bin_stmt *lst = r->op4.relstval;
+
if (r->type == st_table && lst && lst->nrcols
== 0 && lst->key && e->card > CARD_ATOM) {
list *l = sa_list(sql->sa);
- for (node
*n=lst->op4.relstval->cols->h; n; n = n->next)
+ for (node *n=lst->cols->h; n; n =
n->next)
list_append(l, const_column(be,
(stmt*)n->data));
r = stmt_list(be, l);
} else if (r->type == st_table && e->card ==
CARD_ATOM) { /* fetch value */
sql_rel *ll = (sql_rel*) l->l;
- r = lst->op4.relstval->cols->h->data;
+ r = lst->cols->h->data;
if (!r->aggr && lastexp(ll)->card >
CARD_ATOM) /* if the cardinality is atom, no fetch call needed */
r = stmt_fetch(be, r);
}
diff --git a/sql/backends/monet5/sql_statement.c
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -4055,13 +4055,8 @@ stmt_return(backend *be, stmt *val, int
if (val->nr < 0)
return NULL;
int args = 0;
- if (val->type == st_table) {
- /* ugghh */
- if (val->op1)
- args = 2 * list_length(val->op1->op4.lval);
- else
- args = 2 * list_length(val->op4.lval);
- }
+ if (val->type == st_table)
+ args = 2 * list_length(val->op4.relstval->cols);
if (args < MAXARG)
args = MAXARG;
q = newInstructionArgs(mb, NULL, NULL, args);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list