Changeset: a7b88bea38e6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7b88bea38e6
Modified Files:
        sql/backends/monet5/sql_statement.c
        sql/server/rel_psm.c
Branch: Oct2014
Log Message:

fixes for bug 3629

properly handle list of else parts
added 3 value logic in if then etc


diffs (33 lines):

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
@@ -1656,7 +1656,11 @@ stmt_if(sql_allocator *sa, stmt *cond, s
        list_append(l, ifstmts);
        list_append(l, stmt_control_end(sa, cstmt));
        if (elsestmts) {
-               cond = stmt_unop(sa, cond, not);
+               sql_subfunc *or = sql_bind_func(sa, NULL, "or", bt, bt, F_FUNC);
+               sql_subfunc *isnull = sql_bind_func(sa, NULL, "isnull", bt, 
NULL, F_FUNC);
+               cond = stmt_binop(sa, 
+                               stmt_unop(sa, cond, not),
+                               stmt_unop(sa, cond, isnull), or);
                list_append(l, cstmt = stmt_cond(sa, cond, NULL, 0));
                list_append(l, elsestmts);
                list_append(l, stmt_control_end(sa, cstmt));
diff --git a/sql/server/rel_psm.c b/sql/server/rel_psm.c
--- a/sql/server/rel_psm.c
+++ b/sql/server/rel_psm.c
@@ -215,10 +215,11 @@ psm_if_then_else( mvc *sql, sql_subtype 
 {
        if (!elseif)
                return NULL;
-       if (elseif->next && elseif->type == type_symbol) { /* if or elseif */
+       assert(elseif->type == type_symbol); 
+       if (elseif->data.sym && elseif->data.sym->token == SQL_IF) {
                sql_exp *cond;
                list *ifstmts, *elsestmts;
-               dnode *n = elseif;
+               dnode *n = elseif->data.sym->data.lval->h;
                sql_rel *rel = NULL;
 
                cond = rel_logical_value_exp(sql, &rel, n->data.sym, sql_sel); 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to