Changeset: ae87974021b3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae87974021b3
Modified Files:
        configure.ag
        monetdb5/mal/Tests/tst273.mal
        monetdb5/mal/Tests/tst274.mal
        monetdb5/mal/Tests/tst903.mal
        monetdb5/mal/Tests/tst911.mal
        monetdb5/mal/Tests/tst911.stable.out
        monetdb5/mal/Tests/tst912.mal
        monetdb5/mal/Tests/venks.mal
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/modules/mal/Makefile.ag
        monetdb5/modules/mal/tablet.c
        monetdb5/modules/mal/tablet.h
        monetdb5/modules/mal/tablet.mal
        monetdb5/modules/mal/tablet_sql.c
        monetdb5/optimizer/Tests/dataflow.mal
Branch: headless
Log Message:

Merge with default branch.


diffs (truncated from 3188 to 300 lines):

diff --git a/clients/ChangeLog b/clients/ChangeLog
--- a/clients/ChangeLog
+++ b/clients/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Tue Aug 23 2011 Fabian Groffen <[email protected]>
+- Report full URI to database instead of just database when available
+  in mclient.
+
 * Thu Aug 18 2011 Fabian Groffen <[email protected]>
 - The time format of the timer output can now be controlled with an
   optional argument to the -i option.  ms, s and m force the time to be
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err.Windows 
b/clients/mapiclient/Tests/mclient--help.stable.err.Windows
--- a/clients/mapiclient/Tests/mclient--help.stable.err.Windows
+++ b/clients/mapiclient/Tests/mclient--help.stable.err.Windows
@@ -21,7 +21,7 @@ Options are:
  -E charset  | --encoding=charset specify encoding (character set) of the 
terminal
  -f kind     | --format=kind      specify output format {csv,tab,raw,sql,xml}
  -H          | --history         load/save cmdline history (default off)
- -i          | --interactive     read stdin after command line args
+ -i          | --interactive[=tm] read stdin after command line args, use time 
formatting {ms,s,m}
  -l language | --language=lang    {sql,mal}
  -L logfile  | --log=logfile     save client/server interaction
  -s stmt     | --statement=stmt  run single statement
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1896,13 +1896,13 @@ void
 dump_version(Mapi mid, stream *toConsole, const char *prefix)
 {
        MapiHdl hdl;
-       char *dbname = NULL, m5ver[24];
+       char *dbname = NULL, *uri = NULL, m5ver[24];
        char *name, *val;
 
        if ((hdl = mapi_query(mid,
                              "SELECT \"name\", \"value\" "
                              "FROM sys.env() AS env "
-                             "WHERE \"name\" IN ('gdk_dbname', 
'monet_version')")) == NULL ||
+                             "WHERE \"name\" IN ('gdk_dbname', 
'monet_version', 'merovingian_uri')")) == NULL ||
            mapi_error(mid))
                goto cleanup;
 
@@ -1919,8 +1919,15 @@ dump_version(Mapi mid, stream *toConsole
                                dbname = strdup(val);
                        else if (strcmp(name, "monet_version") == 0)
                                snprintf(m5ver, sizeof(m5ver), "%s", val);
+                       else if (strcmp(name, "merovingian_uri") == 0)
+                               uri = strdup(val);
                }
        }
+       if (uri != NULL) {
+               if (dbname != NULL)
+                       free(dbname);
+               dbname = uri;
+       }
        if (dbname != NULL && *dbname != '\0' && m5ver[0] != '\0')
                mnstr_printf(toConsole, "%s MonetDB v%s, '%s'\n",
                             prefix, m5ver, dbname);
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2434,10 +2434,9 @@ bs_read(stream *ss, void *buf, size_t el
                short blksize = 0;
 
                if (s->nr) {
-                       /* We read the closing block but hadn't returned that 
yet.
-                          Return it now, and note that we did by setting s->nr 
to
-                          0.
-                        */
+                       /* We read the closing block but hadn't
+                        * returned that yet. Return it now, and note
+                        * that we did by setting s->nr to 0. */
                        assert(s->nr == 1);
                        s->nr = 0;
                        return 0;
@@ -2446,7 +2445,7 @@ bs_read(stream *ss, void *buf, size_t el
                assert(s->nr == 0);
 
                /* There is nothing more to read in the current block,
-                  so read the count for the next block */
+                * so read the count for the next block */
                if (!mnstr_readSht(s->s, &blksize) || blksize < 0) {
                        ss->errnr = MNSTR_READ_ERROR;
                        return -1;
@@ -2465,8 +2464,8 @@ bs_read(stream *ss, void *buf, size_t el
        /* Fill the caller's buffer. */
        cnt = 0;                /* count how much we put into the buffer */
        while (todo > 0) {
-               /* there is more data waiting in the current block,
-                  so read it */
+               /* there is more data waiting in the current block, so
+                * read it */
                n = todo < s->itotal ? todo : s->itotal;
                while (n > 0) {
                        ssize_t m = s->s->read(s->s, buf, 1, n);
@@ -2499,8 +2498,8 @@ bs_read(stream *ss, void *buf, size_t el
                        short blksize = 0;
 
                        /* The current block has been completely read,
-                          so read the count for the next block, only if the
-                          previous was not the last one */
+                        * so read the count for the next block, only
+                        * if the previous was not the last one */
                        if (s->nr) {
                                break;
                        } else if (!mnstr_readSht(s->s, &blksize) || blksize < 
0) {
@@ -2520,9 +2519,9 @@ bs_read(stream *ss, void *buf, size_t el
                }
        }
        /* if we got an empty block with the end-of-sequence marker
-          set (low-order bit) we must only return an empty read once, so
-          we must squash the flag that we still have to return an empty
-          read */
+        * set (low-order bit) we must only return an empty read once,
+        * so we must squash the flag that we still have to return an
+        * empty read */
        if (todo > 0 && cnt == 0)
                s->nr = 0;
        return (ssize_t) (cnt / elmsize);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2378,6 +2378,8 @@ case "$host_os" in
                AC_CHECK_FUNC(gethostbyname_r, [], [
                  AC_CHECK_LIB(nsl_r, gethostbyname_r, [ SOCKET_LIBS="-lnsl_r" 
],
                        AC_CHECK_LIB(nsl, gethostbyname_r, [ 
SOCKET_LIBS="-lnsl"   ] ))])
+               AC_CHECK_FUNC(hstrerror, [], [
+                 AC_CHECK_LIB(resolv, hstrerror, [ SOCKET_LIBS="$SOCKET_LIBS 
-lresolv" ])])
                ;;
 esac
 
diff --git a/monetdb5/mal/Tests/tst273.mal b/monetdb5/mal/Tests/tst273.mal
--- a/monetdb5/mal/Tests/tst273.mal
+++ b/monetdb5/mal/Tests/tst273.mal
@@ -1,5 +1,6 @@
 # the multiplex code blocks.
 
+r:= mmath.srand(0);
 t0:= alarm.usec();
 b:= column.new(:lng);
 barrier (go,i):= language.newRange(0:lng);
diff --git a/monetdb5/mal/Tests/tst273.stable.out 
b/monetdb5/mal/Tests/tst273.stable.out
--- a/monetdb5/mal/Tests/tst273.stable.out
+++ b/monetdb5/mal/Tests/tst273.stable.out
@@ -49,6 +49,7 @@ stdout of test 'tst273` in directory 'ma
 #
 function user.main():void;
 # the multiplex code blocks. 
+    r := mmath.srand(0);
     t0 := alarm.usec();
     b := bat.new(:oid,:lng);
 barrier (go,i) := language.newRange(0:lng);
diff --git a/monetdb5/mal/Tests/tst274.mal b/monetdb5/mal/Tests/tst274.mal
--- a/monetdb5/mal/Tests/tst274.mal
+++ b/monetdb5/mal/Tests/tst274.mal
@@ -1,6 +1,7 @@
 # the multiplex code blocks.
 #watch out, the random generator on SUN has a limited range.
 
+r:= mmath.srand(0);
 t0:= alarm.usec();
 b:= column.new(:lng);
 barrier (go,i):= language.newRange(0:lng);
diff --git a/monetdb5/mal/Tests/tst274.stable.out 
b/monetdb5/mal/Tests/tst274.stable.out
--- a/monetdb5/mal/Tests/tst274.stable.out
+++ b/monetdb5/mal/Tests/tst274.stable.out
@@ -18,6 +18,7 @@ stdout of test 'tst274` in directory 'ma
 function user.main():void;
 # the multiplex code blocks. 
 #watch out, the random generator on SUN has a limited range. 
+    r := mmath.srand(0);
     t0 := alarm.usec();
     b := bat.new(:oid,:lng);
 barrier (go,i) := language.newRange(0:lng);
diff --git a/monetdb5/mal/Tests/tst274.stable.out.oid64 
b/monetdb5/mal/Tests/tst274.stable.out.oid64
--- a/monetdb5/mal/Tests/tst274.stable.out.oid64
+++ b/monetdb5/mal/Tests/tst274.stable.out.oid64
@@ -52,6 +52,7 @@ stdout of test 'tst274` in directory 'ma
 function user.main():void;
 # the multiplex code blocks. 
 #watch out, the random generator on SUN has a limited range. 
+    r := mmath.srand(0);
     t0 := alarm.usec();
     b := bat.new(:oid,:lng);
 barrier (go,i) := language.newRange(0:lng);
diff --git a/monetdb5/mal/Tests/tst903.mal b/monetdb5/mal/Tests/tst903.mal
--- a/monetdb5/mal/Tests/tst903.mal
+++ b/monetdb5/mal/Tests/tst903.mal
@@ -10,6 +10,7 @@ dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_u
 dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
 mdb.setDebug(dbgmsk_set);
 
+r:= mmath.srand(0);
 barrier (go,i):= language.newRange(0:lng);
        k:= mmath.rand();
        l:= calc.lng(k);
diff --git a/monetdb5/mal/Tests/tst903.stable.out 
b/monetdb5/mal/Tests/tst903.stable.out
--- a/monetdb5/mal/Tests/tst903.stable.out
+++ b/monetdb5/mal/Tests/tst903.stable.out
@@ -138,6 +138,7 @@ function user.main():void;
     dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_unset);
     dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
     mdb.setDebug(dbgmsk_set);
+    r := mmath.srand(0);
 barrier (go,i) := language.newRange(0:lng);
     k := mmath.rand();
     l := calc.lng(k);
@@ -245,14 +246,14 @@ exit (go,i);
     cnt := aggr.count(z9);
     mdb.setDebug(dbgmsk_set);
     t0 := alarm.usec();
-    X_99 := bat.new(nil:oid,nil:lng);
-barrier (X_103,X_104,X_105) := bat.newIterator(b);
-    X_107 := algebra.find(c,X_104);
-    X_109 := calc.+(X_105,X_107);
-    bat.insert(X_99,X_104,X_109);
-    redo (X_103,X_104,X_105) := bat.hasMoreElements(b);
-exit (X_103,X_104,X_105);
-    x:bat[:oid,:lng]  := X_99;
+    X_101 := bat.new(nil:oid,nil:lng);
+barrier (X_105,X_106,X_107) := bat.newIterator(b);
+    X_109 := algebra.find(c,X_106);
+    X_111 := calc.+(X_107,X_109);
+    bat.insert(X_101,X_106,X_111);
+    redo (X_105,X_106,X_107) := bat.hasMoreElements(b);
+exit (X_105,X_106,X_107);
+    x:bat[:oid,:lng]  := X_101;
     t1 := alarm.usec();
     mdb.setDebug(dbgmsk_restore);
     d0 := calc.-(t1,t0);
diff --git a/monetdb5/mal/Tests/tst911.mal b/monetdb5/mal/Tests/tst911.mal
--- a/monetdb5/mal/Tests/tst911.mal
+++ b/monetdb5/mal/Tests/tst911.mal
@@ -40,6 +40,7 @@ dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_u
 dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
 mdb.setDebug(dbgmsk_set);
 
+r:= mmath.srand(0);
 barrier (go,i):= language.newRange(0:lng);
        k:= mmath.rand();
        l:= calc.lng(k);
diff --git a/monetdb5/mal/Tests/tst911.stable.out 
b/monetdb5/mal/Tests/tst911.stable.out
--- a/monetdb5/mal/Tests/tst911.stable.out
+++ b/monetdb5/mal/Tests/tst911.stable.out
@@ -96,6 +96,7 @@ function user.main():void;
     dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_unset);
     dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
     mdb.setDebug(dbgmsk_set);
+    r := mmath.srand(0);
 barrier (go,i) := language.newRange(0:lng);
     k := mmath.rand();
     l := calc.lng(k);
diff --git a/monetdb5/mal/Tests/tst912.mal b/monetdb5/mal/Tests/tst912.mal
--- a/monetdb5/mal/Tests/tst912.mal
+++ b/monetdb5/mal/Tests/tst912.mal
@@ -59,6 +59,7 @@ dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_u
 dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
 mdb.setDebug(dbgmsk_set);
 
+r:= mmath.srand(0);
 barrier (go,i):= language.newRange(0:lng);
        k:= mmath.rand();
        l:= calc.lng(k);
diff --git a/monetdb5/mal/Tests/tst912.stable.out 
b/monetdb5/mal/Tests/tst912.stable.out
--- a/monetdb5/mal/Tests/tst912.stable.out
+++ b/monetdb5/mal/Tests/tst912.stable.out
@@ -122,6 +122,7 @@ function user.main():void;
     dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_unset);
     dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
     mdb.setDebug(dbgmsk_set);
+    r := mmath.srand(0);
 barrier (go,i) := language.newRange(0:lng);
     k := mmath.rand();
     l := calc.lng(k);
diff --git a/monetdb5/mal/Tests/venks.mal b/monetdb5/mal/Tests/venks.mal
--- a/monetdb5/mal/Tests/venks.mal
+++ b/monetdb5/mal/Tests/venks.mal
@@ -12,6 +12,7 @@ dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_u
 dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
 mdb.setDebug(dbgmsk_set);
 
+r:= mmath.srand(0);
 barrier (go,i):= language.newRange(0:lng);
        k:= mmath.rand();
        l:= calc.int(k);
diff --git a/monetdb5/mal/Tests/venks.stable.out 
b/monetdb5/mal/Tests/venks.stable.out
--- a/monetdb5/mal/Tests/venks.stable.out
+++ b/monetdb5/mal/Tests/venks.stable.out
@@ -87,6 +87,7 @@ function user.main():void;
     dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_unset);
     dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
     mdb.setDebug(dbgmsk_set);
+    r := mmath.srand(0:int);
 barrier (go,i) := language.newRange(0:lng);
     k := mmath.rand();
     l := calc.int(k);
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to