MonetDB: Oct2014 - Add maximum width specification to %s format ...

2014-08-14 Thread Sjoerd Mullender
Changeset: b31b46d64522 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b31b46d64522
Modified Files:
clients/mapiclient/tomograph.c
Branch: Oct2014
Log Message:

Add maximum width specification to %s format in scanf.


diffs (12 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -820,7 +820,7 @@ initcolors(FILE *map)
 
if (map) {
/* read the color map */
-   while (fscanf(map,%s\t%s\t%s\n, buf[0],buf[1],buf[2])== 3  
i NUM_COLORS) {
+   while (fscanf(map,%127s\t%127s\t%127s\n, 
buf[0],buf[1],buf[2])== 3  i NUM_COLORS) {
colors[i].mod = strdup(buf[0]);
colors[i].fcn = strdup(buf[1]);
colors[i].freq = 0;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Remove assignment that doesn't do anything.

2014-08-14 Thread Sjoerd Mullender
Changeset: ca261d7d7d97 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ca261d7d7d97
Modified Files:
gdk/gdk_heap.c
Branch: Oct2014
Log Message:

Remove assignment that doesn't do anything.


diffs (12 lines):

diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -268,8 +268,6 @@ HEAPextend(Heap *h, size_t size, int may
HEAPfree(bak);
return 0;
}
-   /* coverity[assigned_pointer] */
-   failure = h-storage == STORE_MEM  can_map 
 !h-base;
}
fd = GDKfdlocate(h-farmid, nme, wb, ext);
if (fd = 0) {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Removed useless assignments.

2014-08-14 Thread Sjoerd Mullender
Changeset: db5a670312e1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db5a670312e1
Modified Files:
gdk/gdk_bbp.c
Branch: Oct2014
Log Message:

Removed useless assignments.


diffs (37 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1324,7 +1324,7 @@ BBPdir_subcommit(int cnt, bat *subcommit
 {
FILE *fp;
stream *s = NULL;
-   bat i, j = 1;
+   bat j = 1;
char buf[3000];
char *p;
int n;
@@ -1369,7 +1369,6 @@ BBPdir_subcommit(int cnt, bat *subcommit
if (BBPdir_header(s, n)  0)
goto bailout;
n = 0;
-   i = 1;
for (;;) {
/* but for subcommits, all except the bats in the list
 * retain their existing mode */
@@ -1383,7 +1382,7 @@ BBPdir_subcommit(int cnt, bat *subcommit
if (j == cnt  n == 0)
break;
if (j  cnt  (n == 0 || subcommit[j] = n || fp == NULL)) {
-   i = subcommit[j];
+   bat i = subcommit[j];
/* BBP.dir consists of all persistent bats only */
if (BBP_status(i)  BBPPERSISTENT) {
if (new_bbpentry(s, i)  0)
@@ -1397,7 +1396,6 @@ BBPdir_subcommit(int cnt, bat *subcommit
j++;
while (j  cnt  subcommit[j] == i);
} else {
-   i = n;
if (mnstr_printf(s, %s, buf)  0)
goto bailout;
IODEBUG mnstr_printf(GDKstdout, %s, buf);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Free leaking storage, + fix potential reading...

2014-08-14 Thread Sjoerd Mullender
Changeset: 975ff4af7a78 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=975ff4af7a78
Modified Files:
clients/mapiclient/tomograph.c
Branch: Oct2014
Log Message:

Free leaking storage, + fix potential reading beyond string end.


diffs (62 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1914,11 +1914,11 @@ parser(char *row)
numa = c+1;
for(c++; *c  *c !=''; c++)
;
-   if (*c == ''){
-   *c = 0;
-   numa= strdup(numa);
-   *c = '';
-   }
+   if (*c == 0)
+   return -1;
+   *c = 0;
+   numa= strdup(numa);
+   *c = '';
c = strchr(c + 1, ',');
 
 #ifdef FOOTPRINT
@@ -1932,16 +1932,22 @@ parser(char *row)
 
reads = strtoll(c + 1, NULL, 10);
c = strchr(c + 1, ',');
-   if (c == 0)
+   if (c == 0) {
+   free(numa);
return -8;
+   }
writes = strtoll(c + 1, NULL, 10);
 
/* check basic validity */
-   if ((cc= strrchr(row,']')) == 0 || *(cc+1) !=0)
+   if ((cc= strrchr(row,']')) == 0 || *(cc+1) !=0) {
+   free(numa);
return -1;
+   }
c = strchr(c + 1, ',');
-   if (c == 0)
+   if (c == 0) {
+   free(numa);
return -9;
+   }
c++;
fcn = c;
stmt = strdup(fcn);
@@ -1954,6 +1960,7 @@ parser(char *row)
fcn++;
if (strchr(fcn, '.') == 0) {
free(stmt);
+   free(numa);
return -10;
}
} else {
@@ -1972,6 +1979,7 @@ parser(char *row)
 wrapup:
 #endif
update(state, thread, clkticks, ticks, memory, numa, footprint, reads, 
writes, fcn, stmt);
+   free(numa);
 #else
(void) row;
 #endif
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Cast correct value to avoid potential overflow.

2014-08-14 Thread Sjoerd Mullender
Changeset: 7506332830d0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7506332830d0
Modified Files:
clients/mapiclient/tomograph.c
Branch: Oct2014
Log Message:

Cast correct value to avoid potential overflow.


diffs (12 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1875,7 +1875,7 @@ parser(char *row)
/* convert time to epoch in seconds*/
memset(stm, 0, sizeof(struct tm));
c = strptime(c + 1, %H:%M:%S, stm);
-   clkticks = (((lng) (stm.tm_hour * 60) + stm.tm_min) * 60 + 
stm.tm_sec) * 100;
+   clkticks = (((lng) stm.tm_hour * 60 + stm.tm_min) * 60 + 
stm.tm_sec) * 100;
if (c == 0)
return -11;
if (*c == '.') {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Use OpenSSL's RAND_bytes() to generate random...

2014-08-14 Thread Sjoerd Mullender
Changeset: 67dbeb724bda for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=67dbeb724bda
Modified Files:
common/utils/muuid.c
monetdb5/modules/atoms/uuid.c
monetdb5/modules/mal/mal_mapi.c
tools/merovingian/utils/utils.c
Branch: Oct2014
Log Message:

Use OpenSSL's RAND_bytes() to generate randomness for security.


diffs (144 lines):

diff --git a/common/utils/muuid.c b/common/utils/muuid.c
--- a/common/utils/muuid.c
+++ b/common/utils/muuid.c
@@ -26,6 +26,8 @@
 #include string.h /* strdup */
 #ifdef HAVE_UUID_UUID_H
 # include uuid/uuid.h
+#else
+# include openssl/rand.h
 #endif
 
 /**
@@ -49,14 +51,27 @@ generateUUID(void)
/* try to do some pseudo interesting stuff, and stash it in the
 * format of a UUID to at least return some uniform answer */
char out[37];
+   union {
+   unsigned char randbuf[16];
+   unsigned short s[8];
+   } r;
 
-   /* generate something like this:
-* cefa7a9c-1dd2-11b2-8350-880020adbeef (%08x-%04x-%04x-%04x-%012x) */
-   snprintf(out, sizeof(out), %04x%04x-%04x-%04x-%04x-%04x%04x%04x,
-rand() % 65536, rand() % 65536,
-rand() % 65536, rand() % 65536,
-rand() % 65536, rand() % 65536,
-rand() % 65536, rand() % 65536);
+   if (RAND_bytes(r.randbuf, 16) = 0) {
+   snprintf(out, sizeof(out),
+%04x%04x-%04x-%04x-%04x-%04x%04x%04x,
+r.s[0], r.s[1], r.s[2], r.s[3],
+r.s[4], r.s[5], r.s[6], r.s[7]);
+   } else {
+   /* generate something like this:
+* cefa7a9c-1dd2-11b2-8350-880020adbeef
+* (%08x-%04x-%04x-%04x-%012x) */
+   snprintf(out, sizeof(out),
+%04x%04x-%04x-%04x-%04x-%04x%04x%04x,
+rand() % 65536, rand() % 65536,
+rand() % 65536, rand() % 65536,
+rand() % 65536, rand() % 65536,
+rand() % 65536, rand() % 65536);
+   }
 #endif
return strdup(out);
 }
diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c
--- a/monetdb5/modules/atoms/uuid.c
+++ b/monetdb5/modules/atoms/uuid.c
@@ -31,6 +31,9 @@
 #ifdef HAVE_UUID_UUID_H
 #include uuid/uuid.h
 #endif
+#ifndef HAVE_UUID
+#include openssl/rand.h  /* for RAND_bytes */
+#endif
 
 #ifdef HAVE_UUID
 #define UUID_SIZE  ((int) sizeof(uuid_t)) /* size of a UUID */
@@ -178,7 +181,8 @@ UUIDgenerateUuid(uuid **retval)
 #ifdef HAVE_UUID
uuid_generate(u-u);
 #else
-   {
+   if (RAND_bytes(u-u, 16)  0) {
+   /* if it failed, use rand */
int i, r;
 
for (i = 0; i  UUID_SIZE;) {
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -44,6 +44,7 @@
 #include sys/types.h
 #include stream_socket.h
 #include mapi.h
+#include openssl/rand.h  /* RAND_bytes() */
 
 #ifdef _WIN32   /* Windows specific */
 # include winsock.h
@@ -86,12 +87,18 @@ static void generateChallenge(str buf, i
 
/* don't seed the randomiser here, or you get the same challenge
 * during the same second */
-   size = rand();
+   if (RAND_bytes((unsigned char *) size, (int) sizeof(size))  0)
+   size = rand();
size = (size % (max - min)) + min;
-   for (i = 0; i  size; i++) {
-   bte = rand();
-   bte %= 62;
-   buf[i] = seedChars[bte];
+   if (RAND_bytes((unsigned char *) buf, (int) size) = 0) {
+   for (i = 0; i  size; i++)
+   buf[i] = seedChars[((unsigned char *) buf)[i] % 62];
+   } else {
+   for (i = 0; i  size; i++) {
+   bte = rand();
+   bte %= 62;
+   buf[i] = seedChars[bte];
+   }
}
buf[i] = '\0';
 }
diff --git a/tools/merovingian/utils/utils.c b/tools/merovingian/utils/utils.c
--- a/tools/merovingian/utils/utils.c
+++ b/tools/merovingian/utils/utils.c
@@ -45,6 +45,7 @@
 #  include time.h
 # endif
 #endif
+#include openssl/rand.h  /* RAND_bytes */
 
 /**
  * Parses the given file stream matching the keys from list.  If a match
@@ -314,12 +315,22 @@ void
 generateSalt(char *buf, unsigned int len)
 {
unsigned int c;
-   unsigned int size = (unsigned int)rand();
-   unsigned int fill = len * 0.75;
-   unsigned int min = len * 0.42;
+   unsigned int size;
+   unsigned int fill;
+   unsigned int min;
+
+   if (RAND_bytes((unsigned char *) size, (int) sizeof(size))  0)
+   size = (unsigned int)rand();
+   fill = len * 0.75;
+   min = len * 0.42;
size = (size % (fill - min)) + min;
-   for (c = 0; c  size; c++)
-  

MonetDB: Oct2014 - Don't care (here) that rand() is not cryptogr...

2014-08-14 Thread Sjoerd Mullender
Changeset: 0da5801f64c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0da5801f64c6
Modified Files:
tools/merovingian/daemon/discoveryrunner.c
Branch: Oct2014
Log Message:

Don't care (here) that rand() is not cryptographically secure.


diffs (11 lines):

diff --git a/tools/merovingian/daemon/discoveryrunner.c 
b/tools/merovingian/daemon/discoveryrunner.c
--- a/tools/merovingian/daemon/discoveryrunner.c
+++ b/tools/merovingian/daemon/discoveryrunner.c
@@ -449,6 +449,7 @@ discoveryRunner(void *d)
Mfprintf(_mero_discout, new neighbour %s (%s)\n, buf 
+ 5, host);
/* sleep a random amount of time to avoid an avalanche 
of
 * ANNC messages flooding the network */
+   /* coverity[dont_call] */
c = 1 + (int)(2500.0 * (rand() / (RAND_MAX + 1.0)));
sleep_ms(c);
/* force an announcement round by dropping the deadline 
*/
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Check for error.

2014-08-14 Thread Sjoerd Mullender
Changeset: f2337974b8f4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f2337974b8f4
Modified Files:
tools/merovingian/daemon/controlrunner.c
Branch: Oct2014
Log Message:

Check for error.


diffs (18 lines):

diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -418,11 +418,11 @@ static void ctl_handle_client(
}
GDKinit(set, setlen);
vaultkey = buf2;
-   
AUTHunlockVault(vaultkey);
-   err = 
AUTHinitTables(p);
-   if (err != NULL) {
+   if ((err = 
AUTHunlockVault(vaultkey)) != NULL ||
+   (err = 
AUTHinitTables(p)) != NULL) {

Mfprintf(_mero_ctlerr, %s: could not setup 

database '%s': %s\n, origin, q, err);
+   GDKfree(err);
} else {
/* don't start 
locked */

unlink(.maintenance);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Check for unlikely error.

2014-08-14 Thread Sjoerd Mullender
Changeset: d231553c7d94 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d231553c7d94
Modified Files:
tools/merovingian/daemon/controlrunner.c
Branch: Oct2014
Log Message:

Check for unlikely error.


diffs (16 lines):

diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -385,7 +385,11 @@ static void ctl_handle_client(
int setlen = 0;
char *sadbfarm;
 
-   
msab_getDBfarm(sadbfarm);
+   if ((err = 
msab_getDBfarm(sadbfarm)) != NULL) {
+   
Mfprintf(_mero_ctlerr, %s: internal error: %s\n,
+   
 origin, err);
+   exit(0);
+   }
snprintf(buf2, 
sizeof(buf2), %s/%s, sadbfarm, q);
free(sadbfarm);
setlen = 
mo_add_option(set, setlen, opt_cmdline, gdk_dbpath, buf2);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Fix resource leak.

2014-08-14 Thread Sjoerd Mullender
Changeset: 58ea14c8db8a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58ea14c8db8a
Modified Files:
tools/merovingian/daemon/connections.c
Branch: Oct2014
Log Message:

Fix resource leak.


diffs (16 lines):

diff --git a/tools/merovingian/daemon/connections.c 
b/tools/merovingian/daemon/connections.c
--- a/tools/merovingian/daemon/connections.c
+++ b/tools/merovingian/daemon/connections.c
@@ -137,9 +137,11 @@ openConnectionUDP(int *ret, unsigned sho
close(sock);
}
 
-   if (rp == NULL)
+   if (rp == NULL) {
+   freeaddrinfo(result);
return(newErr(binding to datagram socket port %hu failed: 
no available address, port));
+   }
 
/* retrieve information from the socket */
getnameinfo(rp-ai_addr, rp-ai_addrlen,
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Fix resource leak.

2014-08-14 Thread Sjoerd Mullender
Changeset: a7bbf7a3395d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7bbf7a3395d
Modified Files:
monetdb5/modules/mal/pcre.c
Branch: Oct2014
Log Message:

Fix resource leak.


diffs (15 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1366,8 +1366,10 @@ BATPCRElike3(bat *ret, int *bid, str *pa
}
 
r = BATnew(TYPE_void, TYPE_bit, BATcount(strs), TRANSIENT);
-   if( r==NULL)
+   if( r==NULL) {
+   GDKfree(ppat);
throw(MAL,pcre.like3,MAL_MALLOC_FAIL);
+   }
br = (bit*)Tloc(r, BUNfirst(r));
strsi = bat_iterator(strs);
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - No need for separate variable, hopefully solv...

2014-08-14 Thread Sjoerd Mullender
Changeset: 449f629ad81f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=449f629ad81f
Modified Files:
monetdb5/mal/mal_dataflow.c
Branch: Oct2014
Log Message:

No need for separate variable, hopefully solves Coverity complaint.


diffs (29 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -297,7 +297,7 @@ DFLOWworker(void *T)
int id = (int) (t - workers);
Thread thr;
str error = 0;
-   int i,last, tid;
+   int i,last;
Client cntxt;
InstrPtr p;
 
@@ -312,7 +312,6 @@ DFLOWworker(void *T)
/* wait until we are allowed to start working */
MT_sema_down(t-s, DFLOWworker);
}
-   tid = THRgettid();
while (1) {
if (fnxt == 0) {
MT_lock_set(dataflowLock, DFLOWworker);
@@ -370,7 +369,7 @@ DFLOWworker(void *T)
/* update the numa information. keep the thread-id 
producing the value */
p= getInstrPtr(flow-mb,fe-pc);
for( i = 0; i  p-argc; i++)
-   flow-mb-var[getArg(p,i)]-worker = tid;
+   flow-mb-var[getArg(p,i)]-worker = thr-tid;
 
MT_lock_set(flow-flowlock, DFLOWworker);
fe-state = DFLOWwrapup;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Removed dead code.

2014-08-14 Thread Sjoerd Mullender
Changeset: 13c3e16e480b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=13c3e16e480b
Modified Files:
monetdb5/mal/mal_profiler.c
Branch: Oct2014
Log Message:

Removed dead code.
If pci == NULL, we had already returned, so checking it again is
useless, and the if condition can never be true.


diffs (21 lines):

diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -241,16 +241,9 @@ profilerEvent(int idx, MalBlkPtr mb, Mal
 {
if (stk == NULL) return;
if (pci == NULL) return;
-   if (profileCounter[PROFdot].status == 1  start  pci == NULL){
-   if (mb-dotfile == 0){
-   MT_lock_set(mal_profileLock, profilerEvent);
-   showFlowGraph(mb,stk,stethoscope);
-   MT_lock_unset(mal_profileLock, profilerEvent);
-   }
-   }
if (profileCounter[PROFstart].status == 0  start)
return;
-   if ( !start  pci  pci-token == ENDsymbol)
+   if ( !start  pci-token == ENDsymbol)
profilerHeartbeatEvent(ping, 0);
if (myname == 0)
myname = putName(profiler, 8);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Don't care (here) that rand() is not cryptogr...

2014-08-14 Thread Sjoerd Mullender
Changeset: 18bbd540a10d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18bbd540a10d
Modified Files:
monetdb5/modules/kernel/microbenchmark.c
monetdb5/modules/kernel/mmath.c
Branch: Oct2014
Log Message:

Don't care (here) that rand() is not cryptographically secure.


diffs (80 lines):

diff --git a/monetdb5/modules/kernel/microbenchmark.c 
b/monetdb5/modules/kernel/microbenchmark.c
--- a/monetdb5/modules/kernel/microbenchmark.c
+++ b/monetdb5/modules/kernel/microbenchmark.c
@@ -72,10 +72,12 @@ BATrandom(BAT **bn, oid *base, wrd *size
srand(seed);
if (*domain == int_nil) {
BATloop(b, p, q) {
+   /* coverity[dont_call] */
*(int *) Tloc(b, p) = rand();
}
} else {
BATloop(b, p, q) {
+   /* coverity[dont_call] */
*(int *) Tloc(b, p) = rand() % *domain;
}
}
@@ -139,6 +141,7 @@ BATuniform(BAT **bn, oid *base, wrd *siz
 
/* mix BUNs randomly */
for (r = i = 0; i  n; i++) {
+   /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
 
@@ -211,15 +214,18 @@ BATskewed(BAT **bn, oid *base, wrd *size
 
lastbun = firstbun + skewedSize;
for(p=firstbun; p lastbun; p++)
+   /* coverity[dont_call] */
*(int *) Tloc(b, p) = (int)rand() % skewedDomain;
 
lastbun = BUNlast(b);
for(; p lastbun; p++)
+   /* coverity[dont_call] */
*(int *) Tloc(b, p) = ((int)rand() % (*domain-skewedDomain)) + 
skewedDomain;
 
/* mix BUNs randomly */
 
for (r = i = 0; i  n; i++) {
+   /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
 
@@ -322,7 +328,8 @@ BATnormal(BAT **bn, oid *base, wrd *size
 
/* mix BUNs randomly */
for (r = 0, i = 0; i  n; i++) {
-   BUN idx = i + (BUN) ((r += (unsigned int) rand()) % (n 
- i));
+   /* coverity[dont_call] */
+   BUN idx = i + (BUN) ((r += (unsigned int) rand()) % (n - i));
int val;
 
p = firstbun + i;
@@ -404,6 +411,7 @@ MBMmix(int *bn, int *batid)
firstbun = BUNfirst(b);
/* mix BUNs randomly */
for (r = i = 0; i  n; i++) {
+   /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
 
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -275,6 +275,7 @@ MATHunary_FINITE(bit *res, dbl *a)
 str
 MATHrandint(int *res)
 {
+   /* coverity[dont_call] */
*res = rand();
return MAL_SUCCEED;
 }
@@ -290,6 +291,7 @@ str
 MATHsqlrandint(int *res, int *seed)
 {
srand(*seed);
+   /* coverity[dont_call] */
*res = rand();
return MAL_SUCCEED;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Dead code.

2014-08-14 Thread Sjoerd Mullender
Changeset: 297ef671c58f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=297ef671c58f
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Dead code.


diffs (12 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -441,7 +441,7 @@ JSONglue(str res, str r, char sep)
str n;
if( r== 0 || *r == 0)
return res;
-   len =  r?strlen(r):0;
+   len = strlen(r);
if ( res == 0)
res = GDKstrdup(r);
else {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Removed dead code.

2014-08-14 Thread Sjoerd Mullender
Changeset: a0399eadd3fe for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a0399eadd3fe
Modified Files:
monetdb5/optimizer/opt_mapreduce.c
Branch: Oct2014
Log Message:

Removed dead code.
code can only be STICK, DUP, or cNONE here.


diffs (26 lines):

diff --git a/monetdb5/optimizer/opt_mapreduce.c 
b/monetdb5/optimizer/opt_mapreduce.c
--- a/monetdb5/optimizer/opt_mapreduce.c
+++ b/monetdb5/optimizer/opt_mapreduce.c
@@ -932,11 +932,6 @@ OPTmapreduceImplementation(
case STICK:
trackstack_push(tracker, i);
break;
-   case SINGLE_DUP:
-   copy = STICK;
-   pushInstruction(map, omap[i]);
-   trackstack_push(tracker, i);
-   break;
case DUP:
pushInstruction(map, omap[i]);
pushInstruction(reduce, p);
@@ -944,9 +939,7 @@ OPTmapreduceImplementation(
case cNONE:
copy = STICK;
break;
-   case SINGLE:
-   case FREE:
-   case LEAVE:
+   default:
assert(0); /* make GCC happy */
break;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Properly deal with GDKrealloc failure, plus f...

2014-08-14 Thread Sjoerd Mullender
Changeset: acb7523d68ba for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=acb7523d68ba
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Properly deal with GDKrealloc failure, plus fix dead code.


diffs (30 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -1684,12 +1684,14 @@ JSONgroupStr(str *ret, const bat *bid)
continue;
len = strlen(t) + 1;
if (len = size - offset) {
+   str nbuf;
size += len + 128;
-   buf = GDKrealloc(buf, size);
-   if (buf == NULL) {
+   nbuf = GDKrealloc(buf, size);
+   if (nbuf == NULL) {
err= MAL_MALLOC_FAIL;
goto failed;
}
+   buf = nbuf;
}
switch (b-ttype) {
case TYPE_str:
@@ -1730,8 +1732,7 @@ JSONgroupStr(str *ret, const bat *bid)
return MAL_SUCCEED;
   failed:
BBPreleaseref(b-batCacheid);
-   if (buf != NULL)
-   GDKfree(buf);
+   GDKfree(buf);
throw(MAL, json.agg, %s, err);
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: rdf - Modify Q metric

2014-08-14 Thread Minh-Duc Pham
Changeset: cbe986982541 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cbe986982541
Modified Files:
monetdb5/extras/rdf/rdfschema.c
Branch: rdf
Log Message:

Modify Q metric


diffs (12 lines):

diff --git a/monetdb5/extras/rdf/rdfschema.c b/monetdb5/extras/rdf/rdfschema.c
--- a/monetdb5/extras/rdf/rdfschema.c
+++ b/monetdb5/extras/rdf/rdfschema.c
@@ -8927,7 +8927,7 @@ Pscore computeMetricsQ(CSset *freqCSset)
tblIdx++;   
fillRatio[tblIdx] = (float) cs.numFill 
/((float)cs.numProp *  cs.support);
refRatio[tblIdx] = (float) cs.numInRef / 
freqCSset-totalInRef;
-   weight[tblIdx] = (float) cs.coverage * ( 
fillRatio[tblIdx] + refRatio[tblIdx]); 
+   weight[tblIdx] = (float) cs.coverage * 
fillRatio[tblIdx] + refRatio[tblIdx]; 
//weight[tblIdx] = (float) cs.coverage * ( 
fillRatio[tblIdx]);  //If do not consider reference ratio
totalCov += cs.coverage;
totalPrecision += fillRatio[tblIdx];
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: rdf - Merge with changing long to lng

2014-08-14 Thread Minh-Duc Pham
Changeset: 3d3117ec109f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d3117ec109f
Modified Files:
monetdb5/extras/rdf/rdf_shredder.c
monetdb5/extras/rdf/rdftypes.c
monetdb5/extras/rdf/rdftypes.h
Branch: rdf
Log Message:

Merge with changing long to lng


diffs (125 lines):

diff --git a/monetdb5/extras/rdf/rdf_shredder.c 
b/monetdb5/extras/rdf/rdf_shredder.c
--- a/monetdb5/extras/rdf/rdf_shredder.c
+++ b/monetdb5/extras/rdf/rdf_shredder.c
@@ -198,8 +198,8 @@ getObjectType_and_Value(unsigned char* o
 
 double  realDbl;
 int realInt;
-   longnTime; 
-   longrealLng; 
+   lng nTime; 
+   lng realLng; 
 
len = strlen((str)objStr);
if (len  100 || len = 20){
diff --git a/monetdb5/extras/rdf/rdftypes.c b/monetdb5/extras/rdf/rdftypes.c
--- a/monetdb5/extras/rdf/rdftypes.c
+++ b/monetdb5/extras/rdf/rdftypes.c
@@ -325,7 +325,7 @@ char rdfcast(ObjectType srcT, ObjectType
dstPtr-len, 
srcPtr-val.dval);
dstPtr-vtype = TYPE_str;
return 1; 
-   case DATETIME:  //Datetime in encoded long 
value of timestamp
+   case DATETIME:  //Datetime in encoded lng value 
of timestamp
{   
char buf[64], *s1 = buf;
int len = 64; 
@@ -451,11 +451,11 @@ int convertDateTimeToTimeT(char *sDateTi
  * Using/extending monetdb mtime functions
  * */
 
-int convertDateTimeToLong(char *sDateTime, long *t){
+int convertDateTimeToLong(char *sDateTime, lng *t){
timestamp *ts = NULL; 
//tzone *tz;
int len, pos = 0; 
-   long encodeLng = 0; 
+   lng encodeLng = 0; 
int positiveDate = 0;
int sign = 0;

@@ -501,7 +501,7 @@ int convertDateTimeToLong(char *sDateTim
return 0;
}
 
-   //Encoding timestamp to long. 
+   //Encoding timestamp to lng. 
//First 4 bits are not used, 5th bits for sign of number of days value 
//(1, if the number of days is negative)
//27 bits for days, 32 bits for msecs
@@ -513,14 +513,14 @@ int convertDateTimeToLong(char *sDateTim
sign = 0;
}

-   encodeLng |= (long) positiveDate;
+   encodeLng |= (lng) positiveDate;
encodeLng = encodeLng  (sizeof(ts-msecs) * 8); //Move 32 bits
-   encodeLng |= (long)sign  (sizeof(long) * 8 - 5);  //Set the sign 
bit
-   encodeLng = encodeLng | (long) ts-msecs;   //Set 32 bits for msecs
+   encodeLng |= (lng)sign  (sizeof(lng) * 8 - 5);//Set the sign 
bit
+   encodeLng = encodeLng | (lng) ts-msecs;//Set 32 bits for msecs

*t = encodeLng; 
 
-   //printf(Encode string %s with days %d and msecs %d to long %ld 
\n,sDateTime, ts-days, ts-msecs, *t);
+   //printf(Encode string %s with days %d and msecs %d to lng %ld 
\n,sDateTime, ts-days, ts-msecs, *t);
if (ts) GDKfree(ts); 

return 1;
@@ -535,7 +535,7 @@ void
 encodeValueInOid(ValPtr vrPtrRealValue, ObjectType objType, BUN* bun){
 
int positiveInt = 0; 
-   long positiveLng = 0; 
+   lng positiveLng = 0; 
 
*bun = 0; 
 
@@ -564,8 +564,8 @@ encodeValueInOid(ValPtr vrPtrRealValue, 
}
break;
case DATETIME: 
-   //Consider it is as long value
-   //No sign bit needed for this encoded long
+   //Consider it is as lng value
+   //No sign bit needed for this encoded lng
assert (vrPtrRealValue-val.lval = 0);
positiveLng = vrPtrRealValue-val.lval;
 
@@ -584,7 +584,7 @@ decodeValueFromOid(BUN bun, ObjectType o
BUN realval = 0; 
int sign = 0; 
int ival = 0; 
-   long lval = 0;
+   lng lval = 0;
double *realdbl = NULL; 

//printf(Decode value from oid: BUNFMT \n,bun);
@@ -656,7 +656,7 @@ void convertTMtimeToMTime(time_t t, time
  * Convert value from tm format to timestamp of monet mtime
  * Only convert when storing in monetdb BAT for datetime
  * */
-void convert_encodedLng_toTimestamp(long t, timestamp *ts){
+void convert_encodedLng_toTimestamp(lng t, timestamp *ts){
int sign = 0; 
int daypart = 0; 
int msecpart = 0;
diff --git a/monetdb5/extras/rdf/rdftypes.h b/monetdb5/extras/rdf/rdftypes.h
--- a/monetdb5/extras/rdf/rdftypes.h
+++ b/monetdb5/extras/rdf/rdftypes.h
@@ -81,13 +81,13 @@ rdf_export int
 convertDateTimeToTimeT(char *sDateTime, int len, time_t *t);
 
 rdf_export int
-convertDateTimeToLong(char *sDateTime, long *t);
+convertDateTimeToLong(char *sDateTime, lng *t);
 
 rdf_export void
 

MonetDB: Oct2014 - Removed useless if statement. The condition ...

2014-08-14 Thread Sjoerd Mullender
Changeset: dd9812befccb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dd9812befccb
Modified Files:
monetdb5/modules/mal/remote.c
Branch: Oct2014
Log Message:

Removed useless if statement.  The condition can not be true.


diffs (13 lines):

diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -996,9 +996,6 @@ str RMTbatload(Client cntxt, MalBlkPtr m
/* skip over this line */
fdin-pos = ++len;
 
-   if (var == NULL) 
-   var =nil;
-
s = 0;
r = NULL;
ATOMfromstr(t, r, s, var);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Don't divide by zero of pad string is empty.

2014-08-14 Thread Sjoerd Mullender
Changeset: 060b8396a97d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=060b8396a97d
Modified Files:
monetdb5/modules/atoms/str.c
Branch: Oct2014
Log Message:

Don't divide by zero of pad string is empty.


diffs (67 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -2291,16 +2291,22 @@ STRLpad2(str *res, str *arg1, int *len, 
const char *s2 = *arg2, *s2_tmp = *arg2;
char *r = NULL;
const unsigned char *u = NULL;
-   int i = 0, c = 0, sz = 0,
-   s2_cnt = UTF8_strlen(s2),
-   nr_repeat = pad_cnt / s2_cnt,
-   nr_residual = pad_cnt % s2_cnt;
-   size_t s_len = strlen(s),
-   s2_len = strlen(s2),
-   repeat_len = s2_len * nr_repeat,
-   residual_len = 0,
-   res_len = s_len + repeat_len;
+   int i, c, sz, s2_cnt, nr_repeat, nr_residual;
+   size_t s_len, s2_len, repeat_len, residual_len, res_len;
 
+   i = 0;
+   c = 0;
+   sz = 0;
+   s2_cnt = UTF8_strlen(s2);
+   if (s2_cnt == 0)
+   throw(MAL, str.lpad, ILLEGAL_ARGUMENT : pad string 
is empty);
+   nr_repeat = pad_cnt / s2_cnt;
+   nr_residual = pad_cnt % s2_cnt;
+   s_len = strlen(s);
+   s2_len = strlen(s2);
+   repeat_len = s2_len * nr_repeat;
+   residual_len = 0;
+   res_len = s_len + repeat_len;
u = (const unsigned char *) s2_tmp;
for (i = 0; i  nr_residual; i++) {
UTF8_GETCHAR_SZ(c, sz, u);
@@ -2350,16 +2356,22 @@ STRRpad2(str *res, str *arg1, int *len, 
const char *s2 = *arg2, *s2_tmp = *arg2;
char *r = NULL;
const unsigned char *u = NULL;
-   int i = 0, c = 0, sz = 0,
-   s2_cnt = UTF8_strlen(s2),
-   nr_repeat = pad_cnt / s2_cnt,
-   nr_residual = pad_cnt % s2_cnt;
-   size_t s_len = strlen(s),
-   s2_len = strlen(s2),
-   repeat_len = s2_len * nr_repeat,
-   residual_len = 0,
+   int i, c, sz, s2_cnt, nr_repeat, nr_residual;
+   size_t s_len, s2_len, repeat_len, residual_len, res_len;
 
-   res_len = s_len + repeat_len;
+   i = 0;
+   c = 0;
+   sz = 0;
+   s2_cnt = UTF8_strlen(s2);
+   if (s2_cnt == 0)
+   throw(MAL, str.rpad, ILLEGAL_ARGUMENT : pad string 
is empty);
+   nr_repeat = pad_cnt / s2_cnt;
+   nr_residual = pad_cnt % s2_cnt;
+   s_len = strlen(s);
+   s2_len = strlen(s2);
+   repeat_len = s2_len * nr_repeat;
+   residual_len = 0;
+   res_len = s_len + repeat_len;
 
u = (const unsigned char *)s2_tmp;
for (i = 0; i  nr_residual; i++) {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Include file when we need it.

2014-08-14 Thread Sjoerd Mullender
Changeset: 06a6992616be for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06a6992616be
Modified Files:
common/utils/muuid.c
Branch: Oct2014
Log Message:

Include file when we need it.


diffs (13 lines):

diff --git a/common/utils/muuid.c b/common/utils/muuid.c
--- a/common/utils/muuid.c
+++ b/common/utils/muuid.c
@@ -26,7 +26,8 @@
 #include string.h /* strdup */
 #ifdef HAVE_UUID_UUID_H
 # include uuid/uuid.h
-#else
+#endif
+#ifndef HAVE_UUID
 # include openssl/rand.h
 #endif
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Fix potential NULL dereference.

2014-08-14 Thread Sjoerd Mullender
Changeset: b982e541c809 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b982e541c809
Modified Files:
monetdb5/modules/mal/remote.c
Branch: Oct2014
Log Message:

Fix potential NULL dereference.


diffs (23 lines):

diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -699,12 +699,14 @@ str RMTput(Client cntxt, MalBlkPtr mb, M
tail = getTypeIdentifier(getColumnType(type));
 
bid = *(int *)value;
-   if (bid != 0  (b = BATdescriptor(bid)) == NULL){
-   MT_lock_unset(c-lock, remote.put);
-   GDKfree(tail);
-   throw(MAL, remote.put, RUNTIME_OBJECT_MISSING);
+   if (bid != 0) {
+   if ((b = BATdescriptor(bid)) == NULL){
+   MT_lock_unset(c-lock, remote.put);
+   GDKfree(tail);
+   throw(MAL, remote.put, 
RUNTIME_OBJECT_MISSING);
+   }
+   assert(b-htype == TYPE_void);
}
-   assert(b-htype == TYPE_void);
 
/* bypass Mapi from this point to efficiently write all data to
 * the server */
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Change parameter name to better indicate what...

2014-08-14 Thread Sjoerd Mullender
Changeset: ce67198c8708 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce67198c8708
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_none.stable.out
monetdb5/modules/atoms/json.mal
Branch: Oct2014
Log Message:

Change parameter name to better indicate what it is for.


diffs (60 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
@@ -39460,7 +39460,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out 
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -39376,7 +39376,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_geom.stable.out 
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -39352,7 +39352,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_none.stable.out 
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -39181,7 +39181,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/monetdb5/modules/atoms/json.mal b/monetdb5/modules/atoms/json.mal
--- a/monetdb5/modules/atoms/json.mal
+++ b/monetdb5/modules/atoms/json.mal
@@ -127,7 +127,7 @@ pattern fold(k:bat[:oid,:str],v:bat[:oid
 address JSONfold
 comment Combine the key-value pairs into a single json object list.;
 
-pattern fold(k:bat[:oid,:any]):json
+pattern fold(v:bat[:oid,:any]):json
 address JSONfold
 comment Combine the value list into a single json array object.;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Add comment about the missing break.

2014-08-14 Thread Sjoerd Mullender
Changeset: b3c8cb4c6aa1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3c8cb4c6aa1
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Add comment about the missing break.


diffs (13 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -712,7 +712,8 @@ JSONtoken(JSON *jt, char *j, char **next
jt-elm[k].kind = JSON_OBJECT;
jt-elm[k].child = nxt;
nxt = k;
-   } 
+   }
+   /* fall through */
case JSON_OBJECT:
case JSON_ARRAY:
if ( jt-elm[nxt].kind == JSON_OBJECT || 
jt-elm[nxt].kind == JSON_ARRAY){
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Add error check.

2014-08-14 Thread Sjoerd Mullender
Changeset: fa8329ec1ff6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa8329ec1ff6
Modified Files:
monetdb5/optimizer/opt_mapreduce.c
Branch: Oct2014
Log Message:

Add error check.


diffs (12 lines):

diff --git a/monetdb5/optimizer/opt_mapreduce.c 
b/monetdb5/optimizer/opt_mapreduce.c
--- a/monetdb5/optimizer/opt_mapreduce.c
+++ b/monetdb5/optimizer/opt_mapreduce.c
@@ -84,6 +84,8 @@ MRgetCloud(int *ret, str *mrcluster)
 
MT_lock_set(mal_contextLock, mapreduce);
cloud = BATdescriptor(*ret); /* should succeed */
+   if (cloud == NULL)
+   throw(MAL, mapreduce.getCloud, RUNTIME_OBJECT_MISSING);
 
mapnodes = (mapnode*)GDKzalloc(sizeof(mapnode) * (BATcount(cloud) + 1));
if (mapnodes == NULL) {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Add error check.

2014-08-14 Thread Sjoerd Mullender
Changeset: 7124c189a322 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7124c189a322
Modified Files:
monetdb5/optimizer/opt_mapreduce.c
Branch: Oct2014
Log Message:

Add error check.


diffs (12 lines):

diff --git a/monetdb5/optimizer/opt_mapreduce.c 
b/monetdb5/optimizer/opt_mapreduce.c
--- a/monetdb5/optimizer/opt_mapreduce.c
+++ b/monetdb5/optimizer/opt_mapreduce.c
@@ -123,6 +123,8 @@ MRcloudSize(str mrcluster)
return 0;
}
cloud = BATdescriptor(bid);
+   if (cloud == NULL)
+   return 0;
cnt = (int)BATcount(cloud);
BBPreleaseref(bid); /* we're done with it */
return(cnt);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: rdf - Compute stats with the removal of small tables

2014-08-14 Thread Minh-Duc Pham
Changeset: 536a87adb3d5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=536a87adb3d5
Modified Files:
monetdb5/extras/rdf/rdfschema.c
monetdb5/extras/rdf/rdfschema.h
Branch: rdf
Log Message:

Compute stats with the removal of small tables


diffs (123 lines):

diff --git a/monetdb5/extras/rdf/rdfschema.c b/monetdb5/extras/rdf/rdfschema.c
--- a/monetdb5/extras/rdf/rdfschema.c
+++ b/monetdb5/extras/rdf/rdfschema.c
@@ -8904,10 +8904,17 @@ Pscore computeMetricsQ(CSset *freqCSset)
float* weight;
int tblIdx = -1;
CS cs;  
+
int totalCov = 0; 
float   totalPrecision = 0.0; 
-   longoveralFill = 0; 
-   longoveralMaxFill = 0;
+   lng overalFill = 0; 
+   lng overalMaxFill = 0;
+
+   int totalExpFinalCov = 0; 
+   float   totalExpFinalPrecision = 0.0; 
+   lng overalExpFinalFill = 0; 
+   lng overalExpFinalMaxFill = 0;
+   float   expFinalQ = 0.0; 
 
float   Q = 0.0;
int i;
@@ -8937,24 +8944,37 @@ Pscore computeMetricsQ(CSset *freqCSset)
//if ((cs.numProp *  cs.support)  100) 
printf(FreqCS %d has %d prop and support %d (Fill Ratio %f 
)\n,i,cs.numProp,cs.support,fillRatio[tblIdx]);

Q += weight[tblIdx];
-   }
-   if (isCSTable(freqCSset-items[i], 1)) numExpFinalTbl++;
+
+   if (isCSTable(freqCSset-items[i], 1)){ 
+   totalExpFinalCov += cs.coverage;
+   totalExpFinalPrecision += fillRatio[tblIdx];
+   overalExpFinalFill += cs.numFill;
+   overalExpFinalMaxFill += cs.numProp *  
cs.support;
+   expFinalQ += weight[tblIdx];
+   numExpFinalTbl++;
+   }
+   }
}
printf(Performance metric Q = (weighting %f)/(totalCov %d * numTbl %d) 
\n, Q,totalCov, curNumMergeCS);
printf(Average precision = %f\n,(float)totalPrecision/curNumMergeCS);
-   printf(Overall precision = %f (overfill %ld / overalMaxFill %ld)\n, 
(float) overalFill/overalMaxFill, overalFill, overalMaxFill);
+   printf(Overall precision = %f (overfill %lld / overalMaxFill %lld)\n, 
(float) overalFill/overalMaxFill, overalFill, overalMaxFill);
//printf(Average precision = %f\n,(float)totalPrecision/totalCov);
 
Q = Q/((float)totalCov * curNumMergeCS);
 
printf(== Performance metric Q = %f \n, Q);
 
+   expFinalQ = expFinalQ/((float)totalExpFinalCov * numExpFinalTbl);
+
pscore.avgPrec = (float)totalPrecision/curNumMergeCS; 
pscore.overallPrec = (float) overalFill/overalMaxFill;
pscore.Qscore = Q;
//pscore.Cscore = 
pscore.nTable = curNumMergeCS;
pscore.nFinalTable = numExpFinalTbl;
+   pscore.avgPrecFinal = (float)totalExpFinalPrecision/numExpFinalTbl;
+   pscore.overallPrecFinal = (float) 
overalExpFinalFill/overalExpFinalMaxFill;
+   pscore.QscoreFinal = expFinalQ;
 
free(fillRatio); 
free(refRatio); 
@@ -8992,8 +9012,8 @@ void computeMetricsQForRefinedTable(CSse
#endif
 
float   totalPrecision = 0.0; 
-   longoveralFill = 0; 
-   longoveralMaxFill = 0;
+   lng overalFill = 0; 
+   lng overalMaxFill = 0;
 
fillRatio = (float*)malloc(sizeof(float) * numTables);
refRatio = (float*)malloc(sizeof(float) * numTables);
@@ -9130,7 +9150,7 @@ void computeMetricsQForRefinedTable(CSse
}
printf(Refined Table: Performance metric Q = (weighting %f)/(totalCov 
%d * numTbl %d) \n, Q,totalCov, numTables);
printf(Average precision = %f\n,(float)totalPrecision/numTables);
-   printf(Overall precision = %f (overfill %ld / overalMaxFill %ld)\n, 
(float) overalFill/overalMaxFill, overalFill, overalMaxFill);
+   printf(Overall precision = %f (overfill %lld / overalMaxFill %lld)\n, 
(float) overalFill/overalMaxFill, overalFill, overalMaxFill);
 
Q = Q/((float)totalCov * numTables);
 
@@ -9475,18 +9495,21 @@ void setFinalsimTfidfThreshold(Pscore *p
float totalgap; 
 
 
-   
printf(SimThreshold|avgPrecision|OvrallPrecision|Qscore|numTable|FinalTable|precRatio|finalTblRatio|tblRatio\n);
+   
printf(SimThreshold|avgPrecision|OvrallPrecision|Qscore|numTable|avgPrecisionFinal|OvrallPrecisionFinal|QscoreFinal|FinalTable|precRatio|tblRatio|precFinalRatio|finalTblRatio\n);
for ( i = 0; i  numRun; i++){
float numFinTblRatio = 1.0;
float numTblRatio = 1.0;
float precRatio = 1.0; 
+   float precRatioFinal = 1.0;
if (i  0  i  (numRun - 1)){
numFinTblRatio = (float)(pscores[i+1].nFinalTable - 
pscores[i].nFinalTable)/(pscores[i].nFinalTable - 

MonetDB: Oct2014 - Make sure we don't get buffer overflow.

2014-08-14 Thread Sjoerd Mullender
Changeset: fa7ee0a98c4b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa7ee0a98c4b
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Make sure we don't get buffer overflow.


diffs (88 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -908,44 +908,51 @@ JSONfilter(json *ret, json *js, str *exp
 // The json string should be valid
 
 static char * 
-JSONplaintext(char *r, JSON *jt, int idx, char sep)
+JSONplaintext(char *r, size_t *l, JSON *jt, int idx, char sep)
 {
int i;
size_t j;
switch(jt-elm[idx].kind){
case JSON_OBJECT:
for( i= jt-elm[idx].next; i; i= jt-elm[i].next)
-   if( jt-elm[i].child)
-   r = JSONplaintext(r, jt,jt-elm[i].child,sep );
+   if( jt-elm[i].child)
+   r = JSONplaintext(r, l, jt,jt-elm[i].child,sep 
);
break;
case JSON_ARRAY:
for( i= jt-elm[idx].next; i; i= jt-elm[i].next)
-   r = JSONplaintext(r, jt,i,sep);
+   r = JSONplaintext(r, l, jt,i,sep);
break;
case JSON_ELEMENT:
case JSON_VALUE:
if( jt-elm[idx].child)
-   r = JSONplaintext(r, jt,jt-elm[idx].child,sep);
+   r = JSONplaintext(r, l, jt,jt-elm[idx].child,sep);
break;
case JSON_STRING:
-   for(j=1; j jt-elm[idx].valuelen-1; j++){
+   for(j=1; *l  1  j jt-elm[idx].valuelen-1; j++){
if ( jt-elm[idx].value[j] == '\\')
*r = jt-elm[idx].value[++j];
else
*r = jt-elm[idx].value[j];
r++;
+   (*l)--;
}
-   if(sep)
+   if(*l  1  sep) {
*r++= sep;
+   (*l)--;
+   }
break;
default:
-   for(j=0; j jt-elm[idx].valuelen; j++){
+   for(j=0; *l  1  j jt-elm[idx].valuelen; j++){
*r = jt-elm[idx].value[j];
r++;
+   (*l)--;
}
-   if(sep)
+   if(*l  1  sep) {
*r++= sep;
+   (*l)--;
+   }
}
+   assert(*l  0);
*r = 0;
return r;
 }
@@ -959,8 +966,9 @@ JSONjson2text(str *ret, json *js)
 
jt = JSONparse(*js,0);
 
-   s = GDKzalloc(strlen(*js));
-   JSONplaintext(s,jt,0,' ');
+   l = strlen(*js) + 1;
+   s = GDKmalloc(l);
+   JSONplaintext(s,l,jt,0,' ');
l = strlen(s);
if ( l) s[l-1]= 0;
*ret = s;
@@ -977,8 +985,9 @@ JSONjson2textSeparator(str *ret, json *j
 
jt = JSONparse(*js,0);
 
-   s = GDKzalloc(strlen(*js));
-   JSONplaintext(s,jt,0,**sep);
+   l = strlen(*js) + 1;
+   s = GDKmalloc(l);
+   JSONplaintext(s,l,jt,0,**sep);
l = strlen(s);
if ( l) s[l-1]= 0;
*ret = s;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Ran indent.

2014-08-14 Thread Sjoerd Mullender
Changeset: 20485a84d25e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=20485a84d25e
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Ran indent.


diffs (truncated from 1782 to 300 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -28,8 +28,16 @@
 
 // just validate the string according to www.json.org
 // A straightforward recursive solution
-#define skipblancs(J) for(; *(J); (J)++) \
-   if( *(J) != ' '  *(J) != '\n'  *(J) != '\t'  *(J) != '\f'  *(J) 
!= '\r'  ) break;
+#define skipblancs(J)  \
+   do {
\
+   for(; *(J); (J)++)  
\
+   if (*(J) != ' '   
\
+   *(J) != '\n'  
\
+   *(J) != '\t'  
\
+   *(J) != '\f'  
\
+   *(J) != '\r')   
\
+   break;  
\
+   } while (0)
 
 #define hex(J) 
\
do {
\
@@ -46,44 +54,50 @@ int TYPE_json;
 #define JSONlast(J) ((J)-free-1)
 
 /* Internal constructors. */
-static int jsonhint= 8;
+static int jsonhint = 8;
 static JSON *JSONparse(char *j, int silent);
 
-static JSON *JSONnewtree( int size)
+static JSON *
+JSONnewtree(int size)
 {
-JSON *js;
-if ( size == 0)
-size = jsonhint;
-js = (JSON*) GDKzalloc(sizeof(JSON));
-js-elm = (JSONterm*) GDKzalloc( sizeof(JSONterm) * size);
-js-size = size;
-return js;
+   JSON *js;
+
+   if (size == 0)
+   size = jsonhint;
+   js = (JSON *) GDKzalloc(sizeof(JSON));
+   js-elm = (JSONterm *) GDKzalloc(sizeof(JSONterm) * size);
+   js-size = size;
+   return js;
 }
 
-static int JSONnew(JSON *js){
+static int
+JSONnew(JSON *js)
+{
JSONterm *term;
-if ( js-free == js-size){
-term = (JSONterm*) GDKrealloc(js-elm, sizeof(JSONterm) * (js-size + 
8));
-   if ( term == NULL){
-   js-error = 
createException(MAL,json.new,MAL_MALLOC_FAIL);
-   return js-free -1;
+
+   if (js-free == js-size) {
+   term = (JSONterm *) GDKrealloc(js-elm, sizeof(JSONterm) * 
(js-size + 8));
+   if (term == NULL) {
+   js-error = createException(MAL, json.new, 
MAL_MALLOC_FAIL);
+   return js-free - 1;
}
js-elm = term;
-   memset( ((char*)term) + sizeof(JSONterm)*js-size, 0, 8 * 
sizeof(JSONterm));
-js-size += 8;
-if ( jsonhint  js-size)
-jsonhint = js-size;
-}
-return js-free++;
+   memset(((char *) term) + sizeof(JSONterm) * js-size, 0, 8 * 
sizeof(JSONterm));
+   js-size += 8;
+   if (jsonhint  js-size)
+   jsonhint = js-size;
+   }
+   return js-free++;
 }
 
 /* Delete a JSON structure. */
-static void JSONfree(JSON *c)
+static void
+JSONfree(JSON *c)
 {
-   if( c == 0)
+   if (c == 0)
return;
-GDKfree(c-elm);
-GDKfree(c);
+   GDKfree(c-elm);
+   GDKfree(c);
 }
 
 int
@@ -91,7 +105,7 @@ JSONfromString(str src, int *len, json *
 {
ssize_t slen = (ssize_t) strlen(src);
 
-   if ( *j)
+   if (*j)
GDKfree(*j);
 
*j = GDKstrdup(src);
@@ -116,10 +130,12 @@ JSONtoString(str *s, int *len, json src)
return 0;
}
/* count how much space we need for the output string */
-   cnt = 3;/* two times  plus \0 
*/
+   cnt = 3;/* two times  plus \0 */
for (c = src; *c; c++)
switch (*c) {
-   case '': case '\\': case '\n':
+   case '':
+   case '\\':
+   case '\n':
cnt++;
/* fall through */
default:
@@ -138,7 +154,8 @@ JSONtoString(str *s, int *len, json src)
*dst++ = '';
for (c = src; *c; c++) {
switch (*c) {
-   case '': case '\\':
+   case '':
+   case '\\':
*dst++ = '\\';
/* fall through */
default:
@@ -153,7 +170,7 @@ JSONtoString(str *s, int *len, json src)
*dst++ = '';
*dst++ = 0;
assert((size_t) (dst - 

MonetDB: Oct2014 - Fix implementation of hex() macro (match all ...

2014-08-14 Thread Sjoerd Mullender
Changeset: e368e04e93a3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e368e04e93a3
Modified Files:
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:

Fix implementation of hex() macro (match all hex digits, not just octal).


diffs (18 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -31,7 +31,13 @@
 #define skipblancs(J) for(; *(J); (J)++) \
if( *(J) != ' '  *(J) != '\n'  *(J) != '\t'  *(J) != '\f'  *(J) 
!= '\r'  ) break;
 
-#define hex(J) if ( *(J) ='0'  *(J) ='7') (J)++;
+#define hex(J) 
\
+   do {
\
+   if ((*(J) ='0'  *(J) ='9') ||   \
+   (*(J) ='a'  *(J) ='f') ||   \
+   (*(J) ='A'  *(J) ='F')) \
+   (J)++;  
\
+   } while (0)
 
 #define SEPARATOR ' '
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Fix resource leaks: getTypeName returns alloc...

2014-08-14 Thread Sjoerd Mullender
Changeset: d70236749efc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d70236749efc
Modified Files:
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_resolve.c
monetdb5/modules/mal/remote.c
monetdb5/optimizer/opt_multiplex.c
Branch: Oct2014
Log Message:

Fix resource leaks: getTypeName returns allocated memory.


diffs (274 lines):

diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -1037,6 +1037,7 @@ mdbSanityCheck(Client cntxt, MalBlkPtr m
stk-cmd = 'n';
}
GDKfree(nme);
+   GDKfree(nmeOnStk);
}
}
}
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -286,8 +286,9 @@ int getBarrierEnvelop(MalBlkPtr mb){
 static void replaceTypeVar(MalBlkPtr mb, InstrPtr p, int v, malType t){
int j,i,x,y;
 #ifdef DEBUG_MAL_FCN
-   mnstr_printf(GDKout,replace type _%d by type %s\n,v,
-   getTypeName(t));
+   char *tpenme = getTypeName(t);
+   mnstr_printf(GDKout,replace type _%d by type %s\n,v, tpenme);
+   GDKfree(tpenme);
 #endif
for(j=0; jmb-stop; j++){
p= getInstrPtr(mb,j);
@@ -317,18 +318,28 @@ static void replaceTypeVar(MalBlkPtr mb,
setAnyColumnIndex(y,tx);
setArgType(mb,p,i,y);
 #ifdef DEBUG_MAL_FCN
-   mnstr_printf(GDKout, %d replaced %s-%s 
\n,i,getTypeName(x),getTypeName(y));
+   {
+   char *xnme = getTypeName(x), *ynme = 
getTypeName(y);
+   mnstr_printf(GDKout, %d replaced %s-%s 
\n,i,xnme,ynme);
+   GDKfree(xnme);
+   GDKfree(ynme);
+   }
 #endif
} else
if(getColumnIndex(x) == v){
 #ifdef DEBUG_MAL_FCN
-   mnstr_printf(GDKout, replace x= %s 
polymorphic\n,getTypeName(x));
+   char *xnme = getTypeName(x);
+   mnstr_printf(GDKout, replace x= %s 
polymorphic\n,xnme);
+   GDKfree(xnme);
 #endif
setArgType(mb,p,i,t);
}
 #ifdef DEBUG_MAL_FCN
-   else
-   mnstr_printf(GDKout, non x= %s 
%d\n,getTypeName(x),getColumnIndex(x));
+   else {
+   char *xnme = getTypeName(x);
+   mnstr_printf(GDKout, non x= %s 
%d\n,xnme,getColumnIndex(x));
+   GDKfree(xnme);
+   }
 #endif
}
 #ifdef DEBUG_MAL_FCN
@@ -417,8 +428,11 @@ cloneFunction(stream *out, Module scope,
replaceTypeVar(new-def, pp, getColumnIndex(v), 
t);
}
 #ifdef DEBUG_MAL_FCN
-   else
-   mnstr_printf(out,%d remains %s\n, i, getTypeName(v));
+   else {
+   char *tpenme = getTypeName(v);
+   mnstr_printf(out,%d remains %s\n, i, tpenme);
+   GDKfree(tpenme);
+   }
 #endif
/* include the function at the proper place in the scope */
insertSymbolBefore(scope, new, proc);
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -499,11 +499,14 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
snprintf(ct, 
1024+strlen(cv), =%s, cv);
else
snprintf(ct, 
1024+strlen(cv), =\%s\, cv);
-   } else
-   if ( strcmp(cv,nil) == 0)
-   snprintf(ct, 1024+strlen(cv), 
=%s:%s, cv, getTypeName(getColumnType(getArgType(mb,p,i;
-   else
-   snprintf(ct, 1024+strlen(cv), 
=\%s\:%s, cv, getTypeName(getColumnType(getArgType(mb,p,i;
+   } else {
+   char *tpe = 
getTypeName(getColumnType(getArgType(mb,p,i)));
+   if ( strcmp(cv,nil) == 0)
+   snprintf(ct, 
1024+strlen(cv), =%s:%s, cv, tpe);
+   else
+   snprintf(ct, 
1024+strlen(cv), =\%s\:%s, cv, tpe);
+   GDKfree(tpe);
+

MonetDB: default - Merge with Oct2014 branch.

2014-08-14 Thread Sjoerd Mullender
Changeset: 7275d930f7eb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7275d930f7eb
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_none.stable.out
clients/mapiclient/tomograph.c
common/utils/muuid.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_imprints.c
gdk/gdk_posix.c
gdk/gdk_sample.c
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_resolve.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/json.mal
monetdb5/modules/atoms/str.c
monetdb5/modules/atoms/uuid.c
monetdb5/modules/kernel/microbenchmark.c
monetdb5/modules/kernel/mmath.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/remote.c
monetdb5/optimizer/opt_mapreduce.c
monetdb5/optimizer/opt_multiplex.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_gencode.c
sql/benchmarks/tpch/Tests/02-explain.stable.out
sql/benchmarks/tpch/Tests/02-plan.stable.out
sql/benchmarks/tpch/Tests/10-plan.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out
sql/benchmarks/tpch/Tests/17-plan.stable.out
sql/benchmarks/tpch/Tests/18-plan.stable.out
sql/benchmarks/tpch/Tests/20-explain.stable.out
sql/benchmarks/tpch/Tests/20-plan.stable.out
sql/benchmarks/tpch/Tests/21-plan.stable.out
sql/include/sql_catalog.h
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_select.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/discoveryrunner.c
tools/merovingian/utils/utils.c
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 4347 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
@@ -39340,7 +39340,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out 
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -39256,7 +39256,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_geom.stable.out 
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -39232,7 +39232,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/Tests/MAL-signatures_none.stable.out 
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -39061,7 +39061,7 @@ comment Create an iterator with fixed gr
 
 command json.dump(j:json):void 
 address JSONdump;
-pattern json.fold(k:bat[:oid,:any]):json 
+pattern json.fold(v:bat[:oid,:any]):json 
 address JSONfold;
 comment Combine the value list into a single json array object.
 
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -820,7 +820,7 @@ initcolors(FILE *map)
 
if (map) {
/* read the color map */
-   while (fscanf(map,%s\t%s\t%s\n, buf[0],buf[1],buf[2])== 3  
i NUM_COLORS) {
+   while (fscanf(map,%127s\t%127s\t%127s\n, 
buf[0],buf[1],buf[2])== 3  i NUM_COLORS) {
colors[i].mod = strdup(buf[0]);
colors[i].fcn = strdup(buf[1]);
colors[i].freq = 0;
@@ -1875,7 +1875,7 @@ parser(char *row)
/* convert time to epoch in seconds*/
memset(stm, 0, sizeof(struct tm));
  

MonetDB: Oct2014 - remove unused variable p

2014-08-14 Thread Niels Nes
Changeset: 9d615402e7c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9d615402e7c6
Modified Files:
sql/server/rel_optimizer.c
Branch: Oct2014
Log Message:

remove unused variable p


diffs (25 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -3122,19 +3122,18 @@ rel_push_groupby_down(int *changes, mvc 
if (rel-op == op_groupby  list_length(gbe) == 1  is_join(j-op)) {
sql_rel *jl = j-l, *jr = j-r, *cr;
sql_exp *gb = gbe-h-data, *e;
-   prop *p;
node *n;
int left = 1;
list *aggrs, *gbe;
 
if (jl-op == op_project 
(e = list_find_exp( jl-exps, gb)) != NULL 
-   (p = find_prop(e-p, PROP_HASHCOL)) != NULL) {
+find_prop(e-p, PROP_HASHCOL) != NULL) {
left = 0;
cr = jr;
} else if (jr-op == op_project 
(e = list_find_exp( jr-exps, gb)) != NULL 
-   (p = find_prop(e-p, PROP_HASHCOL)) != NULL) {
+find_prop(e-p, PROP_HASHCOL) != NULL) {
left = 1;
cr = jl;
} else {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2014 - Tell compiler where to find openssl/rand.h.

2014-08-14 Thread Sjoerd Mullender
Changeset: a00e75e9820a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a00e75e9820a
Modified Files:
monetdb5/modules/atoms/Makefile.ag
monetdb5/modules/mal/Makefile.ag
tools/merovingian/utils/Makefile.ag
Branch: Oct2014
Log Message:

Tell compiler where to find openssl/rand.h.


diffs (38 lines):

diff --git a/monetdb5/modules/atoms/Makefile.ag 
b/monetdb5/modules/atoms/Makefile.ag
--- a/monetdb5/modules/atoms/Makefile.ag
+++ b/monetdb5/modules/atoms/Makefile.ag
@@ -20,7 +20,7 @@ INCLUDES = ../../mal \
   ../../../common/stream \
   ../../../common/utils \
   ../../../gdk \
-  $(libxml2_CFLAGS) $(curl_CFLAGS)
+  $(libxml2_CFLAGS) $(curl_CFLAGS) $(openssl_CFLAGS)
 MTSAFE
 
 lib_atoms = {
diff --git a/monetdb5/modules/mal/Makefile.ag b/monetdb5/modules/mal/Makefile.ag
--- a/monetdb5/modules/mal/Makefile.ag
+++ b/monetdb5/modules/mal/Makefile.ag
@@ -21,7 +21,8 @@ INCLUDES = ../../mal ../atoms ../kernel 
../../../common/stream \
../../../common/utils \
../../../gdk \
-   $(pcre_CFLAGS) $(zlib_CFLAGS) $(BZIP_INCS) $(MSGCONTROL_FLAGS)
+   $(pcre_CFLAGS) $(zlib_CFLAGS) $(BZIP_INCS) $(MSGCONTROL_FLAGS) \
+   $(openssl_CFLAGS)
 
 MTSAFE
 
diff --git a/tools/merovingian/utils/Makefile.ag 
b/tools/merovingian/utils/Makefile.ag
--- a/tools/merovingian/utils/Makefile.ag
+++ b/tools/merovingian/utils/Makefile.ag
@@ -17,7 +17,8 @@
 
 INCLUDES = ../../../common/stream \
   ../../../common/options \
-  ../../../common/utils
+  ../../../common/utils \
+  $(openssl_CFLAGS)
 
 lib_meroutil = {
NOINST
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Oct2014 branch.

2014-08-14 Thread Sjoerd Mullender
Changeset: b60934ca3f0b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b60934ca3f0b
Modified Files:
monetdb5/modules/atoms/Makefile.ag
monetdb5/modules/mal/Makefile.ag
sql/server/rel_optimizer.c
tools/merovingian/utils/Makefile.ag
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (63 lines):

diff --git a/monetdb5/modules/atoms/Makefile.ag 
b/monetdb5/modules/atoms/Makefile.ag
--- a/monetdb5/modules/atoms/Makefile.ag
+++ b/monetdb5/modules/atoms/Makefile.ag
@@ -20,7 +20,7 @@ INCLUDES = ../../mal \
   ../../../common/stream \
   ../../../common/utils \
   ../../../gdk \
-  $(libxml2_CFLAGS) $(curl_CFLAGS)
+  $(libxml2_CFLAGS) $(curl_CFLAGS) $(openssl_CFLAGS)
 MTSAFE
 
 lib_atoms = {
diff --git a/monetdb5/modules/mal/Makefile.ag b/monetdb5/modules/mal/Makefile.ag
--- a/monetdb5/modules/mal/Makefile.ag
+++ b/monetdb5/modules/mal/Makefile.ag
@@ -21,7 +21,8 @@ INCLUDES = ../../mal ../atoms ../kernel 
../../../common/stream \
../../../common/utils \
../../../gdk \
-   $(pcre_CFLAGS) $(zlib_CFLAGS) $(BZIP_INCS) $(MSGCONTROL_FLAGS)
+   $(pcre_CFLAGS) $(zlib_CFLAGS) $(BZIP_INCS) $(MSGCONTROL_FLAGS) \
+   $(openssl_CFLAGS)
 
 MTSAFE
 
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -3122,19 +3122,18 @@ rel_push_groupby_down(int *changes, mvc 
if (rel-op == op_groupby  list_length(gbe) == 1  is_join(j-op)) {
sql_rel *jl = j-l, *jr = j-r, *cr;
sql_exp *gb = gbe-h-data, *e;
-   prop *p;
node *n;
int left = 1;
list *aggrs, *gbe;
 
if (jl-op == op_project 
(e = list_find_exp( jl-exps, gb)) != NULL 
-   (p = find_prop(e-p, PROP_HASHCOL)) != NULL) {
+find_prop(e-p, PROP_HASHCOL) != NULL) {
left = 0;
cr = jr;
} else if (jr-op == op_project 
(e = list_find_exp( jr-exps, gb)) != NULL 
-   (p = find_prop(e-p, PROP_HASHCOL)) != NULL) {
+find_prop(e-p, PROP_HASHCOL) != NULL) {
left = 1;
cr = jl;
} else {
diff --git a/tools/merovingian/utils/Makefile.ag 
b/tools/merovingian/utils/Makefile.ag
--- a/tools/merovingian/utils/Makefile.ag
+++ b/tools/merovingian/utils/Makefile.ag
@@ -17,7 +17,8 @@
 
 INCLUDES = ../../../common/stream \
   ../../../common/options \
-  ../../../common/utils
+  ../../../common/utils \
+  $(openssl_CFLAGS)
 
 lib_meroutil = {
NOINST
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - First part of dictionary encoding

2014-08-14 Thread Martin Kersten
Changeset: 2892bd83a494 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2892bd83a494
Added Files:
monetdb5/modules/mal/Tests/mosaic_dict.mal
monetdb5/modules/mal/Tests/mosaic_dict.stable.err
monetdb5/modules/mal/Tests/mosaic_dict.stable.out
monetdb5/modules/mal/Tests/mosaic_dict_subselect.mal
monetdb5/modules/mal/mosaic_dict.c
Modified Files:
monetdb5/modules/mal/Tests/All
monetdb5/modules/mal/mosaic.c
monetdb5/modules/mal/mosaic.h
monetdb5/modules/mal/mosaic.mal
monetdb5/modules/mal/mosaic_hdr.c
monetdb5/modules/mal/mosaic_none.c
monetdb5/modules/mal/mosaic_rle.c
sql/backends/monet5/sql.c
sql/test/mosaic/Tests/compression.sql
Branch: mosaic
Log Message:

First part of dictionary encoding


diffs (truncated from 1483 to 300 lines):

diff --git a/monetdb5/modules/mal/Tests/All b/monetdb5/modules/mal/Tests/All
--- a/monetdb5/modules/mal/Tests/All
+++ b/monetdb5/modules/mal/Tests/All
@@ -70,6 +70,7 @@ manifoldstr
 mosaic_none
 mosaic_rle
 mosaic_mix
+mosaic_dict
 
 mosaic_none_double
 
diff --git a/monetdb5/modules/mal/Tests/mosaic_dict.mal 
b/monetdb5/modules/mal/Tests/mosaic_dict.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/mosaic_dict.mal
@@ -0,0 +1,13 @@
+b:= bat.new(:oid,:timestamp);
+bat.append(b,2014-08-14 12:00:00:timestamp);
+bat.append(b,2014-08-14 12:00:00:timestamp);
+bat.append(b,2014-08-14 12:01:00:timestamp);
+bat.append(b,2014-08-14 12:02:00:timestamp);
+bat.append(b,2014-08-14 12:00:00:timestamp);
+b:= bat.append(b,b);
+
+io.print(b);
+x:= mosaic.compress(b,dict);
+#mosaic.dump(x);
+z:= mosaic.decompress(x);
+io.print(z);
diff --git a/monetdb5/modules/mal/Tests/mosaic_dict.stable.err 
b/monetdb5/modules/mal/Tests/mosaic_dict.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/mosaic_dict.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'mosaic_dict` in directory 'monetdb5/modules/mal` itself:
+
+
+# 00:21:55   
+# 00:21:55   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=34101 --set 
mapi_usock=/var/tmp/mtest-14508/.s.monetdb.34101 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/export/scratch1/mk/mosaic//Linux/var/MonetDB/mTests_monetdb5_modules_mal
 mosaic_dict.mal
+# 00:21:55   
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/mosaic//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = 
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 34101
+# cmdline opt  mapi_usock = /var/tmp/mtest-14508/.s.monetdb.34101
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/mosaic//Linux/var/MonetDB/mTests_monetdb5_modules_mal
+# cmdline opt  gdk_debug = 536870922
+
+# 00:21:55   
+# 00:21:55   Done.
+# 00:21:55   
+
diff --git a/monetdb5/modules/mal/Tests/mosaic_dict.stable.out 
b/monetdb5/modules/mal/Tests/mosaic_dict.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/mosaic_dict.stable.out
@@ -0,0 +1,75 @@
+stdout of test 'mosaic_dict` in directory 'monetdb5/modules/mal` itself:
+
+
+# 00:21:55   
+# 00:21:55   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=34101 --set 
mapi_usock=/var/tmp/mtest-14508/.s.monetdb.34101 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/export/scratch1/mk/mosaic//Linux/var/MonetDB/mTests_monetdb5_modules_mal
 mosaic_dict.mal
+# 00:21:55   
+
+# MonetDB 5 server v11.20.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_modules_mal', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
+# Found 15.591 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://vienna.ins.cwi.nl:34101/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-14508/.s.monetdb.34101
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+b := bat.new(:oid,:timestamp);
+bat.append(b,2014-08-14 12:00:00.000:timestamp);
+bat.append(b,2014-08-14 12:00:00.000:timestamp);
+bat.append(b,2014-08-14 12:01:00.000:timestamp);
+bat.append(b,2014-08-14 12:02:00.000:timestamp);
+bat.append(b,2014-08-14 12:00:00.000:timestamp);
+b := bat.append(b,b);
+io.print(b);
+x := mosaic.compress(b,dict);
+#mosaic.dump(x); 
+z := mosaic.decompress(x);
+

MonetDB: mosaic - Fixing compilation and target tests towards al...

2014-08-14 Thread Martin Kersten
Changeset: 7b66ab599570 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b66ab599570
Modified Files:
monetdb5/modules/mal/Tests/mosaic_none.mal
monetdb5/modules/mal/Tests/mosaic_none.stable.out
monetdb5/modules/mal/Tests/mosaic_none_double.mal
monetdb5/modules/mal/Tests/mosaic_none_joins.mal
monetdb5/modules/mal/Tests/mosaic_none_joins.stable.out
monetdb5/modules/mal/Tests/mosaic_none_subselect.mal
monetdb5/modules/mal/Tests/mosaic_none_subselect.stable.out
monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.mal
monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.stable.out
monetdb5/modules/mal/Tests/mosaic_rle.mal
monetdb5/modules/mal/Tests/mosaic_rle.stable.out
monetdb5/modules/mal/Tests/mosaic_rle_joins.mal
monetdb5/modules/mal/Tests/mosaic_rle_joins.stable.out
monetdb5/modules/mal/Tests/mosaic_rle_subselect.mal
monetdb5/modules/mal/Tests/mosaic_rle_subselect.stable.out
monetdb5/modules/mal/Tests/mosaic_rle_thetasubselect.mal
monetdb5/modules/mal/Tests/mosaic_rle_thetasubselect.stable.out
monetdb5/modules/mal/mosaic.c
monetdb5/modules/mal/mosaic_dict.c
monetdb5/modules/mal/mosaic_hdr.c
Branch: mosaic
Log Message:

Fixing compilation and target tests towards algorithm


diffs (265 lines):

diff --git a/monetdb5/modules/mal/Tests/mosaic_none.mal 
b/monetdb5/modules/mal/Tests/mosaic_none.mal
--- a/monetdb5/modules/mal/Tests/mosaic_none.mal
+++ b/monetdb5/modules/mal/Tests/mosaic_none.mal
@@ -8,7 +8,7 @@ bat.append(b,9);
 b:= bat.append(b,b);
 
 io.print(b);
-x:= mosaic.compress(b);
+x:= mosaic.compress(b,none);
 #mosaic.dump(x);
 z:= mosaic.decompress(x);
 io.print(z);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none.stable.out 
b/monetdb5/modules/mal/Tests/mosaic_none.stable.out
--- a/monetdb5/modules/mal/Tests/mosaic_none.stable.out
+++ b/monetdb5/modules/mal/Tests/mosaic_none.stable.out
@@ -25,7 +25,7 @@ function user.main():void;
 bat.append(b,9);
 b := bat.append(b,b);
 io.print(b);
-x := mosaic.compress(b);
+x := mosaic.compress(b,none);
 #mosaic.dump(x); 
 z := mosaic.decompress(x);
 io.print(z);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_double.mal 
b/monetdb5/modules/mal/Tests/mosaic_none_double.mal
--- a/monetdb5/modules/mal/Tests/mosaic_none_double.mal
+++ b/monetdb5/modules/mal/Tests/mosaic_none_double.mal
@@ -5,12 +5,12 @@ bat.append(b,9);
 b:= bat.append(b,b);
 
 io.print(b);
-x:= mosaic.compress(b);
+x:= mosaic.compress(b,none);
 mosaic.dump(x);
 xd := mosaic.decompress(x);
 io.print(xd);
 
-z:= mosaic.compress(x);
+z:= mosaic.compress(x,none);
 mosaic.dump(z);
 zd := mosaic.decompress(z);
 io.print(zd);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_joins.mal 
b/monetdb5/modules/mal/Tests/mosaic_none_joins.mal
--- a/monetdb5/modules/mal/Tests/mosaic_none_joins.mal
+++ b/monetdb5/modules/mal/Tests/mosaic_none_joins.mal
@@ -7,7 +7,7 @@ bat.append(b,9);
 b:= bat.append(b,b);
 
 io.print(b);
-x:= mosaic.compress(b);
+x:= mosaic.compress(b,none);
 
 c:= bat.new(:oid,:oid);
 bat.append(c,0@0);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_joins.stable.out 
b/monetdb5/modules/mal/Tests/mosaic_none_joins.stable.out
--- a/monetdb5/modules/mal/Tests/mosaic_none_joins.stable.out
+++ b/monetdb5/modules/mal/Tests/mosaic_none_joins.stable.out
@@ -25,7 +25,7 @@ function user.main():void;
 bat.append(b,9);
 b := bat.append(b,b);
 io.print(b);
-x := mosaic.compress(b);
+x := mosaic.compress(b,none);
 c := bat.new(:oid,:oid);
 bat.append(c,0@0);
 bat.append(c,2@0);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_subselect.mal 
b/monetdb5/modules/mal/Tests/mosaic_none_subselect.mal
--- a/monetdb5/modules/mal/Tests/mosaic_none_subselect.mal
+++ b/monetdb5/modules/mal/Tests/mosaic_none_subselect.mal
@@ -8,7 +8,7 @@ bat.append(b,9);
 b:= bat.append(b,b);
 
 io.print(b);
-x:= mosaic.compress(b);
+x:= mosaic.compress(b,none);
 #mosaic.dump(x);
 s:= algebra.subselect(b,0,50,false,false,false);
 io.print(s);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_subselect.stable.out 
b/monetdb5/modules/mal/Tests/mosaic_none_subselect.stable.out
--- a/monetdb5/modules/mal/Tests/mosaic_none_subselect.stable.out
+++ b/monetdb5/modules/mal/Tests/mosaic_none_subselect.stable.out
@@ -25,7 +25,7 @@ function user.main():void;
 bat.append(b,9);
 b := bat.append(b,b);
 io.print(b);
-x := mosaic.compress(b);
+x := mosaic.compress(b,none);
 #mosaic.dump(x); 
 s := algebra.subselect(b,0,50,false,false,false);
 io.print(s);
diff --git a/monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.mal 
b/monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.mal
--- a/monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.mal
+++ b/monetdb5/modules/mal/Tests/mosaic_none_thetasubselect.mal
@@ -7,7 +7,7 @@ bat.append(b,9);
 b:= bat.append(b,b);