MonetDB: Jul2017 - Add missing PTRFMTCAST for debug build.

2017-10-10 Thread Sjoerd Mullender
Changeset: 5aad05202085 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5aad05202085
Modified Files:
sql/include/sql_mem.h
Branch: Jul2017
Log Message:

Add missing PTRFMTCAST for debug build.


diffs (48 lines):

diff --git a/sql/include/sql_mem.h b/sql/include/sql_mem.h
--- a/sql/include/sql_mem.h
+++ b/sql/include/sql_mem.h
@@ -88,7 +88,7 @@ extern size_t sa_size( sql_allocator *sa
fprintf(stderr, \
"#sa_alloc(" PTRFMT "," SZFMT ") -> " PTRFMT \
" %s[%s:%d]\n", \
-   _sa, _sz, PTRFMTCAST _res,  \
+   PTRFMTCAST _sa, _sz, PTRFMTCAST _res,   \
__func__, __FILE__, __LINE__);  \
_res;   \
})
@@ -101,7 +101,7 @@ extern size_t sa_size( sql_allocator *sa
fprintf(stderr, \
"#sa_zalloc(" PTRFMT "," SZFMT ") -> " PTRFMT \
" %s[%s:%d]\n", \
-   _sa, _sz, PTRFMTCAST _res,  \
+   PTRFMTCAST _sa, _sz, PTRFMTCAST _res,   \
__func__, __FILE__, __LINE__);  \
_res;   \
})
@@ -116,7 +116,7 @@ extern size_t sa_size( sql_allocator *sa
fprintf(stderr, \
"#sa_realloc(" PTRFMT "," PTRFMT "," SZFMT "," 
SZFMT ") -> " PTRFMT \
" %s[%s:%d]\n", \
-   _sa, PTRFMTCAST _ptr, _sz, _osz,\
+   PTRFMTCAST _sa, PTRFMTCAST _ptr, _sz, _osz, \
PTRFMTCAST _res,\
__func__, __FILE__, __LINE__);  \
_res;   \
@@ -130,7 +130,7 @@ extern size_t sa_size( sql_allocator *sa
fprintf(stderr, \
"#sa_strdup(" PTRFMT ",len=" SZFMT ") -> " 
PTRFMT \
" %s[%s:%d]\n", \
-   _sa, strlen(_s), PTRFMTCAST _res,   \
+   PTRFMTCAST _sa, strlen(_s), PTRFMTCAST _res, \
__func__, __FILE__, __LINE__);  \
_res;   \
})
@@ -144,7 +144,7 @@ extern size_t sa_size( sql_allocator *sa
fprintf(stderr, \
"#sa_strndup(" PTRFMT ",len=" SZFMT ") -> " 
PTRFMT \
" %s[%s:%d]\n", \
-   _sa, _l, PTRFMTCAST _res,   \
+   PTRFMTCAST _sa, _l, PTRFMTCAST _res,\
__func__, __FILE__, __LINE__);  \
_res;   \
})
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Various small fixes.

2017-10-10 Thread Sjoerd Mullender
Changeset: dbc4efe04eb2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dbc4efe04eb2
Modified Files:
common/stream/stream.c
Branch: Jul2017
Log Message:

Various small fixes.
- Use modern gzfread/gzfwrite functions (with implementation for
  ancient systems we still support);
- Types and cast fixes;
- Implemented loops for some compression write functions.
- Use mode "r" for opening compressed text streams.


diffs (truncated from 654 to 300 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -142,19 +142,45 @@
 #define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s)))
 #define long_long_SWAP(l)  ((lng) _byteswap_uint64((unsigned __int64) (s)))
 #else
-#define short_int_SWAP(s) ((short)(((0x00ff&(s))<<8) | ((0xff00&(s))>>8)))
-
-#define normal_int_SWAP(i) (((0x00ff&(i))<<24) | ((0xff00&(i))<<8) | \
-   ((0x00ff&(i))>>8)  | ((0xff00&(i))>>24))
-#define long_long_SWAP(l) \
-   lng)normal_int_SWAP(l))<<32) |\
-(0x&normal_int_SWAP(l>>32)))
+#define short_int_SWAP(s)  \
+   ((short) (((0x00ff & (unsigned short) (s)) << 8) |  \
+ ((0xff00 & (unsigned short) (s)) >> 8)))
+
+#define normal_int_SWAP(i) \
+   ((int) (unsigned) 0xff <<  0) & (unsigned) (i)) << 24) |\
+   unsigned) 0xff <<  8) & (unsigned) (i)) <<  8) |\
+   unsigned) 0xff << 16) & (unsigned) (i)) >>  8) |\
+   unsigned) 0xff << 24) & (unsigned) (i)) >> 24)))
+
+#define long_long_SWAP(l)  \
+   ((lng) (ulng) 0xff <<  0) & (ulng) (l)) << 56) |\
+   ulng) 0xff <<  8) & (ulng) (l)) << 40) |\
+   ulng) 0xff << 16) & (ulng) (l)) << 24) |\
+   ulng) 0xff << 24) & (ulng) (l)) <<  8) |\
+   ulng) 0xff << 32) & (ulng) (l)) >>  8) |\
+   ulng) 0xff << 40) & (ulng) (l)) >> 24) |\
+   ulng) 0xff << 48) & (ulng) (l)) >> 40) |\
+   ulng) 0xff << 56) & (ulng) (l)) >> 56)))
 #endif
 
 #ifdef HAVE_HGE
-#define huge_int_SWAP(h) \
-   hge)long_long_SWAP(h))<<64) |\
-(0x&long_long_SWAP(h>>64)))
+#define huge_int_SWAP(h)   \
+   ((hge) (uhge) 0xff <<   0) & (uhge) (h)) << 120) |  \
+   uhge) 0xff <<   8) & (uhge) (h)) << 104) |  \
+   uhge) 0xff <<  16) & (uhge) (h)) <<  88) |  \
+   uhge) 0xff <<  24) & (uhge) (h)) <<  72) |  \
+   uhge) 0xff <<  32) & (uhge) (h)) <<  56) |  \
+   uhge) 0xff <<  40) & (uhge) (h)) <<  40) |  \
+   uhge) 0xff <<  48) & (uhge) (h)) <<  24) |  \
+   uhge) 0xff <<  56) & (uhge) (h)) <<   8) |  \
+   uhge) 0xff <<  64) & (uhge) (h)) >>   8) |  \
+   uhge) 0xff <<  72) & (uhge) (h)) >>  24) |  \
+   uhge) 0xff <<  80) & (uhge) (h)) >>  40) |  \
+   uhge) 0xff <<  88) & (uhge) (h)) >>  56) |  \
+   uhge) 0xff <<  96) & (uhge) (h)) >>  72) |  \
+   uhge) 0xff << 104) & (uhge) (h)) >>  88) |  \
+   uhge) 0xff << 112) & (uhge) (h)) >> 104) |  \
+   uhge) 0xff << 120) & (uhge) (h)) >> 120)))
 #endif
 
 
@@ -965,70 +991,94 @@ open_stream(const char *filename, const 
 /* streams working on a gzip-compressed disk file */
 
 #ifdef HAVE_LIBZ
+#if ZLIB_VERNUM < 0x1290
+/* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
+static z_size_t
+gzfread(void *buf, z_size_t size, z_size_t nitems, gzFile file)
+{
+   unsigned sz = nitems * size > (size_t) 1 << 30 ? 1 << 30 : (unsigned) 
(nitems * size);
+   int len;
+
+   len = gzread(fp, buf, sz);
+   if (len == -1)
+   return 0;
+   return (z_size_t) len / size;
+}
+
+static z_size_t
+gzfwrite(const void *buf, z_size_t size, z_size_t nitems, gzFile file)
+{
+   z_size_t sz = nitems * size;
+
+   while (sz > 0) {
+   unsigned len = sz > ((z_size_t) 1 << 30) ? 1 << 30 : (unsigned) 
sz;
+   int wlen;
+
+   wlen = gzwrite(file, buf, len);
+   if (wlen <= 0)
+   return 0;
+   buf = (const void *) ((const char *) buf + wlen);
+   sz -= (z_wize_t) wlen;
+   }
+   return nitems;
+}
+#endif
+
 static ssize_t
 stream_gzread(stream *s, void *buf, size_t elmsize, size_t cnt)
 {
gzFile fp = (gzFile) s->stream_data.p;
-   int size = (int) (elmsize * cnt);
-   int err = 0;
+   z_size_t size;
 
if (fp == NULL) {
s->errnr = MNSTR_READ_ERROR;
 

MonetDB: default - Merge with Jul2017 branch.

2017-10-10 Thread Sjoerd Mullender
Changeset: 4f2bb9877209 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f2bb9877209
Modified Files:
common/stream/stream.c
sql/include/sql_mem.h
Branch: default
Log Message:

Merge with Jul2017 branch.


diffs (truncated from 643 to 300 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -142,19 +142,45 @@
 #define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s)))
 #define long_long_SWAP(l)  ((lng) _byteswap_uint64((unsigned __int64) (s)))
 #else
-#define short_int_SWAP(s) ((short)(((0x00ff&(s))<<8) | ((0xff00&(s))>>8)))
-
-#define normal_int_SWAP(i) (((0x00ff&(i))<<24) | ((0xff00&(i))<<8) | \
-   ((0x00ff&(i))>>8)  | ((0xff00&(i))>>24))
-#define long_long_SWAP(l) \
-   lng)normal_int_SWAP(l))<<32) |\
-(0x&normal_int_SWAP(l>>32)))
+#define short_int_SWAP(s)  \
+   ((short) (((0x00ff & (unsigned short) (s)) << 8) |  \
+ ((0xff00 & (unsigned short) (s)) >> 8)))
+
+#define normal_int_SWAP(i) \
+   ((int) (unsigned) 0xff <<  0) & (unsigned) (i)) << 24) |\
+   unsigned) 0xff <<  8) & (unsigned) (i)) <<  8) |\
+   unsigned) 0xff << 16) & (unsigned) (i)) >>  8) |\
+   unsigned) 0xff << 24) & (unsigned) (i)) >> 24)))
+
+#define long_long_SWAP(l)  \
+   ((lng) (ulng) 0xff <<  0) & (ulng) (l)) << 56) |\
+   ulng) 0xff <<  8) & (ulng) (l)) << 40) |\
+   ulng) 0xff << 16) & (ulng) (l)) << 24) |\
+   ulng) 0xff << 24) & (ulng) (l)) <<  8) |\
+   ulng) 0xff << 32) & (ulng) (l)) >>  8) |\
+   ulng) 0xff << 40) & (ulng) (l)) >> 24) |\
+   ulng) 0xff << 48) & (ulng) (l)) >> 40) |\
+   ulng) 0xff << 56) & (ulng) (l)) >> 56)))
 #endif
 
 #ifdef HAVE_HGE
-#define huge_int_SWAP(h) \
-   hge)long_long_SWAP(h))<<64) |\
-(0x&long_long_SWAP(h>>64)))
+#define huge_int_SWAP(h)   \
+   ((hge) (uhge) 0xff <<   0) & (uhge) (h)) << 120) |  \
+   uhge) 0xff <<   8) & (uhge) (h)) << 104) |  \
+   uhge) 0xff <<  16) & (uhge) (h)) <<  88) |  \
+   uhge) 0xff <<  24) & (uhge) (h)) <<  72) |  \
+   uhge) 0xff <<  32) & (uhge) (h)) <<  56) |  \
+   uhge) 0xff <<  40) & (uhge) (h)) <<  40) |  \
+   uhge) 0xff <<  48) & (uhge) (h)) <<  24) |  \
+   uhge) 0xff <<  56) & (uhge) (h)) <<   8) |  \
+   uhge) 0xff <<  64) & (uhge) (h)) >>   8) |  \
+   uhge) 0xff <<  72) & (uhge) (h)) >>  24) |  \
+   uhge) 0xff <<  80) & (uhge) (h)) >>  40) |  \
+   uhge) 0xff <<  88) & (uhge) (h)) >>  56) |  \
+   uhge) 0xff <<  96) & (uhge) (h)) >>  72) |  \
+   uhge) 0xff << 104) & (uhge) (h)) >>  88) |  \
+   uhge) 0xff << 112) & (uhge) (h)) >> 104) |  \
+   uhge) 0xff << 120) & (uhge) (h)) >> 120)))
 #endif
 
 
@@ -935,70 +961,94 @@ open_stream(const char *filename, const 
 /* streams working on a gzip-compressed disk file */
 
 #ifdef HAVE_LIBZ
+#if ZLIB_VERNUM < 0x1290
+/* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
+static z_size_t
+gzfread(void *buf, z_size_t size, z_size_t nitems, gzFile file)
+{
+   unsigned sz = nitems * size > (size_t) 1 << 30 ? 1 << 30 : (unsigned) 
(nitems * size);
+   int len;
+
+   len = gzread(fp, buf, sz);
+   if (len == -1)
+   return 0;
+   return (z_size_t) len / size;
+}
+
+static z_size_t
+gzfwrite(const void *buf, z_size_t size, z_size_t nitems, gzFile file)
+{
+   z_size_t sz = nitems * size;
+
+   while (sz > 0) {
+   unsigned len = sz > ((z_size_t) 1 << 30) ? 1 << 30 : (unsigned) 
sz;
+   int wlen;
+
+   wlen = gzwrite(file, buf, len);
+   if (wlen <= 0)
+   return 0;
+   buf = (const void *) ((const char *) buf + wlen);
+   sz -= (z_wize_t) wlen;
+   }
+   return nitems;
+}
+#endif
+
 static ssize_t
 stream_gzread(stream *s, void *buf, size_t elmsize, size_t cnt)
 {
gzFile fp = (gzFile) s->stream_data.p;
-   int size = (int) (elmsize * cnt);
-   int err = 0;
+   z_size_t size;
 
if (fp == NULL) {
s->errnr = MNSTR_READ_ERROR;
return -1;
}
 
-   if (size && !gzeof(fp)) {
-   size = gzread(fp, buf, size);
-   if (gzerror(fp, &err) != NULL && err < 0) {
-   s-

MonetDB: trails - Compilation fixes and defensive lines.

2017-10-10 Thread Pedro Ferreira
Changeset: ac2d5733bb10 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac2d5733bb10
Modified Files:
sql/backends/monet5/sql_cquery.c
sql/storage/store.c
Branch: trails
Log Message:

Compilation fixes and defensive lines.


diffs (151 lines):

diff --git a/sql/backends/monet5/sql_cquery.c b/sql/backends/monet5/sql_cquery.c
--- a/sql/backends/monet5/sql_cquery.c
+++ b/sql/backends/monet5/sql_cquery.c
@@ -444,7 +444,8 @@ CQregister(Client cntxt, MalBlkPtr mb, M
backend *be = (backend *) cntxt->sqlcontext;
mvc* sqlcontext;
const char* err_message = "procedure";
-   int i, j, is_function = 0, cycles = DEFAULT_CP_CYCLES, idx, ttlen;
+   int i, j, is_function = 0, cycles = DEFAULT_CP_CYCLES, idx;
+   size_t ttlen = 0;
lng heartbeats = DEFAULT_CP_HEARTBEAT, startat = 0;
 
(void) stk;
@@ -739,7 +740,7 @@ str
 CQpause(str alias, int which)
 {
int idx = 0;
-   str msg = MAL_SUCCEED;
+   str msg = MAL_SUCCEED, this_alias = NULL;
const char* err_message = (which & mod_continuous_function) ? 
"function" : "procedure";
MT_Id myID = MT_getpid();
 
@@ -757,15 +758,18 @@ CQpause(str alias, int which)
}
// actually wait if the query was running
if(myID != cq_pid) {
-   while( pnet[idx].status == CQRUNNING ){
+   this_alias = pnet[idx].alias; //the CQ might get removed during 
the sleep calls, so we have to make this check
+   while( idx < pnettop && this_alias == pnet[idx].alias && 
pnet[idx].status == CQRUNNING ){
MT_lock_unset(&ttrLock);
MT_sleep_ms(5);
MT_lock_set(&ttrLock);
-   if( pnet[idx].status == CQWAIT)
+   if( idx >= pnettop || pnet[idx].status == CQWAIT)
break;
}
}
-   pnet[idx].status = CQPAUSE;
+   if(idx < pnettop && this_alias == pnet[idx].alias) {
+   pnet[idx].status = CQPAUSE;
+   }
 
 finish:
MT_lock_unset(&ttrLock);
@@ -775,7 +779,7 @@ finish:
 str
 CQpauseAll(void)
 {
-   str msg = MAL_SUCCEED;
+   str msg = MAL_SUCCEED, this_alias = NULL;
int i;
MT_Id myID = MT_getpid();
//mvc* smvc;
@@ -788,15 +792,18 @@ CQpauseAll(void)
MT_lock_set(&ttrLock);
for(i = 0 ; i < pnettop; i++) {
if(myID != cq_pid) {
-   while (pnet[i].status == CQRUNNING) {
+   this_alias = pnet[i].alias;
+   while (i < pnettop && this_alias == pnet[i].alias && 
pnet[i].status == CQRUNNING) {
MT_lock_unset(&ttrLock);
MT_sleep_ms(5);
MT_lock_set(&ttrLock);
-   if (pnet[i].status == CQWAIT)
+   if (i >= pnettop && pnet[i].status == CQWAIT)
break;
}
}
-   pnet[i].status = CQPAUSE;
+   if(i < pnettop && this_alias == pnet[i].alias) {
+   pnet[i].status = CQPAUSE;
+   }
}
MT_lock_unset(&ttrLock);
return msg;
@@ -962,7 +969,7 @@ str
 CQderegister(str alias, int which)
 {
int idx = 0;
-   str msg = MAL_SUCCEED;
+   str msg = MAL_SUCCEED, this_alias = NULL;
const char* err_message = (which & mod_continuous_function) ? 
"function" : "procedure";
MT_Id myID = MT_getpid();
 
@@ -975,13 +982,17 @@ CQderegister(str alias, int which)
}
if(myID != cq_pid) {
pnet[idx].status = CQSTOP;
+   this_alias = pnet[idx].alias;
MT_lock_unset(&ttrLock);
// actually wait if the query was running
-   while (pnet[idx].status != CQDEREGISTER) {
+   // the CQ might get removed during the sleep calls, so we have 
to make this check
+   while (idx < pnettop && this_alias == pnet[idx].alias && 
pnet[idx].status != CQDEREGISTER) {
MT_sleep_ms(5);
}
MT_lock_set(&ttrLock);
-   CQfree(idx);
+   if(idx < pnettop && this_alias == pnet[idx].alias) {
+   CQfree(idx);
+   }
if( pnettop == 0) {
pnstatus = CQSTOP;
MT_lock_unset(&ttrLock);
@@ -1003,7 +1014,7 @@ finish:
 str
 CQderegisterAll(void)
 {
-   str msg = MAL_SUCCEED;
+   str msg = MAL_SUCCEED, this_alias = NULL;
int i;
MT_Id myID = MT_getpid();
//mvc* smvc;
@@ -1014,13 +1025,16 @@ CQderegisterAll(void)
for(i = 0 ; i < pnettop; i++) {
if(myID != cq_pid) {
pnet[i].status = CQSTOP;
+   this_alias = pnet[i].alias;

MonetDB: trails - Merged with default

2017-10-10 Thread Pedro Ferreira
Changeset: 6fef7e20b364 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6fef7e20b364
Added Files:
sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.sql
sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.stable.err
sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.stable.out

sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct.Bug-6411.sql

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.sql

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.stable.err

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.stable.out

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.sql

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.stable.err

sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.stable.out
Modified Files:
common/stream/stream.c
configure.ag
gdk/gdk_atoms.c
gdk/gdk_private.h
gdk/gdk_utils.c
monetdb5/mal/mal.c
monetdb5/mal/mal_namespace.c
monetdb5/modules/atoms/json.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/vaults/netcdf/netcdf.c
sql/include/sql_mem.h
sql/server/rel_dump.c
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/storage/store.c
sql/test/BugTracker-2017/Tests/All
sql/test/mergetables/Tests/part-elim.stable.out
sql/test/remote/Tests/partition_elim.stable.out
Branch: trails
Log Message:

Merged with default


diffs (truncated from 2350 to 300 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -142,19 +142,45 @@
 #define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s)))
 #define long_long_SWAP(l)  ((lng) _byteswap_uint64((unsigned __int64) (s)))
 #else
-#define short_int_SWAP(s) ((short)(((0x00ff&(s))<<8) | ((0xff00&(s))>>8)))
-
-#define normal_int_SWAP(i) (((0x00ff&(i))<<24) | ((0xff00&(i))<<8) | \
-   ((0x00ff&(i))>>8)  | ((0xff00&(i))>>24))
-#define long_long_SWAP(l) \
-   lng)normal_int_SWAP(l))<<32) |\
-(0x&normal_int_SWAP(l>>32)))
+#define short_int_SWAP(s)  \
+   ((short) (((0x00ff & (unsigned short) (s)) << 8) |  \
+ ((0xff00 & (unsigned short) (s)) >> 8)))
+
+#define normal_int_SWAP(i) \
+   ((int) (unsigned) 0xff <<  0) & (unsigned) (i)) << 24) |\
+   unsigned) 0xff <<  8) & (unsigned) (i)) <<  8) |\
+   unsigned) 0xff << 16) & (unsigned) (i)) >>  8) |\
+   unsigned) 0xff << 24) & (unsigned) (i)) >> 24)))
+
+#define long_long_SWAP(l)  \
+   ((lng) (ulng) 0xff <<  0) & (ulng) (l)) << 56) |\
+   ulng) 0xff <<  8) & (ulng) (l)) << 40) |\
+   ulng) 0xff << 16) & (ulng) (l)) << 24) |\
+   ulng) 0xff << 24) & (ulng) (l)) <<  8) |\
+   ulng) 0xff << 32) & (ulng) (l)) >>  8) |\
+   ulng) 0xff << 40) & (ulng) (l)) >> 24) |\
+   ulng) 0xff << 48) & (ulng) (l)) >> 40) |\
+   ulng) 0xff << 56) & (ulng) (l)) >> 56)))
 #endif
 
 #ifdef HAVE_HGE
-#define huge_int_SWAP(h) \
-   hge)long_long_SWAP(h))<<64) |\
-(0x&long_long_SWAP(h>>64)))
+#define huge_int_SWAP(h)   \
+   ((hge) (uhge) 0xff <<   0) & (uhge) (h)) << 120) |  \
+   uhge) 0xff <<   8) & (uhge) (h)) << 104) |  \
+   uhge) 0xff <<  16) & (uhge) (h)) <<  88) |  \
+   uhge) 0xff <<  24) & (uhge) (h)) <<  72) |  \
+   uhge) 0xff <<  32) & (uhge) (h)) <<  56) |  \
+   uhge) 0xff <<  40) & (uhge) (h)) <<  40) |  \
+   uhge) 0xff <<  48) & (uhge) (h)) <<  24) |  \
+   uhge) 0xff <<  56) & (uhge) (h)) <<   8) |  \
+   uhge) 0xff <<  64) & (uhge) (h)) >>   8) |  \
+   uhge) 0xff <<  72) & (uhge) (h)) >>  24) |  \
+   uhge) 0xff <<  80) & (uhge) (h)) >>  40) |  \
+   uhge) 0xff <<  88) & (uhge) (h)) >>  56) |  \
+   uhge) 0xff <<  96) & (uhge) (h)) >>  72) |  \
+   uhge) 0xff << 104) & (uhge) (h)) >>  88) |  \
+   uhge) 0xff << 112) & (uhge) (h)) >> 104) |  \
+   uhge) 0xff << 120) & (uhge) (h)) >> 120)))
 #endif
 
 
@@ -935,70 +961,94 @@ open_stream(const char *filename, const 
 /

MonetDB: trails - Compilation fix for Solaris

2017-10-10 Thread Pedro Ferreira
Changeset: 27b0ff30a4c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=27b0ff30a4c5
Modified Files:
sql/server/sql_timestamps.c
sql/server/sql_timestamps.h
Branch: trails
Log Message:

Compilation fix for Solaris


diffs (30 lines):

diff --git a/sql/server/sql_timestamps.c b/sql/server/sql_timestamps.c
--- a/sql/server/sql_timestamps.c
+++ b/sql/server/sql_timestamps.c
@@ -13,10 +13,8 @@
  */
 
 #include "sql_timestamps.h"
-#include "sql.h"
-#include "sql_atom.h"
-#include "gdk.h"
-#include "mtime.h"
+#include 
+#include 
 
 static int GetSQLTypeFromAtom(sql_subtype *sql_subtype)
 {
diff --git a/sql/server/sql_timestamps.h b/sql/server/sql_timestamps.h
--- a/sql/server/sql_timestamps.h
+++ b/sql/server/sql_timestamps.h
@@ -10,9 +10,7 @@
 #define SQL_TIMESTAMPS_H
 
 #include "monetdb_config.h"
-#include "sql.h"
-#include "sql_atom.h"
-#include "gdk.h"
+#include 
 
 extern str convert_atom_into_unix_timestamp(atom *a, lng* res);
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Defined z_size_t for older zlib.

2017-10-10 Thread Sjoerd Mullender
Changeset: 87344f8822ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=87344f8822ba
Modified Files:
common/stream/stream.c
Branch: Jul2017
Log Message:

Defined z_size_t for older zlib.


diffs (12 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -992,6 +992,8 @@ open_stream(const char *filename, const 
 
 #ifdef HAVE_LIBZ
 #if ZLIB_VERNUM < 0x1290
+typedef z_size_t size_t;
+
 /* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
 static z_size_t
 gzfread(void *buf, z_size_t size, z_size_t nitems, gzFile file)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Malloc checks in MAL linker

2017-10-10 Thread Pedro Ferreira
Changeset: c767791419c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c767791419c5
Modified Files:
monetdb5/mal/mal_linker.c
Branch: Jul2017
Log Message:

Malloc checks in MAL linker


diffs (39 lines):

diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -115,7 +115,18 @@ getAddress(stream *out, str modname, str
 
adr = (MALfcn) dlsym(dl, fcnname);
filesLoaded[lastfile].modname = GDKstrdup("libmonetdb5");
+   if(filesLoaded[lastfile].modname == NULL) {
+   if (!silent)
+   showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+   return NULL;
+   }
filesLoaded[lastfile].fullname = GDKstrdup("libmonetdb5");
+   if(filesLoaded[lastfile].fullname == NULL) {
+   GDKfree(filesLoaded[lastfile].modname);
+   if (!silent)
+   showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+   return NULL;
+   }
filesLoaded[lastfile].handle = dl;
lastfile ++;
if(adr != NULL)
@@ -241,7 +252,16 @@ loadLibrary(str filename, int flag)
showException(GDKout, MAL,"loadModule", "internal error, too 
many modules loaded");
} else {
filesLoaded[lastfile].modname = GDKstrdup(filename);
+   if(filesLoaded[lastfile].modname == NULL) {
+   MT_lock_unset(&mal_contextLock);
+   throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+   }
filesLoaded[lastfile].fullname = GDKstrdup(handle ? nme : "");
+   if(filesLoaded[lastfile].fullname == NULL) {
+   GDKfree(filesLoaded[lastfile].modname);
+   MT_lock_unset(&mal_contextLock);
+   throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+   }
filesLoaded[lastfile].handle = handle ? handle : 
filesLoaded[0].handle;
lastfile ++;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Small typedef fix

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 61b0a8f0b6aa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=61b0a8f0b6aa
Modified Files:
common/stream/stream.c
Branch: default
Log Message:

Small typedef fix


diffs (12 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -992,7 +992,7 @@ open_stream(const char *filename, const 
 
 #ifdef HAVE_LIBZ
 #if ZLIB_VERNUM < 0x1290
-typedef z_size_t size_t;
+typedef size_t z_size_t;
 
 /* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
 static z_size_t
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Jul2017

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 99d10f1de249 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99d10f1de249
Modified Files:
common/stream/stream.c
monetdb5/mal/mal_linker.c
Branch: default
Log Message:

Merge with Jul2017


diffs (51 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -962,6 +962,8 @@ open_stream(const char *filename, const 
 
 #ifdef HAVE_LIBZ
 #if ZLIB_VERNUM < 0x1290
+typedef size_t z_size_t;
+
 /* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
 static z_size_t
 gzfread(void *buf, z_size_t size, z_size_t nitems, gzFile file)
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -109,7 +109,18 @@ getAddress(str fcnname)
 
adr = (MALfcn) dlsym(dl, fcnname);
filesLoaded[lastfile].modname = GDKstrdup("libmonetdb5");
+   if(filesLoaded[lastfile].modname == NULL) {
+   if (!silent)
+   showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+   return NULL;
+   }
filesLoaded[lastfile].fullname = GDKstrdup("libmonetdb5");
+   if(filesLoaded[lastfile].fullname == NULL) {
+   GDKfree(filesLoaded[lastfile].modname);
+   if (!silent)
+   showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+   return NULL;
+   }
filesLoaded[lastfile].handle = dl;
lastfile ++;
return adr;
@@ -229,7 +240,16 @@ loadLibrary(str filename, int flag)
throw(MAL,"mal.linker", "loadModule internal error, too many 
modules loaded");
} else {
filesLoaded[lastfile].modname = GDKstrdup(filename);
+   if(filesLoaded[lastfile].modname == NULL) {
+   MT_lock_unset(&mal_contextLock);
+   throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+   }
filesLoaded[lastfile].fullname = GDKstrdup(handle ? nme : "");
+   if(filesLoaded[lastfile].fullname == NULL) {
+   GDKfree(filesLoaded[lastfile].modname);
+   MT_lock_unset(&mal_contextLock);
+   throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+   }
filesLoaded[lastfile].handle = handle ? handle : 
filesLoaded[0].handle;
lastfile ++;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Small typedef fix

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 06130d3e7ac3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06130d3e7ac3
Modified Files:
common/stream/stream.c
Branch: Jul2017
Log Message:

Small typedef fix


diffs (12 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -992,7 +992,7 @@ open_stream(const char *filename, const 
 
 #ifdef HAVE_LIBZ
 #if ZLIB_VERNUM < 0x1290
-typedef z_size_t size_t;
+typedef size_t z_size_t;
 
 /* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
 static z_size_t
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Jul2017

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 0cebbc2d1bb0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0cebbc2d1bb0
Branch: default
Log Message:

Merge with Jul2017

___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Check correct value, and check before use.

2017-10-10 Thread Sjoerd Mullender
Changeset: 32c902e067c8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32c902e067c8
Modified Files:
sql/backends/monet5/sql.c
Branch: Jul2017
Log Message:

Check correct value, and check before use.


diffs (18 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -2747,11 +2747,12 @@ zero_or_one(ptr ret, const bat *bid)
_s = ATOMsize(ATOMtype(b->ttype));
if (ATOMextern(b->ttype)) {
_s = ATOMlen(ATOMtype(b->ttype), p);
-   memcpy(*(ptr *) ret = GDKmalloc(_s), p, _s);
-   if(ret == NULL){
+   *(ptr *) ret = GDKmalloc(_s);
+   if(*(ptr *) ret == NULL){
BBPunfix(b->batCacheid);
throw(SQL, "zero_or_one", MAL_MALLOC_FAIL);
}
+   memcpy(*(ptr *) ret, p, _s);
} else if (b->ttype == TYPE_bat) {
bat bid = *(bat *) p;
*(BAT **) ret = BATdescriptor(bid);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Fix some more compilation problems with old z...

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 6d909e9f930c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d909e9f930c
Modified Files:
common/stream/stream.c
Branch: Jul2017
Log Message:

Fix some more compilation problems with old zlib installations


diffs (21 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -1001,7 +1001,7 @@ gzfread(void *buf, z_size_t size, z_size
unsigned sz = nitems * size > (size_t) 1 << 30 ? 1 << 30 : (unsigned) 
(nitems * size);
int len;
 
-   len = gzread(fp, buf, sz);
+   len = gzread(file, buf, sz);
if (len == -1)
return 0;
return (z_size_t) len / size;
@@ -1020,7 +1020,7 @@ gzfwrite(const void *buf, z_size_t size,
if (wlen <= 0)
return 0;
buf = (const void *) ((const char *) buf + wlen);
-   sz -= (z_wize_t) wlen;
+   sz -= (z_size_t) wlen;
}
return nitems;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Jul2017 branch

2017-10-10 Thread Panagiotis Koutsourakis
Changeset: 417a16af1a85 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=417a16af1a85
Modified Files:
common/stream/stream.c
sql/backends/monet5/sql.c
Branch: default
Log Message:

Merge with Jul2017 branch


diffs (35 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -971,7 +971,7 @@ gzfread(void *buf, z_size_t size, z_size
unsigned sz = nitems * size > (size_t) 1 << 30 ? 1 << 30 : (unsigned) 
(nitems * size);
int len;
 
-   len = gzread(fp, buf, sz);
+   len = gzread(file, buf, sz);
if (len == -1)
return 0;
return (z_size_t) len / size;
@@ -990,7 +990,7 @@ gzfwrite(const void *buf, z_size_t size,
if (wlen <= 0)
return 0;
buf = (const void *) ((const char *) buf + wlen);
-   sz -= (z_wize_t) wlen;
+   sz -= (z_size_t) wlen;
}
return nitems;
 }
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -2816,8 +2816,8 @@ zero_or_one(ptr ret, const bat *bid)
_s = ATOMsize(ATOMtype(b->ttype));
if (ATOMextern(b->ttype)) {
_s = ATOMlen(ATOMtype(b->ttype), p);
-   * (ptr *) ret = GDKmalloc(_s);
-   if (* (ptr *) ret == NULL) {
+   *(ptr *) ret = GDKmalloc(_s);
+   if(*(ptr *) ret == NULL){
BBPunfix(b->batCacheid);
throw(SQL, "zero_or_one", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - More malloc checks in various places

2017-10-10 Thread Pedro Ferreira
Changeset: cc604a4b098f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc604a4b098f
Modified Files:
monetdb5/mal/mal_client.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_import.c
monetdb5/mal/mal_session.c
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_remap.c
Branch: Jul2017
Log Message:

More malloc checks in various places


diffs (140 lines):

diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -207,6 +207,10 @@ MCinitClientRecord(Client c, oid user, b
c->blkmode = 0;
 
c->fdin = fin ? fin : bstream_create(GDKin, 0);
+   if ( c->fdin == NULL){
+   showException(GDKout, MAL, "initClientRecord", MAL_MALLOC_FAIL);
+   return NULL;
+   }
c->yycur = 0;
c->bak = NULL;
 
@@ -217,8 +221,8 @@ MCinitClientRecord(Client c, oid user, b
c->curprg = c->backup = 0;
c->glb = 0;
 
-   /* remove garbage from previous connection 
-* be aware, a user can introduce several modules 
+   /* remove garbage from previous connection
+* be aware, a user can introduce several modules
 * that should be freed to avoid memory leaks */
if (c->nspace) {
freeModule(c->nspace);
@@ -238,6 +242,10 @@ MCinitClientRecord(Client c, oid user, b
 
prompt = !fin ? GDKgetenv("monet_prompt") : PROMPT1;
c->prompt = GDKstrdup(prompt);
+   if ( c->prompt == NULL){
+   showException(GDKout, MAL, "initClientRecord", MAL_MALLOC_FAIL);
+   return NULL;
+   }
c->promptlength = strlen(prompt);
 
c->actions = 0;
@@ -270,7 +278,7 @@ MCinitClient(oid user, bstream *fin, str
 
 /*
  * The administrator should be initialized to enable interpretation of
- * the command line arguments, before it starts serviceing statements
+ * the command line arguments, before it starts servicing statements
  */
 int
 MCinitClientThread(Client c)
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
@@ -404,7 +404,11 @@ cloneFunction(stream *out, Module scope,
return NULL;
}
freeMalBlk(new->def);
-   new->def = copyMalBlk(proc->def);
+   if((new->def = copyMalBlk(proc->def)) == NULL) {
+   freeSymbol(new);
+   fprintf(stderr,"cloneFunction() failed");
+   return NULL;
+   }
/* now change the definition of the original proc */
 #ifdef DEBUG_CLONE
fprintf(stderr, "CLONED VERSION\n");
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -94,6 +94,10 @@ malLoadScript(Client c, str name, bstrea
throw(MAL, "malInclude", "file %s too large to process", name);
}
*fdin = bstream_create(fd, sz == 0 ? (size_t) (2 * 128 * BLOCK) : sz);
+   if(*fdin == NULL) {
+   mnstr_destroy(fd);
+   throw(MAL, "malInclude", MAL_MALLOC_FAIL);
+   }
if (bstream_next(*fdin) < 0)
mnstr_printf(c->fdout, "!WARNING: could not read %s\n", name);
return MAL_SUCCEED;
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -313,6 +313,12 @@ MSscheduleClient(str command, str challe
/* move this back !! */
if (c->nspace == 0) {
c->nspace = newModule(NULL, putName("user"));
+   if(c->nspace == NULL) {
+   mnstr_printf(fout, "!could not allocate 
space\n");
+   exit_streams(fin, fout);
+   GDKfree(command);
+   return;
+   }
}
 
if ((s = setScenario(c, lang)) != NULL) {
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -436,8 +436,15 @@ compileOptimizer(Client cntxt, str name)
for (i = 0; i < MAXOPTPIPES && pipes[i].name; i++) {
if (strcmp(pipes[i].name, name) == 0 && pipes[i].mb == 0) {
/* precompile the pipeline as MAL string */
-   MCinitClientRecord(&c, cntxt->user, 0, 0);
+   if(MCinitClientRecord(&c, cntxt->user, 0, 0) == NULL) {
+   MT_lock_unset(&pipeLock);
+   throw(MAL, "optimizer.addOptimizerPipe", 
MAL_MALLOC_FAIL);
+   }
c.nspace = newModule(NULL, putName("user"));
+   if(c.nspace == NULL) {
+   MT_lock_unset(&pipeLock);
+   

MonetDB: default - Don't forget the error code

2017-10-10 Thread Pedro Ferreira
Changeset: 745697f939c2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=745697f939c2
Modified Files:
sql/backends/monet5/sql.c
Branch: default
Log Message:

Don't forget the error code


diffs (12 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -1853,7 +1853,7 @@ SQLtid(Client cntxt, MalBlkPtr mb, MalSt
BBPunfix(d->batCacheid);
BBPunfix(tids->batCacheid);
if (diff == NULL)
-   throw(SQL,"sql.tid","Cannot subtract delete column");
+   throw(SQL,"sql.tid", SQLSTATE(45002) "Cannot subtract 
delete column");
BAThseqbase(diff, sb);
tids = diff;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: trails - Removed cquery pipeline. As the cquery optimiz...

2017-10-10 Thread Pedro Ferreira
Changeset: 407cf39d7d96 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=407cf39d7d96
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/optimizer/opt_pipes.c
sql/backends/monet5/sql_optimizer.c
sql/test/Tests/setoptimizer.stable.out
Branch: trails
Log Message:

Removed cquery pipeline. As the cquery optimizer is always required for 
streaming tables, it is now called by all the other optimizer pipelines.


diffs (truncated from 315 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -548,7 +548,7 @@ Ready.
 [ "basket","dump", "command basket.dump():void ",  "BSKTdump;","Show 
the baskets table"]
 [ "basket","lock", "pattern basket.lock(mvc:any, sch:str, tbl:str):int ",  
"BSKTlock;","Lock the basket for private use"   ]
 [ "basket","prelude",  "command basket.prelude():void ",   
"BSKTprelude;", ""  ]
-[ "basket","register", "pattern basket.register(mvc:int, sch:str, 
tbl:str, role:int):int ","BSKTregister;","Initialize a new basket 
based on a specific table definition.\nroles:input =0, output=2"   ]
+[ "basket","register", "pattern basket.register(mvc:int, sch:str, 
tbl:str, role:int):int ","BSKTregister;","Initialize a new basket 
based on a specific table definition. roles:input=0, output=1" ]
 [ "basket","reset","pattern basket.reset(mvc:int, sch:str, 
tbl:str):int ", "BSKTreset;",   "Remove a basket content"   ]
 [ "basket","status",   "pattern basket.status() (seen:bat[:timestamp], 
sch:bat[:str], tbl:bat[:str], window:bat[:int], stride:bat[:int], 
events:bat[:int], error:bat[:str]) ", "BSKTstatus;",  "Show the status of the 
baskets"]
 [ "basket","tid",  "pattern basket.tid(mvc:int, sch:str, 
tbl:str):bat[:oid] ", "BSKTtid;", "Collect the candidates for a basket" 
  ]
@@ -7453,19 +7453,13 @@ Ready.
 [ "cquery","beginat",  "pattern cquery.beginat(unixtime:lng):void ",   
"CQbeginAt;",   "Delay beginning of all continuous queries, where unixtime is 
an UNIX timestamp with microsecond precision" ]
 [ "cquery","cycles",   "pattern cquery.cycles(cnt:int):void ", 
"CQcycles;","Limit number of petrinet steps"]
 [ "cquery","cycles",   "pattern cquery.cycles(mod:str, fcn:str, 
cnt:int):void ",   "CQcycles;","Limit number of petrinet steps"]
-[ "cquery","deregister",   "pattern cquery.deregister(mod:str, 
fcn:str):void ","CQderegister;","Remove a continuous query" ]
-[ "cquery","deregister",   "pattern cquery.deregister():void ",
"CQderegisterAll;", "Remove all continuous queries" ]
 [ "cquery","dump", "command cquery.dump():void ",  "CQdump;",  "Show 
the status of the query scheduler"]
 [ "cquery","error","pattern cquery.error(sch:str, tbl:str, 
msg:str):void ","CQerror;", "Remember the error seen"   ]
 [ "cquery","heartbeat","pattern cquery.heartbeat(cnt:lng):void ",  
"CQheartbeat;", "Awake all queries after cnt milliseconds"  ]
 [ "cquery","heartbeat","pattern cquery.heartbeat(mod:str, fcn:str, 
cnt:lng):void ","CQheartbeat;", "Awake the query after cnt milliseconds"
]
 [ "cquery","log",  "pattern cquery.log() (tick:bat[:timestamp], 
mod:bat[:str], fcn:bat[:str], time:bat[:lng], error:bat[:str]) ",  "CQlog;",
   "The log of all CQ executions"  ]
-[ "cquery","pause","pattern cquery.pause(mod:str, fcn:str):void ", 
"CQpause;", "Deactivate a continuous query" ]
-[ "cquery","pause","pattern cquery.pause():void ", "CQpauseAll;",  
"Deactivate all continuous queries" ]
 [ "cquery","prelude",  "command cquery.prelude():void ",   
"CQprelude;",   ""  ]
 [ "cquery","register", "pattern cquery.register(mod:str, fcn:str):void 
",  "CQregister;",  "Add a continuous SQL procedure to the Petri-net 
scheduler. It will analyse\nthe MAL block to determine the input/output 
dependencies and firing conditions."   ]
-[ "cquery","resume",   "pattern cquery.resume(mod:str, fcn:str):void 
","CQresume;","Activate a specific continuous query with no 
changes"  ]
-[ "cquery","resume",   "pattern cquery.resume():void ",
"CQresumeAll;", "Activate all continuous queries"   ]
 [ "cquery","show", "pattern cquery.show(sch:str, fcn:str):void ",  
"CQshow;",  "Debug a single continuous query"   ]
 [ "cquery","status",   "pattern cquery.status() (tick:bat[:timestamp], 
mod:bat[:str], fcn:bat[:str], state:bat[:str], error:bat[:str], stmt:bat[:str]) 
",  "CQstatus;","Status of all registered contin

MonetDB: Jul2017 - Add a cast for Windows.

2017-10-10 Thread Sjoerd Mullender
Changeset: afd440b1ac15 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afd440b1ac15
Modified Files:
common/stream/stream.c
Branch: Jul2017
Log Message:

Add a cast for Windows.


diffs (16 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2328,7 +2328,11 @@ socket_read(stream *s, void *buf, size_t
}
if (n == 0) /* unexpected end of file */
break;
-   nr += n;
+   nr +=
+#ifdef _MSC_VER
+   (int)
+#endif
+   n;
}
}
return nr / (ssize_t) elmsize;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list