Changeset: 325902ac6356 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=325902ac6356
Added Files:
        sql/test/remote/Tests/ssbm.stable.err
        sql/test/remote/Tests/ssbm.stable.out
Modified Files:
        clients/Tests/MAL-signatures_all.stable.out
        clients/Tests/MAL-signatures_all.stable.out.int128
        clients/Tests/SQL-dump_all.stable.out.int128
        clients/Tests/SQL-dump_all.stable.out.oid32.int128
        clients/Tests/exports.stable.out
        gdk/gdk_atoms.c
        gdk/gdk_batop.c
        gdk/gdk_heap.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
        gdk/gdk_search.c
        gdk/gdk_select.c
        monetdb5/modules/mal/remote.c
Branch: newstorage
Log Message:

merged with default


diffs (truncated from 922 to 300 lines):

diff --git a/clients/Tests/MAL-signatures_all.stable.out 
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -2396,17 +2396,9 @@ command algebra.not_like(s:str,pat:str):
 address PCREnotlike2;
 command algebra.not_like(s:str,pat:str,esc:str):bit 
 address PCREnotlike3;
-pattern algebra.project(b:bat[:any_2,:any_1],v:any_3):bat[:any_2,:any_3] 
+pattern algebra.project(b:bat[:oid,:any_1],v:any_3):bat[:oid,:any_3] 
 address ALGprojecttail;
-comment Fill the tail with a constant, e.g. [0~b]
-
-pattern algebra.project(v:any_3,b:bat[:any_2,:any_1]):bat[:any_3,:any_1] 
-address ALGprojecthead;
-comment Fill the head with a constant, e.g. [0~b]
-
-command algebra.project(b:bat[:any_1,:any_2]):bat[:any_1,:void] 
-address ALGprojectNIL;
-comment Extract the head of a BAT.
+comment Fill the tail with a constant
 
 command algebra.reuse(b:bat[:oid,:any_1]):bat[:oid,:any_1] 
 address ALGreuse;
diff --git a/clients/Tests/MAL-signatures_all.stable.out.int128 
b/clients/Tests/MAL-signatures_all.stable.out.int128
--- a/clients/Tests/MAL-signatures_all.stable.out.int128
+++ b/clients/Tests/MAL-signatures_all.stable.out.int128
@@ -2907,17 +2907,9 @@ command algebra.not_like(s:str,pat:str):
 address PCREnotlike2;
 command algebra.not_like(s:str,pat:str,esc:str):bit 
 address PCREnotlike3;
-pattern algebra.project(b:bat[:any_2,:any_1],v:any_3):bat[:any_2,:any_3] 
+pattern algebra.project(b:bat[:oid,:any_1],v:any_3):bat[:oid,:any_3] 
 address ALGprojecttail;
-comment Fill the tail with a constant, e.g. [0~b]
-
-pattern algebra.project(v:any_3,b:bat[:any_2,:any_1]):bat[:any_3,:any_1] 
-address ALGprojecthead;
-comment Fill the head with a constant, e.g. [0~b]
-
-command algebra.project(b:bat[:any_1,:any_2]):bat[:any_1,:void] 
-address ALGprojectNIL;
-comment Extract the head of a BAT.
+comment Fill the tail with a constant
 
 command algebra.reuse(b:bat[:oid,:any_1]):bat[:oid,:any_1] 
 address ALGreuse;
diff --git a/clients/Tests/SQL-dump_all.stable.out.int128 
b/clients/Tests/SQL-dump_all.stable.out.int128
--- a/clients/Tests/SQL-dump_all.stable.out.int128
+++ b/clients/Tests/SQL-dump_all.stable.out.int128
@@ -7574,7 +7574,7 @@ 5942      "querylog_disable"      "create procedur
 5944   "tracelog"      "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\n-- 
make the offline tracing table available for inspection\ncreate function 
sys.tracelog() \n\treturns table (\n\t\tevent integer,\t\t-- event 
counter\n\t\tclk varchar(20), \t-- wallclock, no mtime in kernel\n\t\tpc 
varchar(50), \t-- module.function[nr]\n\t\tthread int, \t\t-- thread 
identifier\n\t\tticks bigint, \t\t-- time in microseconds\n\t\trrsmb bigint, 
\t\t-- resident memory in MB\n\t\tvmmb bigint, \t\t-- virtual size in 
MB\n\t\treads bigint, \t\t-- number of blocks read\n\t\twrites bigint, \t\t-- 
number of blocks written\n\t\tminflt bigint, \t\t-- minor page 
faults\n\t\tmajflt bigint, \t\t-- major page faults\n\t\tnvcsw bigint, \t\t-- 
non-volantary conext switch\n\t\tstmt string\t\t\t-- actual statement executed\n
 \t)\n\texternal name sql.dump_trace;"  "sql"   1       5       false   false   
false   2000
 5974   "profiler_openstream"   "create procedure profiler_openstream(host 
string, port int) external name profiler.""openStream"";"    "profiler"      1  
     2       true    false   false   2000
 5978   "profiler_stethoscope"  "create procedure profiler_stethoscope(ticks 
int) external name profiler.stethoscope;"  "profiler"      1       2       true 
   false   false   2000
-5981   "epoch" "-- This Source Code Form is subject to the terms of the 
Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not distributed 
with this\n-- file, You can obtain one at http://mozilla.org/MPL/2.0/.\n--\n-- 
Copyright 2008-2015 MonetDB B.V.\n\n-- assume milliseconds when converted to 
TIMESTAMP\ncreate function ""epoch""(sec bigint) returns timestamp\n    
external name timestamp.""epoch"";"  "timestamp"     1       1       false   
false   false   2000
+5981   "epoch" "-- This Source Code Form is subject to the terms of the 
Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not distributed 
with this\n-- file, You can obtain one at http://mozilla.org/MPL/2.0/.\n--\n-- 
Copyright 2008-2015 MonetDB B.V.\n\n-- assume milliseconds when converted to 
TIMESTAMP\ncreate function ""epoch""(sec bigint) returns timestamp\n\texternal 
name timestamp.""epoch"";"    "timestamp"     1       1       false   false   
false   2000
 5985   "epoch" "create function ""epoch""(sec int) returns 
timestamp\n\texternal name timestamp.""epoch"";"    "timestamp"     1       1   
    false   false   false   2000
 5989   "epoch" "create function ""epoch""(ts timestamp) returns 
int\n\texternal name timestamp.""epoch"";"     "timestamp"     1       1       
false   false   false   2000
 5993   "dependencies_schemas_on_users" "-- This Source Code Form is subject to 
the terms of the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was 
not distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB 
B.V.\n\n--Schema s has a dependency on user u\ncreate function 
dependencies_schemas_on_users()\nreturns table (sch varchar(100), usr 
varchar(100), dep_type varchar(32))\nreturn table (select s.name, u.name, 
'DEP_USER' from schemas as s, users u where u.default_schema = s.id);" "user"  
2       5       false   false   false   2000
diff --git a/clients/Tests/SQL-dump_all.stable.out.oid32.int128 
b/clients/Tests/SQL-dump_all.stable.out.oid32.int128
--- a/clients/Tests/SQL-dump_all.stable.out.oid32.int128
+++ b/clients/Tests/SQL-dump_all.stable.out.oid32.int128
@@ -7585,7 +7585,7 @@ 5942      "querylog_disable"      "create procedur
 5944   "tracelog"      "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\n-- 
make the offline tracing table available for inspection\ncreate function 
sys.tracelog() \n\treturns table (\n\t\tevent integer,\t\t-- event 
counter\n\t\tclk varchar(20), \t-- wallclock, no mtime in kernel\n\t\tpc 
varchar(50), \t-- module.function[nr]\n\t\tthread int, \t\t-- thread 
identifier\n\t\tticks bigint, \t\t-- time in microseconds\n\t\trrsmb bigint, 
\t\t-- resident memory in MB\n\t\tvmmb bigint, \t\t-- virtual size in 
MB\n\t\treads bigint, \t\t-- number of blocks read\n\t\twrites bigint, \t\t-- 
number of blocks written\n\t\tminflt bigint, \t\t-- minor page 
faults\n\t\tmajflt bigint, \t\t-- major page faults\n\t\tnvcsw bigint, \t\t-- 
non-volantary conext switch\n\t\tstmt string\t\t\t-- actual statement executed\n
 \t)\n\texternal name sql.dump_trace;"  "sql"   1       5       false   false   
false   2000
 5974   "profiler_openstream"   "create procedure profiler_openstream(host 
string, port int) external name profiler.""openStream"";"    "profiler"      1  
     2       true    false   false   2000
 5978   "profiler_stethoscope"  "create procedure profiler_stethoscope(ticks 
int) external name profiler.stethoscope;"  "profiler"      1       2       true 
   false   false   2000
-5981   "epoch" "-- This Source Code Form is subject to the terms of the 
Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not distributed 
with this\n-- file, You can obtain one at http://mozilla.org/MPL/2.0/.\n--\n-- 
Copyright 2008-2015 MonetDB B.V.\n\n-- assume milliseconds when converted to 
TIMESTAMP\ncreate function ""epoch""(sec bigint) returns timestamp\n    
external name timestamp.""epoch"";"  "timestamp"     1       1       false   
false   false   2000
+5981   "epoch" "-- This Source Code Form is subject to the terms of the 
Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not distributed 
with this\n-- file, You can obtain one at http://mozilla.org/MPL/2.0/.\n--\n-- 
Copyright 2008-2015 MonetDB B.V.\n\n-- assume milliseconds when converted to 
TIMESTAMP\ncreate function ""epoch""(sec bigint) returns timestamp\n\texternal 
name timestamp.""epoch"";"    "timestamp"     1       1       false   false   
false   2000
 5985   "epoch" "create function ""epoch""(sec int) returns 
timestamp\n\texternal name timestamp.""epoch"";"    "timestamp"     1       1   
    false   false   false   2000
 5989   "epoch" "create function ""epoch""(ts timestamp) returns 
int\n\texternal name timestamp.""epoch"";"     "timestamp"     1       1       
false   false   false   2000
 5993   "dependencies_schemas_on_users" "-- This Source Code Form is subject to 
the terms of the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was 
not distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB 
B.V.\n\n--Schema s has a dependency on user u\ncreate function 
dependencies_schemas_on_users()\nreturns table (sch varchar(100), usr 
varchar(100), dep_type varchar(32))\nreturn table (select s.name, u.name, 
'DEP_USER' from schemas as s, users u where u.default_schema = s.id);" "user"  
2       5       false   false   false   2000
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2076,7 +2076,6 @@ str affectedRowsRef;
 str aggrRef;
 str alarmRef;
 str algebraRef;
-int allTargetsVisible(MalBlkPtr mb, Lifespan span, int pc, int qc);
 str antijoinRef;
 str appendRef;
 str appendidxRef;
@@ -2318,7 +2317,6 @@ int isAmbiguousType(int type);
 int isBlocking(InstrPtr p);
 int isDelta(InstrPtr q);
 int isDependent(InstrPtr p, InstrPtr q);
-int isDiffOp(InstrPtr q);
 int isExceptionVariable(str nme);
 int isFragmentGroup(InstrPtr q);
 int isFragmentGroup2(InstrPtr q);
@@ -2506,7 +2504,7 @@ int operatorLength(Client cntxt);
 str operatorName(int i);
 lng optDebug;
 str optimizeMALBlock(Client cntxt, MalBlkPtr mb);
-str optimizerCheck(Client cntxt, MalBlkPtr mb, str name, int actions, lng 
usec, int flag);
+str optimizerCheck(Client cntxt, MalBlkPtr mb, str name, int actions, lng 
usec);
 str optimizerRef;
 str optimizer_prelude(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str pack2Ref;
@@ -2623,8 +2621,6 @@ int safetyBarrier(InstrPtr p, InstrPtr q
 str schedulerRef;
 str selectNotNilRef;
 str semaRef;
-str semijoinPathRef;
-str semijoinRef;
 str seriesRef;
 str setAccessRef;
 void setArgType(MalBlkPtr mb, InstrPtr p, int i, int tpe);
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -589,35 +589,34 @@ numFromStr(const char *src, int *len, vo
        const lng maxdiv10 = LL_CONSTANT(922337203685477580); /*7*/
 #endif
        const int maxmod10 = 7; /* max value % 10 */
-       int sign;
+       int sign = 1;
 
        atommem(void, sz);
        while (GDKisspace(*p))
                p++;
-       switch (*p) {
-       case 'n':
-               memcpy(*dst, ATOMnilptr(tp), sz);
-               if (p[1] == 'i' && p[2] == 'l') {
-                       p += 3;
-                       return (int) (p - src);
+       if (!num10(*p)) {
+               switch (*p) {
+               case 'n':
+                       memcpy(*dst, ATOMnilptr(tp), sz);
+                       if (p[1] == 'i' && p[2] == 'l') {
+                               p += 3;
+                               return (int) (p - src);
+                       }
+                       /* not a number */
+                       return 0;
+               case '-':
+                       sign = -1;
+                       p++;
+                       break;
+               case '+':
+                       p++;
+                       break;
                }
-               /* not a number */
-               return 0;
-       case '-':
-               sign = -1;
-               p++;
-               break;
-       case '+':
-               p++;
-               /* fall through */
-       default:
-               sign = 1;
-               break;
-       }
-       if (!num10(*p)) {
-               /* not a number */
-               memcpy(*dst, ATOMnilptr(tp), sz);
-               return 0;
+               if (!num10(*p)) {
+                       /* still not a number */
+                       memcpy(*dst, ATOMnilptr(tp), sz);
+                       return 0;
+               }
        }
        do {
                if (base > maxdiv10 ||
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -513,7 +513,7 @@ BATins(BAT *b, BAT *n, bit force)
                        }
                        if (b->htype != TYPE_void && b->hsorted && b->hdense &&
                            (BAThdense(n) == 0 ||
-                            *(oid *) BUNhloc(bi, last) != 1 + *(oid *) 
BUNhead(ni, BUNfirst(n)))) {
+                            1 + *(oid *) BUNhloc(bi, last) != *(oid *) 
BUNhead(ni, BUNfirst(n)))) {
                                b->hdense = FALSE;
                                b->H->nodense = r;
                        }
@@ -539,7 +539,7 @@ BATins(BAT *b, BAT *n, bit force)
                        }
                        if (b->ttype != TYPE_void && b->tsorted && b->tdense &&
                            (BATtdense(n) == 0 ||
-                            *(oid *) BUNtloc(bi, last) != 1 + *(oid *) 
BUNtail(ni, BUNfirst(n)))) {
+                            1 + *(oid *) BUNtloc(bi, last) != *(oid *) 
BUNtail(ni, BUNfirst(n)))) {
                                b->tdense = FALSE;
                                b->T->nodense = r;
                        }
@@ -750,7 +750,7 @@ BATappend(BAT *b, BAT *n, bit force)
                        }
                        if (b->ttype != TYPE_void && b->tsorted && b->tdense &&
                            (BATtdense(n) == 0 ||
-                            *(oid *) BUNtloc(bi, last) != 1 + *(oid *) 
BUNtail(ni, BUNfirst(n)))) {
+                            1 + *(oid *) BUNtloc(bi, last) != *(oid *) 
BUNtail(ni, BUNfirst(n)))) {
                                b->tdense = FALSE;
                                b->T->nodense = r;
                        }
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -569,16 +569,16 @@ HEAPfree(Heap *h, int remove)
                                          "size=" SZFMT ") = %d\n",
                                          PTRFMTCAST(void *)h->base,
                                          h->size, ret);
-                       if (remove) {
-                               char *path = GDKfilepath(h->farmid, BATDIR, 
h->filename, NULL);
-                               if (path && unlink(path) < 0 && errno != ENOENT)
-                                       perror(path);
-                               GDKfree(path);
-                       }
                }
        }
        h->base = NULL;
        if (h->filename) {
+               if (remove) {
+                       char *path = GDKfilepath(h->farmid, BATDIR, 
h->filename, NULL);
+                       if (path && unlink(path) < 0 && errno != ENOENT)
+                               perror(path);
+                       GDKfree(path);
+               }
                GDKfree(h->filename);
                h->filename = NULL;
        }
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -19,6 +19,7 @@
 #include "gdk_imprints.h"
 
 #define IMPRINTS_VERSION       2
+#define IMPRINTS_HEADER_SIZE   4 /* nr of size_t fields in header */
 
 #define BINSIZE(B, FUNC, T) do {               \
        switch (B) {                            \
@@ -631,7 +632,7 @@ BATimprints(BAT *b)
                                                           imprintsheap);
                if ((fd = GDKfdlocate(imprints->imprints->farmid, nme, "rb",
                                      b->batCacheid > 0 ? "timprints" : 
"himprints")) >= 0) {
-                       size_t hdata[4];
+                       size_t hdata[IMPRINTS_HEADER_SIZE];
                        struct stat st;
                        if (read(fd, hdata, sizeof(hdata)) == sizeof(hdata) &&
                            hdata[0] & ((size_t) 1 << 16) &&
@@ -646,13 +647,13 @@ BATimprints(BAT *b)
                                                   pages * ((bte) hdata[0] / 8) 
+
                                                   hdata[2] * sizeof(cchdc_t) +
                                                   sizeof(uint64_t) /* padding 
for alignment */
-                                                  + 4 * SIZEOF_SIZE_T) &&
+                                                  + IMPRINTS_HEADER_SIZE * 
SIZEOF_SIZE_T) &&
                            HEAPload(imprints->imprints, nme, b->batCacheid > 0 
? "timprints" : "himprints", 0) >= 0) {
                                /* usable */
                                imprints->bits = (bte) (hdata[0] & 0xFF);
                                imprints->impcnt = (BUN) hdata[1];
                                imprints->dictcnt = (BUN) hdata[2];
-                               imprints->bins = imprints->imprints->base + 4 * 
SIZEOF_SIZE_T;
+                               imprints->bins = imprints->imprints->base + 
IMPRINTS_HEADER_SIZE * SIZEOF_SIZE_T;
                                imprints->stats = (BUN *) ((char *) 
imprints->bins + 64 * b->T->width);
                                imprints->imps = (void *) (imprints->stats + 64 
* 3);
                                imprints->dict = (void *) ((uintptr_t) ((char 
*) imprints->imps + pages * (imprints->bits / 8) + sizeof(uint64_t)) & 
~(sizeof(uint64_t) - 1));
@@ -727,7 +728,7 @@ BATimprints(BAT *b)
                              pages * (imprints->bits / 8) +
                              pages * sizeof(cchdc_t) +
                              sizeof(uint64_t) /* padding for alignment */
-                             + 4 * SIZEOF_SIZE_T, /* extra info */
+                             + IMPRINTS_HEADER_SIZE * SIZEOF_SIZE_T, /* extra 
info */
                              1) < 0) {
                        GDKfree(imprints->imprints);
                        GDKfree(imprints);
@@ -736,7 +737,7 @@ BATimprints(BAT *b)
                                      "BATimprints");
                        return GDK_FAIL;
                }
-               imprints->bins = imprints->imprints->base + 4 * SIZEOF_SIZE_T;
+               imprints->bins = imprints->imprints->base + 
IMPRINTS_HEADER_SIZE * SIZEOF_SIZE_T;
                imprints->stats = (BUN *) ((char *) imprints->bins + 64 * 
b->T->width);
                imprints->imps = (void *) (imprints->stats + 64 * 3);
                imprints->dict = (void *) ((uintptr_t) ((char *) imprints->imps 
+ pages * (imprints->bits / 8) + sizeof(uint64_t)) & ~(sizeof(uint64_t) - 1));
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -327,7 +327,7 @@ binsearch(const oid *rcand, oid offset,
  * If nil_on_miss is set, a nil value is returned in r2 if there is no
  * match in r for a particular value in l (left outer join).
  *
- * If semi is set, only a single set of values in t1/r2 is returned if
+ * If semi is set, only a single set of values in r1/r2 is returned if
  * there is a match of l in r, no matter how many matches there are in
  * r; otherwise all matches are returned.
  */
@@ -1257,6 +1257,21 @@ binsearchcand(const oid *cand, BUN lo, B
                nr++;                                                   \
        } while (0)
 
+#define HASHloop_bound(bi, h, hb, v, lo, hi)           \
+       for (hb = HASHget(h, HASHprobe((h), v));        \
+            hb != HASHnil(h);                          \
+            hb = HASHgetlink(h,hb))                    \
+               if (hb >= (lo) && hb < (hi) &&          \
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to