Changeset: 8e4e652db862 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8e4e652db862
Modified Files:
        NT/monetdb_config.h.in
        sql/backends/monet5/sql_gencode.c
        sql/server/rel_psm.c
Branch: RIntegration-default
Log Message:

merge between vararg and rint for SQL, part 2


diffs (134 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -299,9 +299,6 @@
 /* Define if you have the pthread library */
 /* #undef HAVE_LIBPTHREAD */
 
-/* Define if you have libR installed */
-/* #undef HAVE_LIBR */
-
 /* Define if you have the readline library */
 /* #undef HAVE_LIBREADLINE */
 
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -90,21 +90,6 @@ constantAtom(backend *sql, MalBlkPtr mb,
        return idx;
 }
 
-static InstrPtr
-pushPtr(MalBlkPtr mb, InstrPtr q, ptr val)
-{
-       int _t;
-       ValRecord cst;
-
-       if (q == NULL)
-               return NULL;
-       cst.vtype= TYPE_ptr;
-       cst.val.pval = val;
-       cst.len = 0;
-       _t = defConstant(mb, TYPE_ptr, &cst);
-       return pushArgument(mb, q, _t);
-}
-
 static int
 argumentZero(MalBlkPtr mb, int tpe)
 {
@@ -709,10 +694,6 @@ dump_joinN(backend *sql, MalBlkPtr mb, s
        /* filter qualifying tuples, return oids of h and tail */
        q = newStmt(mb, mod, fimp);
        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
-       if (LANG_EXT(f->lang)) 
-               q = pushPtr(mb, q, f);
-       if (f->lang == FUNC_LANG_R)
-               q = pushStr(mb, q, f->query);
        q = pushArgument(mb, q, op1);
        q = pushArgument(mb, q, op2);
        if (s->op3)
@@ -1843,7 +1824,6 @@ static int
                        sql_subtype *tpe = NULL;
                        int special = 0;
                        sql_subfunc *f = s->op4.funcval;
-                       int rtype = (f->res.type)?f->res.type->localtype:0;
                        node *n;
                        /* dump operands */
                        if (_dumpstmt(sql, mb, s->op1) < 0)
@@ -1885,10 +1865,6 @@ static int
                        if (strcmp(fimp, "round") == 0 && tpe && 
tpe->type->eclass == EC_DEC)
                                special = 1;
 
-                       if (LANG_EXT(f->func->lang)) 
-                               q = pushPtr(mb, q, f->func);
-                       if (f->func->lang == FUNC_LANG_R)
-                               q = pushStr(mb, q, f->func->query);
                        for (n = s->op1->op4.lval->h; n; n = n->next) {
                                stmt *op = n->data;
 
@@ -1996,15 +1972,6 @@ static int
                                        setVarUDFtype(mb, getArg(q, 0));
                                }
                        }
-                       if (LANG_EXT(a->aggr->lang)) 
-                               q = pushPtr(mb, q, a->aggr);
-                       if (a->aggr->lang == FUNC_LANG_R){
-                               if (!g) {
-                                       setVarType(mb, getArg(q, 0), restype);
-                                       setVarUDFtype(mb, getArg(q, 0));
-                               }
-                               q = pushStr(mb, q, a->aggr->query);
-                       }
                        if (s->op1->type != st_list) {
                                q = pushArgument(mb, q, l);
                        } else {
@@ -2946,21 +2913,3 @@ backend_create_subaggr(backend *be, sql_
 {
        return backend_create_func(be, f->aggr, f->res, NULL);
 }
-
-/* TODO handle aggr */
-int
-backend_create_func(backend *be, sql_func *f)
-{
-       switch(f->lang) {
-       case FUNC_LANG_INT:
-       case FUNC_LANG_MAL:
-       case FUNC_LANG_SQL:
-               return backend_create_sql_func(be, f);
-       case FUNC_LANG_R:
-               return backend_create_r_func(be, f);
-       case FUNC_LANG_C:
-       case FUNC_LANG_J:
-       default:
-               return -1;      
-       }
-}
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
@@ -747,7 +747,6 @@ rel_create_func(mvc *sql, dlist *qname, 
                        if (params) {
                                for (n = params->h; n; n = n->next) {
                                        dnode *an = n->data.lval->h;
-               
                                        sql_add_param(sql, an->data.sval, 
&an->next->data.typeval);
                                }
                                l = sql->params;
@@ -775,6 +774,7 @@ rel_create_func(mvc *sql, dlist *qname, 
                                                                                
        (lang == FUNC_LANG_J)?"japi":"unknown";
                                sql->params = NULL;
                                        if (create) {
+// TODO: what to set for varargs argument in create_func?
                                                f = mvc_create_func(sql, 
sql->sa, s, fname, l, restype, type, lang,  mod, fname, lang_body, FALSE, 
FALSE);
                                } else if (!sf) {
                                        return sql_error(sql, 01, "CREATE %s%s: 
R function %s.%s not bound", KF, F, s->base.name, fname );
@@ -783,7 +783,7 @@ rel_create_func(mvc *sql, dlist *qname, 
                                        f->mod = _STRDUP("rapi");
                                        f->imp = _STRDUP("eval");
                                        if (res && restype)
-                                               f->res = *restype;
+                                               f->res = restype;
                                        f->sql = 0; /* native */
                                }
                        } else if (body) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to