Changeset: 1840cea59098 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1840cea59098
Modified Files:
        clients/mapiclient/Tests/mclient--help.stable.err
        clients/mapiclient/Tests/mclient--help.stable.err.Windows
        clients/mapiclient/mclient.c
        clients/mapiclient/tomograph.c
        gdk/gdk_aggr.c
        gdk/gdk_align.c
        gdk/gdk_bat.c
        gdk/gdk_batop.c
        gdk/gdk_cross.c
        gdk/gdk_join.c
        gdk/gdk_search.c
        gdk/gdk_storage.c
        monetdb5/modules/atoms/batxml.c
        monetdb5/modules/atoms/json.c
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/mal/bbp.c
        monetdb5/modules/mal/joinpath.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/txtsim.c
        sql/server/rel_optimizer.c
Branch: mosaic
Log Message:

Merge with default branch.


diffs (truncated from 557 to 300 lines):

diff --git a/clients/mapiclient/Tests/mclient--help.stable.err 
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -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[=tm] interpret \ commands on stdin, use time 
formatting {ms,s,m}
+ -i          | --interactive[=tm] interpret `\' commands on stdin, 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/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[=tm] interpret \ commands on stdin, use time 
formatting {ms,s,m}
+ -i          | --interactive[=tm] interpret `\' commands on stdin, 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/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2861,7 +2861,7 @@ usage(const char *prog, int xit)
 #endif
        fprintf(stderr, " -f kind     | --format=kind      specify output 
format {csv,tab,raw,sql,xml}\n");
        fprintf(stderr, " -H          | --history          load/save cmdline 
history (default off)\n");
-       fprintf(stderr, " -i          | --interactive[=tm] interpret \\ 
commands on stdin, use time formatting {ms,s,m}\n");
+       fprintf(stderr, " -i          | --interactive[=tm] interpret `\\' 
commands on stdin, use time formatting {ms,s,m}\n");
        fprintf(stderr, " -l language | --language=lang    {sql,mal}\n");
        fprintf(stderr, " -L logfile  | --log=logfile      save client/server 
interaction\n");
        fprintf(stderr, " -s stmt     | --statement=stmt   run single 
statement\n");
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -8,11 +8,11 @@
 
 /* (c) M Kersten, S Manegold
  * The easiest calling method is something like:
- * tomograph -d demo --atlast=10
+ * tomograph -d demo --atlas=10
  * which connects to the demo database server and
  * will collect the tomograph pages for at most 10 SQL queries
  * For each page a gnuplot file, a data file, and the event trace
- * are collected for more focussed analysis.
+ * are collected for more focused analysis.
  * 
 */
 
@@ -68,7 +68,7 @@
                        die(dbh, hdl);                  \
        } while (0)
 
-#define DBNAME (dbname?dbname:(inputfile?inputfile:"unkown"))
+#define DBNAME (dbname?dbname:(inputfile?inputfile:"unknown"))
 
 static stream *conn = NULL;
 static char hostname[128];
@@ -104,7 +104,7 @@ static int source[MAXTHREADS];
 
 /* color map management, fixed */
 /* see 
http://www.uni-hamburg.de/Wiss/FB/15/Sustainability/schneider/gnuplot/colors.htm
 */
-/* The initial dictionary is geared towars TPCH-use */
+/* The initial dictionary is geared towards TPCH-use */
 typedef struct COLOR {
        int freq;
        lng timeused;
@@ -452,7 +452,7 @@ usageTomograph(void)
        fprintf(stderr, "  -r | --range=<starttime>-<endtime>[ms,s] \n");
        fprintf(stderr, "  -i | --input=<profiler event file > \n");
        fprintf(stderr, "  -o | --output=<file prefix > (default 
'tomograph'\n");
-    fprintf(stderr, "  -c | --cache=<query pool location>\n");
+       fprintf(stderr, "  -c | --cache=<query pool location>\n");
        fprintf(stderr, "  -s | --system=# (on= 1(default) off=0\n");
        fprintf(stderr, "  -b | --beat=<delay> in milliseconds (default 
5000)\n");
        fprintf(stderr, "  -A | --atlas=<number> maximum number of queries 
(default 1)\n");
@@ -1722,12 +1722,16 @@ main(int argc, char **argv)
        }
 
        fprintf(stderr,"-- Stop capturing with <cntrl-c> or after %d 
pages\n",atlas);
-       if (cache)
+       if (cache) {
+               snprintf(cachebuf,BUFSIZ,"%s%c",cache, DIR_SEP);
 #ifdef NATIVE_WIN32
-               snprintf(cachebuf,BUFSIZ,"%s\\",cache);
-#else
-               snprintf(cachebuf,BUFSIZ,"%s/",cache);
+#define mkdir(d,m)     _mkdir(d)
 #endif
+               if( mkdir(cache,0755) < 0 && errno != EEXIST) {
+                       fprintf(stderr,"Failed to create cache '%s'\n",cache);
+                       exit(-1);
+               }
+       }
        initcolors();
        resetTomograph();
 
@@ -1758,16 +1762,6 @@ main(int argc, char **argv)
        close(0);
 
        /* reprocess an existing profiler trace, possibly producing the trace 
split   */
-       if (cache) {
-#ifdef NATIVE_WIN32
-               if( _mkdir(cache) < 0 && errno != EEXIST){
-#else
-               if( mkdir(cache,0755)  < 0 && errno != EEXIST) {
-#endif
-                       fprintf(stderr,"Failed to create cache '%s'\n",cache);
-                       exit(-1);
-               }
-       }
        snprintf(buf,BUFSIZ,"%s%s_%s_%02d.trace", cachebuf, basefilename, 
DBNAME, atlaspage);
        if (inputfile==0 || strcmp(buf, inputfile) ){
                // avoid overwriting yourself
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -1586,8 +1586,7 @@ BATgroupavg(BAT **bnp, BAT **cntsp, BAT 
                BBPunfix(bn->batCacheid);
        GDKfree(rems);
        if (cntsp) {
-               if (*cntsp)
-                       BBPreclaim(*cntsp);
+               BBPreclaim(*cntsp);
        } else if (cnts) {
                GDKfree(cnts);
        }
@@ -2947,8 +2946,7 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
                BBPreclaim(*avgb);
        else
                GDKfree(mean);
-       if (bn)
-               BBPreclaim(bn);
+       BBPreclaim(bn);
        GDKfree(delta);
        GDKfree(m2);
        GDKfree(cnts);
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -724,8 +724,7 @@ VIEWreset(BAT *b)
        }
        return GDK_SUCCEED;
       bailout:
-       if (v != NULL)
-               BBPreclaim(v);
+       BBPreclaim(v);
        if (n != NULL)
                BBPunfix(n->batCacheid);
        HEAPfree(&head, 0);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -852,10 +852,10 @@ BATcopy(BAT *b, int ht, int tt, int writ
                        bthp.farmid = BBPselectfarm(role, b->ttype, offheap);
                        hhp.farmid = BBPselectfarm(role, b->htype, varheap);
                        thp.farmid = BBPselectfarm(role, b->ttype, varheap);
-                       if ((b->htype && heapcopy(bn, "head", &bhhp, 
&b->H->heap) < 0) ||
-                           (b->ttype && heapcopy(bn, "tail", &bthp, 
&b->T->heap) < 0) ||
-                           (bn->H->vheap && heapcopy(bn, "hheap", &hhp, 
b->H->vheap) < 0) ||
-                           (bn->T->vheap && heapcopy(bn, "theap", &thp, 
b->T->vheap) < 0)) {
+                       if ((b->htype && heapcopy(bn, "head", &bhhp, 
&b->H->heap) != GDK_SUCCEED) ||
+                           (b->ttype && heapcopy(bn, "tail", &bthp, 
&b->T->heap) != GDK_SUCCEED) ||
+                           (bn->H->vheap && heapcopy(bn, "hheap", &hhp, 
b->H->vheap) != GDK_SUCCEED) ||
+                           (bn->T->vheap && heapcopy(bn, "theap", &thp, 
b->T->vheap) != GDK_SUCCEED)) {
                                HEAPfree(&thp, 1);
                                HEAPfree(&hhp, 1);
                                HEAPfree(&bthp, 1);
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -611,8 +611,7 @@ BATins(BAT *b, BAT *n, bit force)
        }
        res = GDK_SUCCEED;
       bunins_failed:
-       if (tmp)
-               BBPreclaim(tmp);
+       BBPreclaim(tmp);
        return res;
 }
 
@@ -1497,8 +1496,7 @@ BATsubsort(BAT **sorted, BAT **order, BA
   error:
        if (bn)
                BBPunfix(bn->batCacheid);
-       if (on)
-               BBPreclaim(on);
+       BBPreclaim(on);
        if (sorted)
                *sorted = NULL;
        if (order)
diff --git a/gdk/gdk_cross.c b/gdk/gdk_cross.c
--- a/gdk/gdk_cross.c
+++ b/gdk/gdk_cross.c
@@ -22,10 +22,8 @@ BATcross1(BAT **r1p, BAT **r2p, BAT *l, 
        bn1 = BATnew(TYPE_void, TYPE_oid, BATcount(l) * BATcount(r), TRANSIENT);
        bn2 = BATnew(TYPE_void, TYPE_oid, BATcount(l) * BATcount(r), TRANSIENT);
        if (bn1 == NULL || bn2 == NULL) {
-               if (bn1 != NULL)
-                       BBPreclaim(bn1);
-               if (bn2 != NULL)
-                       BBPreclaim(bn2);
+               BBPreclaim(bn1);
+               BBPreclaim(bn2);
                return GDK_FAIL;
        }
        BATseqbase(bn1, 0);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -116,10 +116,8 @@ joininitresults(BAT **r1p, BAT **r2p, BU
        r1 = BATnew(TYPE_void, TYPE_oid, size, TRANSIENT);
        r2 = BATnew(TYPE_void, TYPE_oid, size, TRANSIENT);
        if (r1 == NULL || r2 == NULL) {
-               if (r1)
-                       BBPreclaim(r1);
-               if (r2)
-                       BBPreclaim(r2);
+               BBPreclaim(r1);
+               BBPreclaim(r2);
                *r1p = *r2p = NULL;
                GDKerror("%s: cannot create output BATs.\n", func);
                return GDK_FAIL;
@@ -2078,10 +2076,8 @@ hashjoin(BAT *r1, BAT *r2, BAT *l, BAT *
        return GDK_SUCCEED;
 
   bailout:
-       if (r1)
-               BBPreclaim(r1);
-       if (r2)
-               BBPreclaim(r2);
+       BBPreclaim(r1);
+       BBPreclaim(r2);
        return GDK_FAIL;
 }
 
@@ -2310,10 +2306,8 @@ thetajoin(BAT *r1, BAT *r2, BAT *l, BAT 
        return GDK_SUCCEED;
 
   bailout:
-       if (r1)
-               BBPreclaim(r1);
-       if (r2)
-               BBPreclaim(r2);
+       BBPreclaim(r1);
+       BBPreclaim(r2);
        return GDK_FAIL;
 }
 
@@ -2713,10 +2707,8 @@ bandjoin(BAT *r1, BAT *r2, BAT *l, BAT *
        return GDK_SUCCEED;
 
   bailout:
-       if (r1)
-               BBPreclaim(r1);
-       if (r2)
-               BBPreclaim(r2);
+       BBPreclaim(r1);
+       BBPreclaim(r2);
        return GDK_FAIL;
 }
 
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -222,8 +222,11 @@ int
 BATcheckhash(BAT *b)
 {
        int ret;
+       lng t;
 
+       t = GDKusec();
        MT_lock_set(&GDKhashLock(abs(b->batCacheid)), "BATcheckhash");
+       t = GDKusec() - t;
        if (b->T->hash == NULL) {
                Hash *h;
                Heap *hp;
@@ -287,7 +290,7 @@ BATcheckhash(BAT *b)
        }
        ret = b->T->hash != NULL;
        MT_lock_unset(&GDKhashLock(abs(b->batCacheid)), "BATcheckhash");
-       ALGODEBUG if (ret) fprintf(stderr, "#BATcheckhash: already has hash 
%d\n", b->batCacheid);
+       ALGODEBUG if (ret) fprintf(stderr, "#BATcheckhash: already has hash %d, 
waited " LLFMT " usec\n", b->batCacheid, t);
        return ret;
 }
 
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -302,7 +302,9 @@ GDKextendf(int fd, size_t size, const ch
        IODEBUG fprintf(stderr, "#GDKextend %s " SZFMT " -> " SZFMT " %dms%s\n",
                        fn, (size_t) stb.st_size, size,
                        GDKms() - t0, rt < 0 ? " (failed)" : "");
-       /* return 0 or -1 (posix_fallocate returns != 0 on failure) */
+       /* posix_fallocate returns != 0 on failure, fallocate and
+        * ftruncate return -1 on failure, but all three return 0 on
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to