Changeset: 24e766144658 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24e766144658
Modified Files:
        clients/ChangeLog.Oct2012
        clients/mapiclient/mclient.1
        clients/mapiclient/mclient.c
        monetdb5/extras/jaql/jaql.mal
        monetdb5/extras/jaql/jaqlgencode.c
        monetdb5/optimizer/opt_wrapper.c
Branch: default
Log Message:

Merge with Oct2012 branch.


diffs (269 lines):

diff --git a/clients/ChangeLog.Oct2012 b/clients/ChangeLog.Oct2012
--- a/clients/ChangeLog.Oct2012
+++ b/clients/ChangeLog.Oct2012
@@ -1,6 +1,9 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Tue Sep  4 2012 Fabian Groffen <fab...@cwi.nl>
+- mclient now accepts URIs as database to connect to.
+
 * Thu Jul 19 2012 Gijs Molenaar <g.j.molen...@uva.nl>
 - all strings returned by python2 are unicode, removed use_unicode option
 - python2 and 3 type convertion speed improvements
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -114,10 +114,12 @@ option is omitted, the default of
 is assumed.
 .TP
 \fB\-\-database=\fP\fIdatabase\fP (\fB\-d\fP \fIdatabase\fP)
-Specify the name of the database to connect to.  The \fB-d\fP can be
+Specify the name or URI of the database to connect to.  The \fB-d\fP can be
 omitted if an equally named file does not exist in the current
 directory.  As such, the first non-option argument will be interpreted
 as database to connect to if the argument does not exist as file.
+Valid URIs are as returned by
+.RB "`monetdb discover`, see " monetdb "(1), and look like " 
"mapi:monetdb://hostname:port/database" .
 .TP
 \fB\-\-host=\fP\fIhostname\fP (\fB\-h\fP \fIhostname\fP)
 Specify the name of the host on which the server runs (default:
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2595,7 +2595,7 @@ usage(const char *prog, int xit)
 #endif
        fprintf(stderr, " -p portnr   | --port=portnr      port to connect 
to\n");
        fprintf(stderr, " -u user     | --user=user        user id\n");
-       fprintf(stderr, " -d database | --database=database  database to 
connect to\n");
+       fprintf(stderr, " -d database | --database=database  database to 
connect to (may be URI)\n");
 
        fprintf(stderr, " -e          | --echo             echo the query\n");
 #ifdef HAVE_ICONV
@@ -3003,7 +3003,13 @@ main(int argc, char **argv)
                has_fileargs = optind != argc;
        }
 
-       mid = mapi_connect(host, port, user, passwd, language, dbname);
+       if (dbname != NULL && strncmp(dbname, "mapi:monetdb://", 15) == 0) {
+               mid = mapi_mapiuri(dbname, user, passwd, language);
+       } else {
+               mid = mapi_mapi(host, port, user, passwd, language, dbname);
+       }
+       if (mid && mapi_error(mid) == MOK)
+               mapi_reconnect(mid);    /* actually, initial connect */
 
        if (mid == NULL) {
                fprintf(stderr, "failed to allocate Mapi structure\n");
diff --git a/monetdb5/extras/jaql/jaql.mal b/monetdb5/extras/jaql/jaql.mal
--- a/monetdb5/extras/jaql/jaql.mal
+++ b/monetdb5/extras/jaql/jaql.mal
@@ -37,22 +37,6 @@ pattern cast(b:bat[:oid,:any], t:any_1):
 address JAQLcast
 comment "Return BAT b as BAT with tail type of t, if the BAT tail in reality 
is of that type";
 
-# select wrappers that preserve order
-function select(b:bat[:oid,:any_1], v:any_1):bat[:oid,:any_1];
-       j := algebra.markT(b, 0@0);
-       a := algebra.markH(b, 0@0);
-       q := algebra.select(a, v);
-       l := algebra.leftjoin(j, q);
-       return l;
-end select
-function uselect(b:bat[:oid,:any_1], v:any_1):bat[:oid,:void];
-       l := algebra.markT(b, 0@0);
-       r := algebra.markH(b, 0@0);
-       e := algebra.uselect(r, v);
-       s := algebra.leftjoin(l, e);
-       return s;
-end uselect
-
 # scenario functions and init call
 command prelude()
 address JAQLprelude;
diff --git a/monetdb5/extras/jaql/jaqlgencode.c 
b/monetdb5/extras/jaql/jaqlgencode.c
--- a/monetdb5/extras/jaql/jaqlgencode.c
+++ b/monetdb5/extras/jaql/jaqlgencode.c
@@ -159,7 +159,7 @@ dumparrrefvar(MalBlkPtr mb, tree *t, int
 
        /* array indirection, entries must be arrays */
        q = newInstruction(mb, ASSIGNsymbol);
-       setModuleId(q, putName("jaql", 4));
+       setModuleId(q, algebraRef);
        setFunctionId(q, uselectRef);
        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
        q = pushArgument(mb, q, elems);
@@ -270,7 +270,7 @@ dumparrrefvar(MalBlkPtr mb, tree *t, int
                pushInstruction(mb, q);
 
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, b);
@@ -370,7 +370,7 @@ dumprefvar(jc *j, MalBlkPtr mb, tree *t,
                } else {
                        MALCOMMENT(mb, "| dereferencing %s", t->sval);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, a);
@@ -416,7 +416,7 @@ dumprefvar(jc *j, MalBlkPtr mb, tree *t,
                        a = getArg(q, 0);
                        pushInstruction(mb, q);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, a);
@@ -1082,7 +1082,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                        b = getArg(q, 0);
                        pushInstruction(mb, q);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, b);
@@ -1102,7 +1102,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                switch (t->tval2->cval) {
                        case j_equals:
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -1112,7 +1112,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                                break;
                        case j_nequal:
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -1257,7 +1257,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                /* booleans can only be compared with j_equals and
                 * j_nequal */
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, c);
@@ -1265,7 +1265,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                e = getArg(q, 0);
                pushInstruction(mb, q);
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, c);
@@ -1282,7 +1282,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                pushInstruction(mb, q);
 
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, d);
@@ -1290,7 +1290,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                e = getArg(q, 0);
                pushInstruction(mb, q);
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, d);
@@ -2385,7 +2385,7 @@ dumppredjoin(jc *j, MalBlkPtr mb, json_v
                                l = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, selectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, l);
@@ -3489,7 +3489,7 @@ dumpvariabletransformation(jc *j, Client
                                c = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, c);
@@ -4184,7 +4184,7 @@ dumpvariabletransformation(jc *j, Client
                                                                b = getArg(q, 
0);
                                                                
pushInstruction(mb, q);
                                                                q = 
newInstruction(mb, ASSIGNsymbol);
-                                                               setModuleId(q, 
putName("jaql", 4));
+                                                               setModuleId(q, 
algebraRef);
                                                                
setFunctionId(q, selectRef);
                                                                q = 
pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                                                                q = 
pushArgument(mb, q, b);
@@ -4192,7 +4192,7 @@ dumpvariabletransformation(jc *j, Client
                                                                c = getArg(q, 
0);
                                                                
pushInstruction(mb, q);
                                                                q = 
newInstruction(mb, ASSIGNsymbol);
-                                                               setModuleId(q, 
putName("jaql", 4));
+                                                               setModuleId(q, 
algebraRef);
                                                                
setFunctionId(q, selectRef);
                                                                q = 
pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                                                                q = 
pushArgument(mb, q, b);
@@ -4790,7 +4790,7 @@ dumpvalsfromarr(MalBlkPtr mb, enum treet
        a = dumpwalkvar(mb, j1, j5);
 
        q = newInstruction(mb, ASSIGNsymbol);
-       setModuleId(q, putName("jaql", 4));
+       setModuleId(q, algebraRef);
        setFunctionId(q, selectRef);
        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
        q = pushArgument(mb, q, a);
@@ -5472,7 +5472,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                pushInstruction(mb, q);
 
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, a);
@@ -5562,7 +5562,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                b = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, selectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -6294,7 +6294,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                        f = getArg(q, 0);
                                        pushInstruction(mb, q);
                                        q = newInstruction(mb, ASSIGNsymbol);
-                                       setModuleId(q, putName("jaql", 4));
+                                       setModuleId(q, algebraRef);
                                        setFunctionId(q, uselectRef);
                                        q = pushReturn(mb, q, 
newTmpVariable(mb, TYPE_any));
                                        q = pushArgument(mb, q, e);
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -106,7 +106,7 @@ struct{
        {"prejoin", &OPTprejoinImplementation},
        {"pushranges", &OPTpushrangesImplementation},
        {"dumpQEP", &OPTdumpQEPImplementation},
-       {"recycler", &OPTrecyclerImplementation},
+       {"recycle", &OPTrecyclerImplementation},
        {"reduce", &OPTreduceImplementation},
        {"remap", &OPTremapImplementation},
        {"remoteQueries", &OPTremoteQueriesImplementation},
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to