MonetDB: default - Merge with Mar2018 branch.

2018-08-01 Thread Pedro Ferreira
Changeset: 6a77f995662e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a77f995662e
Modified Files:
clients/mapiclient/mclient.c
common/stream/stream.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_logger.c
gdk/gdk_system.c
gdk/gdk_utils.c
monetdb5/mal/mal_import.c
monetdb5/modules/kernel/alarm.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/sql.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/merovingian.c
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 910 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1773,30 +1773,35 @@ start_pager(stream **saveFD)
 
/* ignore SIGPIPE so that we get an error instead of signal */
act.sa_handler = SIG_IGN;
-   sigemptyset(&act.sa_mask);
-   act.sa_flags = 0;
-   sigaction(SIGPIPE, &act, NULL);
-
-   p = popen(pager, "w");
-   if (p == NULL)
+   if(sigemptyset(&act.sa_mask) == -1) {
fprintf(stderr, "Starting '%s' failed\n", pager);
-   else {
-   *saveFD = toConsole;
-   /* put | in name to indicate that file should be closed 
with pclose */
-   if ((toConsole = file_wastream(p, "|pager")) == NULL) {
-   toConsole = *saveFD;
-   *saveFD = NULL;
+   } else {
+   act.sa_flags = 0;
+   if(sigaction(SIGPIPE, &act, NULL) == -1) {
fprintf(stderr, "Starting '%s' failed\n", 
pager);
-   }
+   } else {
+   p = popen(pager, "w");
+   if (p == NULL)
+   fprintf(stderr, "Starting '%s' 
failed\n", pager);
+   else {
+   *saveFD = toConsole;
+   /* put | in name to indicate that file 
should be closed with pclose */
+   if ((toConsole = file_wastream(p, 
"|pager")) == NULL) {
+   toConsole = *saveFD;
+   *saveFD = NULL;
+   fprintf(stderr, "Starting '%s' 
failed\n", pager);
+   }
 #ifdef HAVE_ICONV
-   if (encoding != NULL) {
-   if ((toConsole = iconv_wstream(toConsole, 
encoding, "pager")) == NULL) {
-   toConsole = *saveFD;
-   *saveFD = NULL;
-   fprintf(stderr, "Starting '%s' 
failed\n", pager);
+   if (encoding != NULL) {
+   if ((toConsole = 
iconv_wstream(toConsole, encoding, "pager")) == NULL) {
+   toConsole = *saveFD;
+   *saveFD = NULL;
+   fprintf(stderr, 
"Starting '%s' failed\n", pager);
+   }
+   }
+#endif
}
}
-#endif
}
}
 }
@@ -3126,10 +3131,21 @@ main(int argc, char **argv)
 * causes the output to be converted (we could set it to
 * ".OCP" if we knew for sure that we were running in a cmd
 * window) */
-   setlocale(LC_CTYPE, "");
+   if(setlocale(LC_CTYPE, "") == NULL) {
+   fprintf(stderr, "error: could not set locale\n");
+   exit(2);
+   }
 #endif
toConsole = stdout_stream = file_wastream(stdout, "stdout");
stderr_stream = file_wastream(stderr, "stderr");
+   if(!stdout_stream || !stderr_stream) {
+   if(stdout_stream)
+   close_stream(stdout_stream);
+   if(stderr_stream)
+   close_stream(stderr_stream);
+   fprintf(stderr, "error: could not open an output stream\n");
+   exit(2);
+   }
 
/* parse config file first, command line options override */
parse_dotmonetdb(&user, &passwd, &dbname, &language, &save_history, 
&output, &pagewidth);
@@ -3540,6 +3556,13 @@ main(int argc, char **argv)
 
if (!has_fileargs && command == NULL) {
stream *s = file_rastream(stdin, "");
+   if(!

MonetDB: default - Merge with Mar2018 branch.

2018-07-30 Thread Sjoerd Mullender
Changeset: aff5dad33aa4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aff5dad33aa4
Modified Files:
gdk/gdk_hash.c
gdk/gdk_join.c
sql/backends/monet5/UDF/capi/capi.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (92 lines):

diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -570,7 +570,7 @@ BAThash(BAT *b)
return GDK_FAIL;
}
 #ifdef PERSISTENTHASH
-   if (BBP_status(b->batCacheid) & BBPEXISTING) {
+   if (BBP_status(b->batCacheid) & BBPEXISTING && !b->theap.dirty) 
{
MT_Id tid;
BBPfix(b->batCacheid);
if (MT_create_thread(&tid, BAThashsync, b,
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3894,7 +3894,9 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
}
if (sl == NULL) {
lhash = BATcheckhash(l);
-   if (!lhash && (parent = VIEWtparent(l)) != 0) {
+   if (lhash) {
+   lslots = ((size_t *) l->thash->heap.base)[5];
+   } else if ((parent = VIEWtparent(l)) != 0) {
BAT *b = BBPdescriptor(parent);
/* use hash on parent if the average chain
 * length times the number of required probes
@@ -3913,7 +3915,9 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
}
if (sr == NULL) {
rhash = BATcheckhash(r);
-   if (!rhash && (parent = VIEWtparent(r)) != 0) {
+   if (rhash) {
+   rslots = ((size_t *) r->thash->heap.base)[5];
+   } else if ((parent = VIEWtparent(r)) != 0) {
BAT *b = BBPdescriptor(parent);
/* use hash on parent if the average chain
 * length times the number of required probes
diff --git a/sql/backends/monet5/UDF/capi/capi.c 
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -1582,29 +1582,29 @@ wrapup:
if (inputs[i]) {
if (isaBatType(getArgType(mb, pci, i))) {
bat_type = getBatType(getArgType(mb, 
pci, i));
-   if (bat_type == TYPE_str || bat_type == 
TYPE_date ||
-   bat_type == TYPE_daytime ||
-   bat_type == TYPE_timestamp || 
bat_type == TYPE_blob ||
-   bat_type == TYPE_sqlblob) {
-   // have to free input data
-   void *data = 
GetTypeData(bat_type, inputs[i]);
-   if (data) {
-   GDKfree(data);
+   }
+   if (bat_type == TYPE_str || bat_type == 
TYPE_date ||
+   bat_type == TYPE_daytime ||
+   bat_type == TYPE_timestamp || bat_type == 
TYPE_blob ||
+   bat_type == TYPE_sqlblob) {
+   // have to free input data
+   void *data = GetTypeData(bat_type, 
inputs[i]);
+   if (data) {
+   GDKfree(data);
+   }
+   } else if (bat_type > TYPE_str) {
+   // this type was converted to 
individually malloced
+   // strings
+   // we have to free all the individual 
strings
+   char **data = (char 
**)GetTypeData(bat_type, inputs[i]);
+   size_t count = GetTypeCount(bat_type, 
inputs[i]);
+   for (j = 0; j < count; j++) {
+   if (data[j]) {
+   GDKfree(data[j]);
}
-   } else if (bat_type > TYPE_str) {
-   // this type was converted to 
individually malloced
-   // strings
-   // we have to free all the 
individual strings
-   char **data = (char 
**)GetTypeData(bat_type, inputs[i]);
-   size_t count = 
GetTypeCount(bat_type, inputs[i]);
- 

MonetDB: default - Merge with Mar2018 branch.

2018-07-30 Thread Sjoerd Mullender
Changeset: 707ed76300bd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=707ed76300bd
Modified Files:
common/stream/stream.c
gdk/gdk_batop.c
gdk/gdk_join.c
sql/backends/monet5/sql_result.c
tools/merovingian/client/monetdb.1
tools/mserver/mserver5.1.in
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (211 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -135,8 +135,8 @@
 /* use intrinsic functions on Windows */
 #define short_int_SWAP(s)  ((int16_t) _byteswap_ushort((uint16_t) (s)))
 /* on Windows, long is the same size as int */
-#define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s)))
-#define long_long_SWAP(l)  ((int64_t) _byteswap_uint64((unsigned __int64) 
(s)))
+#define normal_int_SWAP(i) ((int) _byteswap_ulong((unsigned long) (i)))
+#define long_long_SWAP(l)  ((int64_t) _byteswap_uint64((unsigned __int64) 
(l)))
 #else
 #define short_int_SWAP(s)  \
((int16_t) (((0x00ff & (uint16_t) (s)) << 8) |  \
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -979,6 +979,10 @@ BATslice(BAT *b, BUN l, BUN h)
bn->tnokey[0] = bn->tnokey[1] = 0;
}
}
+   bn->tnonil = b->tnonil || bn->batCount == 0;
+   bn->tnil = false;   /* we just don't know */
+   bn->tnosorted = 0;
+   bn->tnokey[0] = bn->tnokey[1] = 0;
bni = bat_iterator(bn);
if (BATtdense(b)) {
BATtseqbase(bn, (oid) (b->tseqbase + low));
@@ -1002,10 +1006,6 @@ BATslice(BAT *b, BUN l, BUN h)
bn->trevsorted = b->trevsorted;
BATkey(bn, BATtkey(b));
}
-   bn->tnonil = b->tnonil || bn->batCount == 0;
-   bn->tnil = false;   /* we just don't know */
-   bn->tnosorted = 0;
-   bn->tnokey[0] = bn->tnokey[1] = 0;
return bn;
   bunins_failed:
BBPreclaim(bn);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3819,6 +3819,7 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
BUN maxsize;
bool lhash = false, rhash = false;
bool plhash = false, prhash = false;
+   BUN lslots = 0, rslots = 0;
bool swap;
bat parent;
size_t mem_size;
@@ -3899,13 +3900,16 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
 * length times the number of required probes
 * is less than the cost for creating and
 * probing a new hash on the view */
-   lhash = BATcheckhash(b) &&
-   (BATcount(b) == BATcount(l) ||
-BATcount(b) / ((size_t *) 
b->thash->heap.base)[5] * rcount < lcount + rcount);
+   if (BATcheckhash(b)) {
+   lslots = ((size_t *) b->thash->heap.base)[5];
+   lhash = (BATcount(b) == BATcount(l) ||
+BATcount(b) / lslots * rcount < lcount 
+ rcount);
+   }
plhash = lhash;
}
} else if (BATtdense(sl) && BATcheckhash(l)) {
-   lhash = BATcount(l) / ((size_t *) l->thash->heap.base)[5] * 
rcount < lcount + rcount;
+   lslots = ((size_t *) l->thash->heap.base)[5];
+   lhash = BATcount(l) / lslots * rcount < lcount + rcount;
}
if (sr == NULL) {
rhash = BATcheckhash(r);
@@ -3915,17 +3919,28 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
 * length times the number of required probes
 * is less than the cost for creating and
 * probing a new hash on the view */
-   rhash = BATcheckhash(b) &&
-   (BATcount(b) == BATcount(r) ||
-BATcount(b) / ((size_t *) 
b->thash->heap.base)[5] * lcount < lcount + rcount);
+   if (BATcheckhash(b)) {
+   rslots = ((size_t *) b->thash->heap.base)[5];
+   rhash = (BATcount(b) == BATcount(r) ||
+BATcount(b) / rslots * lcount < lcount 
+ rcount);
+   }
prhash = rhash;
}
} else if (BATtdense(sr) && BATcheckhash(r)) {
-   rhash = BATcount(r) / ((size_t *) r->thash->heap.base)[5] * 
lcount < lcount + rcount;
+   rslots = ((size_t *) r->thash->heap.base)[5];
+   rhash = BATcount(r) / rslots * rcount < lcount + rcount;
}
if (lhash && rhash) {
-   /* both have hash, smallest on right */
-   swap = lcount < rcount;
+   if (lcount =

MonetDB: default - Merge with Mar2018 branch.

2018-07-27 Thread Sjoerd Mullender
Changeset: b45ce4b9ba25 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b45ce4b9ba25
Added Files:
clients/odbc/samples/testStmtAttr.c
Modified Files:
MonetDB.spec
clients/odbc/samples/Makefile.ag
clients/odbc/samples/arraytest.c
clients/odbc/samples/odbcsample1.c
clients/odbc/samples/testgetinfo.c
gdk/gdk.h
monetdb5/modules/atoms/json.c
monetdb5/modules/mal/mkey.c
monetdb5/modules/mal/wlc.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/wlr.c
sql/server/rel_planner.c
sql/server/rel_semantic.c
sql/server/rel_updates.c
sql/server/sql_privileges.c

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-add.Bug-6630.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-add.Bug-6630.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 922 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -434,6 +434,7 @@ developer.
 %{_bindir}/smack01
 %{_bindir}/shutdowntest
 %{_bindir}/testgetinfo
+%{_bindir}/testStmtAttr
 %{_bindir}/malsample.pl
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
diff --git a/clients/odbc/samples/Makefile.ag b/clients/odbc/samples/Makefile.ag
--- a/clients/odbc/samples/Makefile.ag
+++ b/clients/odbc/samples/Makefile.ag
@@ -11,6 +11,6 @@ INCLUDES = $(ODBC_INCS)
 BINS = {
CONDINST = HAVE_TESTING
DIR = libdir/monetdb/tests
-   SOURCES = odbcsample1.c testgetinfo.c arraytest.c
+   SOURCES = odbcsample1.c testgetinfo.c arraytest.c testStmtAttr.c
LIBS = $(ODBC_LIBS)
 }
diff --git a/clients/odbc/samples/arraytest.c b/clients/odbc/samples/arraytest.c
--- a/clients/odbc/samples/arraytest.c
+++ b/clients/odbc/samples/arraytest.c
@@ -53,9 +53,6 @@ prerr(SQLSMALLINT tpe, SQLHANDLE hnd, co
func, pref);
break;
case SQL_NO_DATA:
-   fprintf(stderr,
-   "%s: %s, no error message from driver\n",
-   func, pref);
break;
default:
fprintf(stderr,
@@ -76,7 +73,7 @@ check(SQLRETURN ret, SQLSMALLINT tpe, SQ
break;
case SQL_ERROR:
prerr(tpe, hnd, func, "Error");
-   exit(1);
+   break;
case SQL_INVALID_HANDLE:
fprintf(stderr, "%s: Error: invalid handle\n", func);
exit(1);
@@ -371,16 +368,16 @@ main(int argc, char **argv)
}
 
ret = SQLFreeHandle(SQL_HANDLE_STMT, stmt);
-   check(ret, SQL_HANDLE_STMT, stmt, "SQLFreeHandle 2");
+   check(ret, SQL_HANDLE_STMT, stmt, "SQLFreeHandle (STMT)");
 
ret = SQLDisconnect(dbc);
check(ret, SQL_HANDLE_DBC, dbc, "SQLDisconnect");
 
ret = SQLFreeHandle(SQL_HANDLE_DBC, dbc);
-   check(ret, SQL_HANDLE_DBC, dbc, "SQLFreeHandle 3");
+   check(ret, SQL_HANDLE_DBC, dbc, "SQLFreeHandle (DBC)");
 
ret = SQLFreeHandle(SQL_HANDLE_ENV, env);
-   check(ret, SQL_HANDLE_STMT, stmt, "SQLFreeHandle 4");
+   check(ret, SQL_HANDLE_ENV, env, "SQLFreeHandle (ENV)");
 
return 0;
 }
diff --git a/clients/odbc/samples/odbcsample1.c 
b/clients/odbc/samples/odbcsample1.c
--- a/clients/odbc/samples/odbcsample1.c
+++ b/clients/odbc/samples/odbcsample1.c
@@ -45,7 +45,6 @@ prerr(SQLSMALLINT tpe, SQLHANDLE hnd, co
fprintf(stderr, "%s: %s, unexpected error from 
SQLGetDiagRec\n", func, pref);
break;
case SQL_NO_DATA:
-   fprintf(stderr, "%s: %s, no error message from driver\n", func, 
pref);
break;
default:
fprintf(stderr, "%s: %s, weird return value from 
SQLGetDiagRec\n", func, pref);
@@ -64,7 +63,7 @@ check(SQLRETURN ret, SQLSMALLINT tpe, SQ
break;
case SQL_ERROR:
prerr(tpe, hnd, func, "Error");
-   exit(1);
+   break;
case SQL_INVALID_HANDLE:
fprintf(stderr, "%s: Error: invalid handle\n", func);
exit(1);
@@ -111,7 +110,7 @@ main(int argc, char **argv)
check(ret, SQL_HANDLE_ENV, env, "SQLSetEnvAttr");
 
ret = SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc);
-   check(ret, SQL_HANDLE_ENV, env, "SQLAllocHandle 1");
+   check(ret, SQL_HANDLE_ENV, env, "SQLAllocHandle (DBC)");
 
ret = SQLConnect(dbc, (SQLCHAR *) dsn, SQL_NTS, (SQLCHAR *) user, 
SQL_NTS, (SQLCHAR *) pass, SQL_NTS);
check(ret, SQL_HANDLE_DBC, dbc, "SQLConnect");
@@ -121,8 +120,7 @@ main(int argc, char **argv)
 
/* create a test table to be filled with values */
ret = SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt);
-
-   check(ret, SQL_HANDLE_DBC, dbc, "SQLAllocHandle 2");
+   check(ret, SQL_HANDLE_DBC, dbc, "SQLAllocHandle (STMT 1)");
 
ret = 

MonetDB: default - Merge with Mar2018 branch.

2018-07-25 Thread Sjoerd Mullender
Changeset: b5d7548a3425 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b5d7548a3425
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-add.Bug-6630.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-add.Bug-6630.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-add.Bug-6630.stable.out
Modified Files:
configure.ag
monetdb5/modules/atoms/uuid.c
sql/backends/monet5/Tests/pyapi09.stable.out
sql/backends/monet5/Tests/pyapi28.stable.out
sql/server/rel_optimizer.c
sql/server/sql_atom.c

sql/test/BugTracker-2016/Tests/set-negative-querytimeout.Bug-6070.stable.err
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 420 to 300 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -735,6 +735,12 @@ AS_VAR_IF([enable_sanitizer], [no], [], 
 AC_SUBST([CFLAGS])
 AC_SUBST([X_CFLAGS])
 
+# see https://software.intel.com/en-us/forums/intel-c-compiler/topic/760979
+AS_CASE([$CC_ver], [icc-*], [
+   AS_IF([test -f /usr/include/math.h && ! grep -q _LIB_VERSION_TYPE 
/usr/include/math.h],
+   [AC_DEFINE([INTEL_MATH_H_HACK], 1,
+   [Define if using Intel compiler with icompatible system 
math.h])])])
+
 AC_MSG_CHECKING([for ld -Bsymbolic-functions option])
 save_LDFLAGS="$LDFLAGS"
 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
@@ -2920,6 +2926,17 @@ AH_TOP([
 @%:@define _SEEN_MONETDB_CONFIG_H 1
 ])
 AH_BOTTOM([
+@%:@ifdef INTEL_MATH_H_HACK
+/* see https://software.intel.com/en-us/forums/intel-c-compiler/topic/760979 */
+typedef enum {
+   _IEEE_ = -1,/* According to IEEE 754/IEEE 854.  */
+   _SVID_, /* According to System V, release 4.  */
+   _XOPEN_,/* Nowadays also Unix98.  */
+   _POSIX_,
+   _ISOC_  /* Actually this is ISO C99.  */
+} _LIB_VERSION_TYPE;
+@%:@endif
+
 @%:@ifdef HAVE_SYS_TYPES_H
 @%:@ include 
 @%:@endif
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
@@ -37,7 +37,12 @@
 #endif
 #define UUID_STRLEN36  /* length of string 
representation */
 
-typedef struct {
+typedef union {
+#ifdef HAVE_HGE
+   hge h;  /* force alignment, not 
otherwise used */
+#else
+   lng l[2];   /* force alignment, not 
otherwise used */
+#endif
 #ifdef HAVE_UUID
uuid_t u;
 #else
diff --git a/sql/backends/monet5/Tests/pyapi09.stable.out 
b/sql/backends/monet5/Tests/pyapi09.stable.out
--- a/sql/backends/monet5/Tests/pyapi09.stable.out
+++ b/sql/backends/monet5/Tests/pyapi09.stable.out
@@ -23,7 +23,7 @@ stdout of test 'pyapi09` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-[0 1 2 ..., 7 8 9]
+[0 1 2 ... 7 8 9]
 
 # 14:42:12 >  
 # 14:42:12 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-30058" "--port=35977"
diff --git a/sql/backends/monet5/Tests/pyapi28.stable.out 
b/sql/backends/monet5/Tests/pyapi28.stable.out
--- a/sql/backends/monet5/Tests/pyapi28.stable.out
+++ b/sql/backends/monet5/Tests/pyapi28.stable.out
@@ -23,45 +23,7 @@ stdout of test 'pyapi28` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-# SQL catalog created, loading sql scripts once
-# loading sql script: 09_like.sql
-# loading sql script: 10_math.sql
-# loading sql script: 11_times.sql
-# loading sql script: 12_url.sql
-# loading sql script: 13_date.sql
-# loading sql script: 14_inet.sql
-# loading sql script: 15_querylog.sql
-# loading sql script: 16_tracelog.sql
-# loading sql script: 17_temporal.sql
-# loading sql script: 20_vacuum.sql
-# loading sql script: 21_dependency_functions.sql
-# loading sql script: 22_clients.sql
-# loading sql script: 23_skyserver.sql
-# loading sql script: 24_zorder.sql
-# loading sql script: 25_debug.sql
-# loading sql script: 26_sysmon.sql
-# loading sql script: 27_rejects.sql
-# loading sql script: 39_analytics.sql
-# loading sql script: 39_analytics_hge.sql
-# loading sql script: 40_geom.sql
-# loading sql script: 40_json.sql
-# loading sql script: 40_json_hge.sql
-# loading sql script: 41_md5sum.sql
-# loading sql script: 45_uuid.sql
-# loading sql script: 46_gsl.sql
-# loading sql script: 46_profiler.sql
-# loading sql script: 51_sys_schema_extension.sql
-# loading sql script: 72_fits.sql
-# loading sql script: 74_netcdf.sql
-# loading sql script: 75_storagemodel.sql
-# loading sql script: 80_statistics.sql
-# loading sql script: 80_udf.sql
-# loading sql script: 80_udf_hge.sql
-# loading sql script: 85_bam.sql
-# loading sql script: 90_generator.sql
-# loading sql script: 90_generator_hge.sql
-# loading sql script: 99_system.sql
-['hello' 'hello' 'hello' ..., 'hello' 'hello' 'hello']
+['hel

MonetDB: default - Merge with Mar2018 branch.

2018-07-24 Thread Sjoerd Mullender
Changeset: fcde0ab6f0f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fcde0ab6f0f6
Modified Files:
clients/ChangeLog.Mar2018
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/ODBCStmt.c
clients/odbc/driver/ODBCStmt.h
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLGetStmtAttr.c
clients/odbc/driver/SQLSetStmtAttr.c
gdk/gdk_imprints.c
gdk/gdk_orderidx.c
gdk/gdk_private.h
gdk/gdk_select.c
monetdb5/mal/mal_interpreter.c
monetdb5/modules/mal/clients.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 391 to 300 lines):

diff --git a/clients/ChangeLog.Mar2018 b/clients/ChangeLog.Mar2018
--- a/clients/ChangeLog.Mar2018
+++ b/clients/ChangeLog.Mar2018
@@ -1,3 +1,6 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Tue Jul 24 2018 Sjoerd Mullender 
+- ODBC: Implemented SQL_ATTR_QUERY_TIMEOUT parameter in SQLSetStmtAttr.
+
diff --git a/clients/odbc/driver/ODBCDbc.c b/clients/odbc/driver/ODBCDbc.c
--- a/clients/odbc/driver/ODBCDbc.c
+++ b/clients/odbc/driver/ODBCDbc.c
@@ -76,6 +76,7 @@ newODBCDbc(ODBCEnv *env)
dbc->minor = 0;
dbc->patch = 0;
dbc->cachelimit = 0;
+   dbc->qtimeout = 0;
dbc->Mdebug = 0;
 
dbc->FirstStmt = NULL;
diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h
--- a/clients/odbc/driver/ODBCDbc.h
+++ b/clients/odbc/driver/ODBCDbc.h
@@ -62,6 +62,7 @@ typedef struct tODBCDRIVERDBC {
/* MonetDB connection handle & status information */
Mapi mid;   /* connection with server */
int cachelimit; /* cache limit we requested */
+   SQLULEN qtimeout;   /* current query timeout */
short major, minor, patch; /* version of server */
int Mdebug;
 
diff --git a/clients/odbc/driver/ODBCStmt.c b/clients/odbc/driver/ODBCStmt.c
--- a/clients/odbc/driver/ODBCStmt.c
+++ b/clients/odbc/driver/ODBCStmt.c
@@ -76,6 +76,8 @@ newODBCStmt(ODBCDbc *dbc)
stmt->querytype = -1;
stmt->rowcount = 0;
 
+   stmt->qtimeout = dbc->qtimeout; /* inherit query timeout */
+
/* add this stmt to the administrative linked stmt list */
stmt->next = dbc->FirstStmt;
dbc->FirstStmt = stmt;
diff --git a/clients/odbc/driver/ODBCStmt.h b/clients/odbc/driver/ODBCStmt.h
--- a/clients/odbc/driver/ODBCStmt.h
+++ b/clients/odbc/driver/ODBCStmt.h
@@ -80,6 +80,8 @@ typedef struct tODBCDRIVERSTMT {
 
int querytype;  /* query type as returned by server */
 
+   SQLULEN qtimeout;   /* query timeout requested */
+
SQLUINTEGER cursorType;
SQLULEN cursorScrollable;
SQLULEN retrieveData;
diff --git a/clients/odbc/driver/SQLExecDirect.c 
b/clients/odbc/driver/SQLExecDirect.c
--- a/clients/odbc/driver/SQLExecDirect.c
+++ b/clients/odbc/driver/SQLExecDirect.c
@@ -46,6 +46,14 @@ ODBCExecDirect(ODBCStmt *stmt, SQLCHAR *
return SQL_ERROR;
}
 
+   if (stmt->qtimeout != stmt->Dbc->qtimeout) {
+   char buf[48];
+   snprintf(buf, sizeof(buf), "call sys.settimeout(%" PRIu64 ")",
+(uint64_t) stmt->qtimeout);
+   if (mapi_query_handle(hdl, buf) == MOK)
+   stmt->Dbc->qtimeout = stmt->qtimeout;
+   }
+
query = ODBCTranslateSQL(stmt->Dbc, StatementText, (size_t) TextLength,
 stmt->noScan);
if (query == NULL) {
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -447,6 +447,12 @@ MNDBExecute(ODBCStmt *stmt)
addStmtError(stmt, "HY001", NULL, 0);
return SQL_ERROR;
}
+   if (stmt->qtimeout != stmt->Dbc->qtimeout) {
+   snprintf(query, querylen, "call sys.settimeout(%" PRIu64 ")",
+(uint64_t) stmt->qtimeout);
+   if (mapi_query_handle(hdl, query) == MOK)
+   stmt->Dbc->qtimeout = stmt->qtimeout;
+   }
querypos = snprintf(query, querylen, "execute %d (", stmt->queryid);
/* XXX fill in parameter values */
if (desc->sql_desc_bind_offset_ptr)
diff --git a/clients/odbc/driver/SQLGetStmtAttr.c 
b/clients/odbc/driver/SQLGetStmtAttr.c
--- a/clients/odbc/driver/SQLGetStmtAttr.c
+++ b/clients/odbc/driver/SQLGetStmtAttr.c
@@ -123,7 +123,7 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
BufferLength, StringLengthPtr);
case SQL_ATTR_QUERY_TIMEOUT:/* SQLULEN */
/* SQL_QUERY_TIMEOUT */
-   WriteData(ValuePtr, 0, SQLULEN);
+   WriteData(ValuePtr, stmt->qtimeout, SQLULEN);
break;
case SQL_ATTR_RETRIE

MonetDB: default - Merge with Mar2018 branch.

2018-07-23 Thread Sjoerd Mullender
Changeset: ddf15f063d69 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ddf15f063d69
Added Files:
sql/test/BugTracker-2018/Tests/singleton-stddev.Bug-6627.sql
sql/test/BugTracker-2018/Tests/singleton-stddev.Bug-6627.stable.err
sql/test/BugTracker-2018/Tests/singleton-stddev.Bug-6627.stable.out
Modified Files:
gdk/gdk.h
gdk/gdk_aggr.c
gdk/gdk_join.c
gdk/gdk_private.h
sql/test/BugTracker-2018/Tests/All
testing/Mfilter.py
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 341 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1277,7 +1277,7 @@ bat_iterator(BAT *b)
  * the association dimension are not permitted.
  *
  * The persistency indicator tells the retention period of BATs.  The
- * system support three modes: PERSISTENT and TRANSIENT.
+ * system support two modes: PERSISTENT and TRANSIENT.
  * The PERSISTENT BATs are automatically saved upon session boundary
  * or transaction commit.  TRANSIENT BATs are removed upon transaction
  * boundary.  All BATs are initially TRANSIENT unless their mode is
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -3108,7 +3108,8 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
 
if ((e == NULL ||
 (BATcount(e) == BATcount(b) && e->hseqbase == b->hseqbase)) &&
-   (BATtdense(g) || (g->tkey && g->tnonil))) {
+   (BATtdense(g) || (g->tkey && g->tnonil)) &&
+   (issample || b->tnonil)) {
/* trivial: singleton groups, so all results are equal
 * to zero (population) or nil (sample) */
dbl v = issample ? dbl_nil : 0;
@@ -3193,7 +3194,8 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
} else {
GDKfree(mean);
}
-   nils += nils2;
+   if (issample)
+   nils += nils2;
GDKfree(delta);
GDKfree(m2);
GDKfree(cnts);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3874,6 +3874,23 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
rsize = (BUN) (BATcount(r) * (Tsize(r)) + (r->tvheap ? r->tvheap->size 
: 0) + 2 * sizeof(BUN));
mem_size = GDK_mem_maxsize / (GDKnr_threads ? GDKnr_threads : 1);
 
+   if (lcount == 1 || (BATordered(l) && BATordered_rev(l))) {
+   /* single value to join, use select */
+   return selectjoin(r1, r2, l, r, sl, sr, nil_matches, t0, false);
+   } else if (rcount == 1 || (BATordered(r) && BATordered_rev(r))) {
+   /* single value to join, use select */
+   return selectjoin(r2, r1, r, l, sr, sl, nil_matches, t0, true);
+   } else if (BATtdense(r) && (sr == NULL || BATtdense(sr))) {
+   /* use special implementation for dense right-hand side */
+   return mergejoin_void(r1, r2, l, r, sl, sr, false, false, t0, 
false);
+   } else if (BATtdense(l) && (sl == NULL || BATtdense(sl))) {
+   /* use special implementation for dense right-hand side */
+   return mergejoin_void(r2, r1, r, l, sr, sl, false, false, t0, 
true);
+   } else if ((BATordered(l) || BATordered_rev(l)) &&
+  (BATordered(r) || BATordered_rev(r))) {
+   /* both sorted */
+   return mergejoin(r1, r2, l, r, sl, sr, nil_matches, false, 
false, false, maxsize, t0, false);
+   }
if (sl == NULL) {
lhash = BATcheckhash(l);
if (!lhash && (parent = VIEWtparent(l)) != 0) {
@@ -3906,23 +3923,7 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
} else if (BATtdense(sr) && BATcheckhash(r)) {
rhash = BATcount(r) / ((size_t *) r->thash->heap.base)[5] * 
lcount < lcount + rcount;
}
-   if (lcount == 1 || (BATordered(l) && BATordered_rev(l))) {
-   /* single value to join, use select */
-   return selectjoin(r1, r2, l, r, sl, sr, nil_matches, t0, false);
-   } else if (rcount == 1 || (BATordered(r) && BATordered_rev(r))) {
-   /* single value to join, use select */
-   return selectjoin(r2, r1, r, l, sr, sl, nil_matches, t0, true);
-   } else if (BATtdense(r) && (sr == NULL || BATtdense(sr))) {
-   /* use special implementation for dense right-hand side */
-   return mergejoin_void(r1, r2, l, r, sl, sr, false, false, t0, 
false);
-   } else if (BATtdense(l) && (sl == NULL || BATtdense(sl))) {
-   /* use special implementation for dense right-hand side */
-   return mergejoin_void(r2, r1, r, l, sr, sl, false, false, t0, 
true);
-   } else if ((BATordered(l) || BATordered_rev(l)) &&
-  (BATordered(r) || BATordered_rev(r))) {
-   /* both sorted */
-   return mergejoin(r1, r2, l, r, sl, sr, nil_matches, false, 
false, false, maxsize, t0, false);

MonetDB: default - Merge with Mar2018 branch.

2018-07-23 Thread Sjoerd Mullender
Changeset: 464b3a019497 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=464b3a019497
Modified Files:
configure.ag
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/common/sql_types.c
sql/common/sql_types.h
sql/server/rel_schema.c
sql/server/rel_updates.c
sql/test/pg_regress/Tests/All
sql/test/pg_regress/Tests/update.stable.err
sql/test/pg_regress/Tests/update.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (219 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -3902,7 +3902,11 @@ sql_delete_set_Fkeys(backend *be, sql_ke
if (action == ACT_SET_DEFAULT) {
if (fc->c->def) {
stmt *sq;
-   char *msg = sa_message(sql->sa, "select %s;", 
fc->c->def);
+   char *msg, *typestr = 
subtype2string2(&fc->c->type);
+   if(!typestr)
+   return sql_error(sql, 02, 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   msg = sa_message(sql->sa, "select cast(%s as 
%s);", fc->c->def, typestr);
+   _DELETE(typestr);
sq = rel_parse_value(be, msg, sql->emode);
if (!sq) 
return NULL;
@@ -3961,7 +3965,11 @@ sql_update_cascade_Fkeys(backend *be, sq
} else if (action == ACT_SET_DEFAULT) {
if (fc->c->def) {
stmt *sq;
-   char *msg = sa_message(sql->sa, "select %s;", 
fc->c->def);
+   char *msg, *typestr = 
subtype2string2(&fc->c->type);
+   if(!typestr)
+   return sql_error(sql, 02, 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   msg = sa_message(sql->sa, "select cast(%s as 
%s);", fc->c->def, typestr);
+   _DELETE(typestr);
sq = rel_parse_value(be, msg, sql->emode);
if (!sq) 
return NULL;
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
@@ -312,7 +312,7 @@ create_table_or_view(mvc *sql, char *sna
sql_column *c = n->data;
 
if (c->def) {
-   char *buf;
+   char *buf, *typestr;
sql_rel *r = NULL;
 
sql->sa = sa_create();
@@ -321,7 +321,11 @@ create_table_or_view(mvc *sql, char *sna
buf = sa_alloc(sql->sa, strlen(c->def) + 8);
if(!buf)
throw(SQL, "sql.catalog",SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
-   snprintf(buf, BUFSIZ, "select %s;", c->def);
+   typestr = subtype2string2(&c->type);
+   if(!typestr)
+   throw(SQL, "sql.catalog",SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   snprintf(buf, BUFSIZ, "select cast(%s as %s);", c->def, 
typestr);
+   _DELETE(typestr);
r = rel_parse(sql, s, buf, m_deps);
if (!r || !is_project(r->op) || !r->exps || 
list_length(r->exps) != 1 || rel_check_type(sql, &c->type, r->exps->h->data, 
type_equal) == NULL)
throw(SQL, "sql.catalog", SQLSTATE(42000) "%s", 
sql->errstr);
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -418,6 +418,28 @@ subtype2string(sql_subtype *t)
return _STRDUP(buf);
 }
 
+char *
+subtype2string2(sql_subtype *tpe) //distinguish char(n), decimal(n,m) from 
other SQL types
+{
+   char buf[BUFSIZ];
+
+   switch (tpe->type->eclass) {
+   case EC_SEC:
+   snprintf(buf, BUFSIZ, "BIGINT");
+   break;
+   case EC_MONTH:
+   snprintf(buf, BUFSIZ, "INT");
+   break;
+   case EC_CHAR:
+   case EC_STRING:
+   case EC_DEC:
+   return subtype2string(tpe);
+   default:
+   snprintf(buf, BUFSIZ, "%s", tpe->type->sqlname);
+   }
+   return _STRDUP(buf);
+}
+
 int 
 subaggr_cmp( sql_subaggr *a1, sql_subaggr *a2)
 {
diff --git a/sql/common/sql_types.h b/sql/common/sql_types.h
--- a/sql/common/sql_types.h
+++ b/sql/common/sql_types.h
@@ -82,6 +82,7 @@ extern int subtype_cmp(sql_subtype *t1, 
 extern int arg_subtype_cmp(sql_arg *a, sql_subty

MonetDB: default - Merge with Mar2018 branch.

2018-07-11 Thread Sjoerd Mullender
Changeset: 0f951a98884e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f951a98884e
Modified Files:
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_group.c
gdk/gdk_hash.c
gdk/gdk_hash.h
gdk/gdk_join.c
gdk/gdk_private.h
gdk/gdk_select.c
gdk/gdk_unique.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/rel_bin.h
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_statement.c
sql/server/rel_dump.c

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.stable.err

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.stable.out
sql/test/BugTracker/Tests/case_in_aggr_bug.SF-1506545.sql
sql/test/seq-default.sql
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 999 to 300 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1050,8 +1050,10 @@ BUNappend(BAT *b, const void *t, bool fo
OIDXdestroy(b);
PROPdestroy(b->tprops);
b->tprops = NULL;
-   if (b->thash == (Hash *) 1) {
-   /* don't bother first loading the hash to then change it */
+   if (b->thash == (Hash *) 1 ||
+   (b->thash && ((size_t *) b->thash->heap.base)[0] & (1 << 24))) {
+   /* don't bother first loading the hash to then change
+* it, also, cannot maintain persistent hashes */
HASHdestroy(b);
}
if (b->thash) {
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -597,9 +597,11 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
OIDXdestroy(b);
PROPdestroy(b->tprops);
b->tprops = NULL;
-   if (b->thash == (Hash *) 1 || BATcount(b) == 0) {
+   if (b->thash == (Hash *) 1 || BATcount(b) == 0 ||
+   (b->thash && ((size_t *) b->thash->heap.base)[0] & (1 << 24))) {
/* don't bother first loading the hash to then change
-* it, or updating the hash if we replace the heap */
+* it, or updating the hash if we replace the heap,
+* also, we cannot maintain persistent hashes */
HASHdestroy(b);
}
 
@@ -1058,12 +1060,9 @@ BATkeyed(BAT *b)
b->tkey = true;
} else if (BATcheckhash(b) ||
   (b->batPersistence == PERSISTENT &&
-   BAThash(b, 0) == GDK_SUCCEED)
-#ifndef DISABLE_PARENT_HASH
-  || (VIEWtparent(b) != 0 &&
-  BATcheckhash(BBPdescriptor(VIEWtparent(b
-#endif
-   ) {
+   BAThash(b, 0) == GDK_SUCCEED) ||
+  (VIEWtparent(b) != 0 &&
+   BATcheckhash(BBPdescriptor(VIEWtparent(b) {
/* we already have a hash table on b, or b is
 * persistent and we could create a hash
 * table, or b is a view on a bat that already
@@ -1071,13 +1070,11 @@ BATkeyed(BAT *b)
BUN lo = 0;
 
hs = b->thash;
-#ifndef DISABLE_PARENT_HASH
-   if (b->thash == NULL && VIEWtparent(b) != 0) {
+   if (hs == NULL && VIEWtparent(b) != 0) {
BAT *b2 = BBPdescriptor(VIEWtparent(b));
lo = (BUN) ((b->theap.base - b2->theap.base) >> 
b->tshift);
hs = b2->thash;
}
-#endif
for (q = BUNlast(b), p = 0; p < q; p++) {
const void *v = BUNtail(bi, p);
for (hb = HASHgetlink(hs, p + lo);
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -506,9 +506,7 @@ BATgroup_internal(BAT **groups, BAT **ex
Hash *hs = NULL;
BUN hb;
BUN maxgrps;
-#ifndef DISABLE_PARENT_HASH
bat parent;
-#endif
BUN start, end, cnt;
BUN lo = 0;
const oid *restrict cand, *candend;
@@ -968,12 +966,9 @@ BATgroup_internal(BAT **groups, BAT **ex
} else if (g == NULL &&
   (BATcheckhash(b) ||
(b->batPersistence == PERSISTENT &&
-BAThash(b, 0) == GDK_SUCCEED)
-#ifndef DISABLE_PARENT_HASH
-   || ((parent = VIEWtparent(b)) != 0 &&
-   BATcheckhash(BBPdescriptor(parent)))
-#endif
-  )) {
+BAThash(b, 0) == GDK_SUCCEED) ||
+   ((parent = VIEWtparent(b)) != 0 &&
+BATcheckhash(BBPdescriptor(parent) {
/* we already have a hash table on b, or b is
 * persistent and we could create a hash table, 

MonetDB: default - Merge with Mar2018 branch.

2018-07-10 Thread Sjoerd Mullender
Changeset: 46f9a0d2a263 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46f9a0d2a263
Modified Files:
gdk/gdk_align.c
gdk/gdk_batop.c
gdk/gdk_hash.c
gdk/gdk_imprints.c
gdk/gdk_join.c
gdk/gdk_orderidx.c
gdk/gdk_private.h
gdk/gdk_project.c
gdk/gdk_sample.c
gdk/gdk_select.c
gdk/gdk_unique.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1841 to 300 lines):

diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -167,7 +167,8 @@ BATmaterialize(BAT *b)
p = 0;
q = BUNlast(b);
assert(cnt >= q - p);
-   ALGODEBUG fprintf(stderr, "#BATmaterialize(%d);\n", (int) 
b->batCacheid);
+   ALGODEBUG fprintf(stderr, "#BATmaterialize(" ALGOBATFMT ")\n",
+ ALGOBATPAR(b));
 
if (tt != TYPE_void) {
/* no voids */
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1341,9 +1341,12 @@ gdk_return
 BATsort(BAT **sorted, BAT **order, BAT **groups,
   BAT *b, BAT *o, BAT *g, bool reverse, bool stable)
 {
-   BAT *bn = NULL, *on = NULL, *gn, *pb = NULL;
+   BAT *bn = NULL, *on = NULL, *gn = NULL, *pb = NULL;
oid *restrict grps, *restrict ords, prev;
BUN p, q, r;
+   lng t0 = 0;
+
+   ALGODEBUG t0 = GDKusec();
 
if (b == NULL) {
GDKerror("BATsort: b must exist\n");
@@ -1420,6 +1423,15 @@ BATsort(BAT **sorted, BAT **order, BAT *
}
*groups = gn;
}
+   ALGODEBUG fprintf(stderr, "#BATsort(b=" ALGOBATFMT ",o="
+ ALGOOPTBATFMT ",g=" ALGOOPTBATFMT
+ ",reverse=%d,stable=%d) = (" ALGOOPTBATFMT
+ "," ALGOOPTBATFMT "," ALGOOPTBATFMT
+ ") -- trivial (" LLFMT " usec)\n",
+ ALGOBATPAR(b), ALGOOPTBATPAR(o),
+ ALGOOPTBATPAR(g), reverse, stable,
+ ALGOOPTBATPAR(bn), ALGOOPTBATPAR(gn),
+ ALGOOPTBATPAR(on), GDKusec() - t0);
return GDK_SUCCEED;
}
if (VIEWtparent(b)) {
@@ -1468,13 +1480,26 @@ BATsort(BAT **sorted, BAT **order, BAT *
}
if (sorted)
*sorted = bn;
-   else
+   else {
BBPunfix(bn->batCacheid);
+   bn = NULL;
+   }
}
if (order)
*order = on;
-   else
+   else {
BBPunfix(on->batCacheid);
+   on = NULL;
+   }
+   ALGODEBUG fprintf(stderr, "#BATsort(b=" ALGOBATFMT ",o="
+ ALGOOPTBATFMT ",g=" ALGOOPTBATFMT
+ ",reverse=%d,stable=%d) = (" ALGOOPTBATFMT
+ "," ALGOOPTBATFMT "," ALGOOPTBATFMT
+ ") -- orderidx (" LLFMT " usec)\n",
+ ALGOBATPAR(b), ALGOOPTBATPAR(o),
+ ALGOOPTBATPAR(g), reverse, stable,
+ ALGOOPTBATPAR(bn), ALGOOPTBATPAR(gn),
+ ALGOOPTBATPAR(on), GDKusec() - t0);
return GDK_SUCCEED;
}
if (o) {
@@ -1482,9 +1507,9 @@ BATsort(BAT **sorted, BAT **order, BAT *
if (bn == NULL)
goto error;
if (bn->ttype == TYPE_void || isVIEW(bn)) {
-   b = COLcopy(bn, ATOMtype(bn->ttype), true, TRANSIENT);
+   BAT *b2 = COLcopy(bn, ATOMtype(bn->ttype), true, 
TRANSIENT);
BBPunfix(bn->batCacheid);
-   bn = b;
+   bn = b2;
}
pb = NULL;
} else {
@@ -1537,6 +1562,7 @@ BATsort(BAT **sorted, BAT **order, BAT *
*sorted = bn;
} else {
BBPunfix(bn->batCacheid);
+   bn = NULL;
}
if (order) {
*order = on;
@@ -1566,6 +1592,16 @@ BATsort(BAT **sorted, BAT **order, BAT *
goto error;
*groups = gn;
}
+   ALGODEBUG fprintf(stderr, "#BATsort(b=" ALGOBATFMT
+ ",o=" ALGOOPTBATFMT ",g=" ALGOBATFMT
+ ",reverse=%d,stable=%d) = ("
+

MonetDB: default - Merge with Mar2018 branch

2018-07-03 Thread Pedro Ferreira
Changeset: b81b525fc5c7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b81b525fc5c7
Added Files:
sql/test/BugTracker-2018/Tests/remote-table-where-not-equal.Bug-6621.py

sql/test/BugTracker-2018/Tests/remote-table-where-not-equal.Bug-6621.stable.err

sql/test/BugTracker-2018/Tests/remote-table-where-not-equal.Bug-6621.stable.out
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
gdk/gdk_join.c
gdk/gdk_private.h
gdk/gdk_select.c
monetdb5/modules/kernel/mmath.c
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch


diffs (truncated from 1336 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1781,7 +1781,8 @@ dump_database(Mapi mid, stream *toConsol
"WHEN 4 THEN 'INSERT' "
"WHEN 8 THEN 'DELETE' "
"WHEN 16 THEN 'EXECUTE' "
-   "WHEN 32 THEN 'GRANT' END, "
+   "WHEN 32 THEN 'GRANT' "
+   "WHEN 64 THEN 'TRUNCATE' END, "
   "g.name, p.grantable "
"FROM sys.schemas s, sys.tables t, "
 "sys.columns c, sys.auths a, "
@@ -1801,7 +1802,8 @@ dump_database(Mapi mid, stream *toConsol
"WHEN 4 THEN 'INSERT' "
"WHEN 8 THEN 'DELETE' "
"WHEN 16 THEN 'EXECUTE' "
-   "WHEN 32 THEN 'GRANT' END, "
+   "WHEN 32 THEN 'GRANT' "
+   "WHEN 64 THEN 'TRUNCATE' END, "
   "g.name, p.grantable "
"FROM sys.schemas s, sys.functions f, "
 "sys.auths a, sys.privileges p, sys.auths g "
@@ -2276,6 +2278,10 @@ dump_database(Mapi mid, stream *toConsol
mnstr_printf(toConsole, "%s GRANT", sep);
sep = ",";
}
+   if (priv & 64) {
+   mnstr_printf(toConsole, "%s TRUNCATE", sep);
+   sep = ",";
+   }
}
mnstr_printf(toConsole, " ON TABLE \"%s\" TO \"%s\"",
 tname, aname);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -302,8 +302,7 @@ timerHuman(int64_t sqloptimizer, int64_t
fflush(stderr);
return;
}
-   if (timermode == T_PERF && (!total || singleinstr != total) &&
-   (sqloptimizer > 0 || maloptimizer > 0 || querytime > 0)) {
+   if (timermode == T_PERF && (!total || singleinstr != total)) {
/* for performance measures we use milliseconds as the base */
fflush(stderr);
mnstr_flush(toConsole);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -277,17 +277,10 @@ nomatch(BAT *r1, BAT *r2, BAT *l, BAT *r
BATtseqbase(r2, oid_nil);
}
ALGODEBUG fprintf(stderr,
- "#%s(l=%s,r=%s)=(%s#"BUNFMT"%s%s%s,%s#"BUNFMT"%s%s%s) 
" LLFMT "us -- nomatch\n",
+ "#%s(l=%s,r=%s)=(" ALGOBATFMT "," ALGOOPTBATFMT ") " 
LLFMT "us -- nomatch\n",
  func,
  BATgetId(l), BATgetId(r),
- BATgetId(r1), BATcount(r1),
- r1->tsorted ? "-sorted" : "",
- r1->trevsorted ? "-revsorted" : "",
- r1->tkey ? "-key" : "",
- r2 ? BATgetId(r2) : "--", r2 ? BATcount(r2) : 0,
- r2 && r2->tsorted ? "-sorted" : "",
- r2 && r2->trevsorted ? "-revsorted" : "",
- r2 && r2->tkey ? "-key" : "",
+ ALGOBATPAR(r1), ALGOOPTBATPAR(r2),
  GDKusec() - t0);
return GDK_SUCCEED;
 
@@ -307,25 +300,10 @@ selectjoin(BAT *r1, BAT *r2, BAT *l, BAT
BUN lstart, lend, lcnt;
BAT *bn = NULL;
 
-   ALGODEBUG fprintf(stderr, "#selectjoin(l=%s#" BUNFMT "[%s]%s%s%s,"
- "r=%s#" BUNFMT "[%s]%s%s%s,sl=%s#" BUNFMT "%s%s%s,"
- "sr=%s#" BUNFMT "%s%s%s,nil_matches=%d)%s\n",
- BATgetId(l), BATcount(l), ATOMname(l->ttype),
- l->tsorted ? "-sorted" : "",
- l->trevsorted ? "-revsorted" : "",
- l->tkey ? "-key" : "",
- BATgetId(r), BATcount(r), ATOMname(r->ttype),
- r->tsorted ? "-sorted" : "",
-   

MonetDB: default - Merge with Mar2018 branch

2018-07-02 Thread Pedro Ferreira
Changeset: a47da1df03dd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a47da1df03dd
Added Files:

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.stable.err

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.stable.out

sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py

sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.stable.err

sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.stable.out
sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-rangejoin-undefined.Bug-6610.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-rangejoin-undefined.Bug-6610.stable.out
Removed Files:

sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.SQL.py
Modified Files:
clients/mapiclient/mclient.c
clients/odbc/driver/SQLGetConnectAttr.c
clients/odbc/driver/SQLGetStmtAttr.c
clients/odbc/driver/SQLSetStmtAttr.c
configure.ag
gdk/gdk_group.c
monetdb5/modules/mal/pcre.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/server/rel_updates.c
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch


diffs (truncated from 1059 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -302,7 +302,8 @@ timerHuman(int64_t sqloptimizer, int64_t
fflush(stderr);
return;
}
-   if (timermode == T_PERF && (!total || (singleinstr != total))) {
+   if (timermode == T_PERF && (!total || singleinstr != total) &&
+   (sqloptimizer > 0 || maloptimizer > 0 || querytime > 0)) {
/* for performance measures we use milliseconds as the base */
fflush(stderr);
mnstr_flush(toConsole);
diff --git a/clients/odbc/driver/SQLGetConnectAttr.c 
b/clients/odbc/driver/SQLGetConnectAttr.c
--- a/clients/odbc/driver/SQLGetConnectAttr.c
+++ b/clients/odbc/driver/SQLGetConnectAttr.c
@@ -53,9 +53,9 @@ MNDBGetConnectAttr(ODBCDbc *dbc,
WriteData(ValuePtr, SQL_ASYNC_ENABLE_OFF, SQLULEN);
break;
case SQL_ATTR_AUTO_IPD: /* SQLUINTEGER */
-   /* TODO implement automatic filling of IPD See also
-* SQLSetStmtAttr.c for SQL_ATTR_ENABLE_AUTO_IPD */
-   WriteData(ValuePtr, SQL_FALSE, SQLUINTEGER);
+   /* See also SQLSetStmtAttr.c for
+* SQL_ATTR_ENABLE_AUTO_IPD */
+   WriteData(ValuePtr, SQL_TRUE, SQLUINTEGER);
break;
case SQL_ATTR_AUTOCOMMIT:   /* SQLUINTEGER */
/* SQL_AUTOCOMMIT */
diff --git a/clients/odbc/driver/SQLGetStmtAttr.c 
b/clients/odbc/driver/SQLGetStmtAttr.c
--- a/clients/odbc/driver/SQLGetStmtAttr.c
+++ b/clients/odbc/driver/SQLGetStmtAttr.c
@@ -55,6 +55,9 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
/* SQL_ASYNC_ENABLE */
WriteData(ValuePtr, SQL_ASYNC_ENABLE_OFF, SQLULEN);
break;
+   case SQL_ATTR_ENABLE_AUTO_IPD:  /* SQLULEN */
+   WriteData(ValuePtr, SQL_TRUE, SQLULEN);
+   break;
case SQL_ATTR_CONCURRENCY:  /* SQLULEN */
/* SQL_CONCURRENCY */
WriteData(ValuePtr, SQL_CONCUR_READ_ONLY, SQLULEN);
@@ -118,6 +121,10 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
return MNDBGetDescField(stmt->ImplParamDescr, 0,
SQL_DESC_ARRAY_STATUS_PTR, ValuePtr,
BufferLength, StringLengthPtr);
+   case SQL_ATTR_QUERY_TIMEOUT:/* SQLULEN */
+   /* SQL_QUERY_TIMEOUT */
+   WriteData(ValuePtr, 0, SQLULEN);
+   break;
case SQL_ATTR_RETRIEVE_DATA:/* SQLULEN */
/* SQL_RETRIEVE_DATA */
WriteData(ValuePtr, stmt->retrieveData, SQLULEN);
@@ -165,12 +172,9 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
 #ifdef SQL_ATTR_ASYNC_STMT_PCONTEXT
case SQL_ATTR_ASYNC_PCONTEXT:   /* SQLPOINTER */
 #endif
-   case SQL_ATTR_ENABLE_AUTO_IPD:  /* SQLULEN */
case SQL_ATTR_FETCH_BOOKMARK_PTR:   /* SQLLEN* */
case SQL_ATTR_KEYSET_SIZE:  /* SQLULEN */
/* SQL_KEYSET_SIZE */
-   case SQL_ATTR_QUERY_TIMEOUT:/* SQLULEN */
-   /* SQL_QUERY_TIMEOUT */
case SQL_ATTR_SIMULATE_CURSOR:  /* SQLULEN */
case 

MonetDB: default - Merge with Mar2018 branch.

2018-06-25 Thread Sjoerd Mullender
Changeset: eeb7f6449b1e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eeb7f6449b1e
Modified Files:
sql/test/Tests/fsum.sql
sql/test/Tests/fsum.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 28410 to 300 lines):

diff --git a/sql/test/Tests/fsum.sql b/sql/test/Tests/fsum.sql
--- a/sql/test/Tests/fsum.sql
+++ b/sql/test/Tests/fsum.sql
@@ -3133,7 +3133,7 @@ 0.001004016064257028 16
 0.001002004008016032 16
 -0.001001001001001001 16
 0.001 16
-select gid, sum(val) from t where gid in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 15, 16, 17, 18, 19, 22, 23, 31, 33, 35, 37, 39, 40) group by gid 
order by gid;
+select gid, sum(val) from t where gid in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 15, 16, 17, 18, 19, 22, 23, 31, 33, 35, 37, 39, 40, 41) group by 
gid order by gid;
 -- these should all produce overflow
 select sum(val) from t where gid = 14;
 select sum(val) from t where gid = 20;
diff --git a/sql/test/Tests/fsum.stable.out b/sql/test/Tests/fsum.stable.out
--- a/sql/test/Tests/fsum.stable.out
+++ b/sql/test/Tests/fsum.stable.out
@@ -49,9 +49,9 @@ Ready.
 #1.0 15
 #8.988465674311579e+307 25
 [ 3131 ]
-#select gid, sum(val) from t where gid in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 15, 16, 17, 18, 19, 22, 31, 33, 39, 40) group by gid order by gid;
-% sys.t,   sys.L5 # table_name
-% gid, L4 # name
+#select gid, sum(val) from t where gid in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 15, 16, 17, 18, 19, 22, 23, 31, 33, 35, 37, 39, 40, 41) group by 
gid order by gid;
+% sys.t,   sys.L3 # table_name
+% gid, L3 # name
 % int, double # type
 % 2,   24 # length
 [ 1,   0   ]
@@ -80,6 +80,7 @@ Ready.
 [ 37,  -1.797693135e+308   ]
 [ 39,  1.797693135e+308]
 [ 40,  1.697693135e+308]
+[ 41,  1e+16   ]
 #drop table t;
 
 # 10:54:43 >  
diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -17,61 +17,6 @@ stdout of test 'upgrade` in directory 's
 # Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-30908/.s.monetdb.39660
 # MonetDB/GIS module loaded
 Running database upgrade commands:
-set schema "sys";
-drop function sys.dependencies_functions_os_triggers();
-CREATE FUNCTION dependencies_functions_on_triggers()
-RETURNS TABLE (sch varchar(100), usr varchar(100), dep_type varchar(32))
-RETURN TABLE (SELECT f.name, tri.name, 'DEP_TRIGGER' from functions as f, 
triggers as tri, dependencies as dep where dep.id = f.id AND dep.depend_id 
=tri.id AND dep.depend_type = 8);
-insert into sys.systemfunctions (select id from sys.functions where name in 
('dependencies_functions_on_triggers') and schema_id = (select id from 
sys.schemas where name = 'sys') and id not in (select function_id from 
sys.systemfunctions));
-delete from systemfunctions where function_id not in (select id from 
functions);
-set schema "sys";
-commit;
-
-Running database upgrade commands:
-set schema "sys";
-DROP VIEW sys.dependencies_vw;
-DROP VIEW sys.ids;
-CREATE VIEW sys.ids (id, name, schema_id, table_id, table_name, obj_type, 
sys_table) AS
-SELECT id, name, cast(null as int) as schema_id, cast(null as int) as 
table_id, cast(null as varchar(124)) as table_name, 'author' AS obj_type, 
'sys.auths' AS sys_table FROM sys.auths UNION ALL
-SELECT id, name, cast(null as int) as schema_id, cast(null as int) as 
table_id, cast(null as varchar(124)) as table_name, 'schema', 'sys.schemas' 
FROM sys.schemas UNION ALL
-SELECT id, name, schema_id, id as table_id, name as table_name, case when type 
= 1 then 'view' else 'table' end, '

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-05-31 Thread Panagiotis Koutsourakis
Changeset: 139ddcc78aab for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=139ddcc78aab
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files..

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


MonetDB: default - Merge with Mar2018 branch.

2018-05-31 Thread Panagiotis Koutsourakis
Changeset: dbd3be94d518 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dbd3be94d518
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (48 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -697,3 +697,6 @@ 28edc063ceb6a3726af887911a3e4ac4a33c504f
 f34a57f73307a09909b3669ce5cfd9aad490f317 Mar2018_release
 ee3d17d6f39930280f5aa914b42b87cda09008ca Mar2018_5
 ee3d17d6f39930280f5aa914b42b87cda09008ca Mar2018_SP1_release
+e96bb94b4c9c3b99e1c33d9c8b49bc3ce7f8e95b Mar2018_7
+ee3d17d6f39930280f5aa914b42b87cda09008ca Mar2018_SP1_release
+e96bb94b4c9c3b99e1c33d9c8b49bc3ce7f8e95b Mar2018_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1033,6 +1033,9 @@ done
 %postun -p /sbin/ldconfig
 
 %changelog
+* Thu May 31 2018 Panagiotis Koutsourakis  - 
11.29.7-20180531
+- Rebuilt.
+
 * Fri May 25 2018 Panagiotis Koutsourakis  - 
11.29.5-20180525
 - Rebuilt.
 - BZ#6562: Sqlitelogictest crash on group by query with not in operator
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+monetdb (11.29.7) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Panagiotis Koutsourakis   Thu, 31 May 2018 
10:17:56 +0200
+
 monetdb (11.29.5) unstable; urgency=low
 
   * Rebuilt.
diff --git a/libversions b/libversions
--- a/libversions
+++ b/libversions
@@ -42,7 +42,7 @@ GDK_VERSION=16:2:0
 MAPI_VERSION=10:1:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras)
-MONETDB5_VERSION=24:2:0
+MONETDB5_VERSION=24:3:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=11:1:0
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-05-31 Thread Panagiotis Koutsourakis
Changeset: 5e3514b1ffac for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5e3514b1ffac
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files.

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


MonetDB: default - Merge with Mar2018 branch.

2018-05-30 Thread Sjoerd Mullender
Changeset: 52a17b3f4f72 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=52a17b3f4f72
Modified Files:
monetdb5/modules/kernel/batstr.c
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
sql/test/Dependencies/Tests/dependency_loop.stable.out
sql/test/Dependencies/Tests/dependency_loop.stable.out.int128
sql/test/Dependencies/dependency_DBobjects.sql
sql/test/Dependencies/dependency_owner_schema_3.sql
testing/difflib.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 2141 to 300 lines):

diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -773,13 +773,13 @@ str STRbatPrefix(bat *ret, const bat *l,
BUN p,q;
bit v, *vp= &v;
 
-   prepareOperand2(left,l,right,r,"batstr.prefix");
+   prepareOperand2(left,l,right,r,"batstr.startsWith");
if(BATcount(left) != BATcount(right)) {
BBPunfix(left->batCacheid);
BBPunfix(right->batCacheid);
throw(MAL, "batstr.startsWith", ILLEGAL_ARGUMENT " Requires 
bats of identical size");
}
-   prepareResult2(bn,left,right,TYPE_bit,"batstr.prefix");
+   prepareResult2(bn,left,right,TYPE_bit,"batstr.startsWith");
 
lefti = bat_iterator(left);
righti = bat_iterator(right);
@@ -799,7 +799,7 @@ bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(right->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr." "prefix", OPERATION_FAILED " During bulk 
operation");
+   throw(MAL, "batstr.startsWith", OPERATION_FAILED " During bulk 
operation");
 }
 
 str STRbatPrefixcst(bat *ret, const bat *l, const str *cst)
@@ -809,8 +809,8 @@ str STRbatPrefixcst(bat *ret, const bat 
BUN p,q;
bit v, *vp= &v;
 
-   prepareOperand(left,l,"batstr.prefix");
-   prepareResult(bn,left,TYPE_bit,"batstr.prefix");
+   prepareOperand(left,l,"batstr.startsWith");
+   prepareResult(bn,left,TYPE_bit,"batstr.startsWith");
 
lefti = bat_iterator(left);
 
@@ -826,7 +826,7 @@ str STRbatPrefixcst(bat *ret, const bat 
 bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr""prefix", OPERATION_FAILED " During bulk operation");
+   throw(MAL, "batstr.startsWith", OPERATION_FAILED " During bulk 
operation");
 }
 
 str STRbatSuffix(bat *ret, const bat *l, const bat *r)
@@ -836,13 +836,13 @@ str STRbatSuffix(bat *ret, const bat *l,
BUN p,q;
bit v, *vp= &v;
 
-   prepareOperand2(left,l,right,r,"batstr.suffix");
+   prepareOperand2(left,l,right,r,"batstr.endsWith");
if(BATcount(left) != BATcount(right)) {
BBPunfix(left->batCacheid);
BBPunfix(right->batCacheid);
throw(MAL, "batstr.endsWith", ILLEGAL_ARGUMENT " Requires bats 
of identical size");
}
-   prepareResult2(bn,left,right,TYPE_bit,"batstr.suffix");
+   prepareResult2(bn,left,right,TYPE_bit,"batstr.endsWith");
 
lefti = bat_iterator(left);
righti = bat_iterator(right);
@@ -862,7 +862,7 @@ bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(right->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr." "suffix", OPERATION_FAILED " During bulk 
operation");
+   throw(MAL, "batstr.endsWith", OPERATION_FAILED " During bulk 
operation");
 }
 
 str STRbatSuffixcst(bat *ret, const bat *l, const str *cst)
@@ -872,8 +872,8 @@ str STRbatSuffixcst(bat *ret, const bat 
BUN p,q;
bit v, *vp= &v;
 
-   prepareOperand(left,l,"batstr.suffix");
-   prepareResult(bn,left,TYPE_bit,"batstr.suffix");
+   prepareOperand(left,l,"batstr.endsWith");
+   prepareResult(bn,left,TYPE_bit,"batstr.endsWith");
 
lefti = bat_iterator(left);
 
@@ -889,7 +889,7 @@ str STRbatSuffixcst(bat *ret, const bat 
 bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr""suffix", OPERATION_FAILED " During bulk operation");
+   throw(MAL, "batstr.endsWith", OPERATION_FAILED " During bulk 
operation");
 }
 
 str STRbatstrSearch(bat *ret, const bat *l, const bat *r)
@@ -925,7 +925,7 @@ bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(right->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr." "search", OPERATION_FAILED " During bulk 
operation");
+   throw(MAL, "batstr.search", OPERATION_FAILED " During bulk operation");
 }
 
 str STRbatstrSearchcst(bat *ret, const bat *l, const str *cst)
@@ -952,7 +952,7 @@ str STRbatstrSearchcst(bat *ret, const b
 bunins_failed:
BBPunfix(left->batCacheid);
BBPunfix(*ret);
-   throw(MAL, "batstr""search", OPERATION_FAILED " During bulk operation");
+   throw(MAL, "batstr.search", OPERATION_FAIL

MonetDB: default - Merge with Mar2018 branch

2018-05-30 Thread Panagiotis Koutsourakis
Changeset: 2715167a998d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2715167a998d
Modified Files:
MonetDB.spec
debian/changelog
Branch: default
Log Message:

Merge with Mar2018 branch


diffs (22 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1071,7 +1071,6 @@ done
 - BZ#6602: Sqlitelogictest wrong results in IN query
 - BZ#6603: Sqlitelogictest: Aggregation query with distinct clause
   produces duplicated rows
-- BZ#6605: Sqlitelogictest set queries with wrong results
 
 * Thu May 17 2018 Martin van Dinther  
- 11.29.5-20180525
 - sql: Corrected the definition of view: sys.ids.
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,7 +37,6 @@ monetdb (11.29.5) unstable; urgency=low
   * BZ#6602: Sqlitelogictest wrong results in IN query
   * BZ#6603: Sqlitelogictest: Aggregation query with distinct clause
 produces duplicated rows
-  * BZ#6605: Sqlitelogictest set queries with wrong results
 
  -- Panagiotis Koutsourakis   Fri, 25 May 2018 
11:41:04 +0200
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-05-30 Thread Sjoerd Mullender
Changeset: ed9826836ecd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ed9826836ecd
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (38 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -310,9 +310,9 @@ dump_foreign_keys(Mapi mid, const char *
pkeys = malloc(nkeys * sizeof(*pkeys));
if (fkeys == NULL || pkeys == NULL) {
if (fkeys)
-   free(fkeys);
+   free((void *) fkeys);
if (pkeys)
-   free(pkeys);
+   free((void *) pkeys);
goto bailout;
}
pkeys[nkeys - 1] = c_pcolumn;
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2559,8 +2559,8 @@ doFile(Mapi mid, stream *fp, bool useins
"  t.name,\n"
"  s.name || '.' || 
t.name AS fullname,\n"
"  CAST(CASE 
t.type\n"
-   "  WHEN 1 THEN 2 -- 
ntype for views\n"
-   "  ELSE 1\t  -- 
ntype for tables\n"
+   "  WHEN 1 THEN 2\n" 
/* ntype for views */
+   "  ELSE 1\n" /* 
ntype for tables */
"  END AS SMALLINT) 
AS ntype,\n"
"  (CASE WHEN 
t.system THEN 'SYSTEM ' ELSE '' END) || tt.table_type_name AS type,\n"
"  t.system,\n"
@@ -2581,7 +2581,7 @@ doFile(Mapi mid, stream *fp, bool useins
"LEFT OUTER JOIN 
comments c ON sq.id = c.id\n"
"LEFT OUTER JOIN 
sys.schemas s ON sq.schema_id = s.id\n"
"  UNION ALL\n"
-   "  SELECT DISTINCT 
s.name AS sname,  -- DISTINCT is needed to filter out duplicate overloaded 
function/procedure names\n"
+   "  SELECT DISTINCT 
s.name AS sname,\n" /* DISTINCT is needed to filter out duplicate overloaded 
function/procedure names */
"  f.name,\n"
"  s.name || '.' || 
f.name AS fullname,\n"
"  CAST(8 AS 
SMALLINT) AS ntype,\n"
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-05-29 Thread Sjoerd Mullender
Changeset: 9d6a020238a3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9d6a020238a3
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_psm.c
sql/server/rel_select.c
sql/server/sql_parser.h
sql/server/sql_parser.y
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files.

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


MonetDB: default - Merge with Mar2018 branch.

2018-05-29 Thread Sjoerd Mullender
Changeset: 91dd5d6cbd0c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=91dd5d6cbd0c
Modified Files:
MonetDB.spec
clients/mapiclient/dump.c
debian/changelog
debian/monetdb5-server.install
sql/backends/monet5/sql_upgrades.c
sql/common/sql_list.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 641 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1048,13 +1048,11 @@ done
   statement
 - BZ#6574: server crashed could not find ordered index while creating
   a table
-- BZ#6575: Sqlitelogictest crash on groupby query with coalesce call
 - BZ#6576: Sqlitelogictest aritmetic expressions with negative numbers
   handling
 - BZ#6577: creating temp table kills performance of the original query
 - BZ#6578: One two-tuple insert gives different results than two single
   inserts
-- BZ#6579: Sqlitelogic test infinite loop while compiling SQL query
 - BZ#6581: Join condition errors.
 - BZ#6583: Fixed size string concatenation with integer results in fixed
   size string of size 0
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -25,56 +25,72 @@ get_compat_clause(Mapi mid)
return compat_clause;
 }
 
-static void
+static int
 quoted_print(stream *f, const char *s, bool singleq)
 {
-   mnstr_write(f, singleq ? "'" : "\"", 1, 1);
+   if (mnstr_write(f, singleq ? "'" : "\"", 1, 1) < 0)
+   return -1;
while (*s) {
switch (*s) {
case '\\':
-   mnstr_write(f, "", 1, 2);
+   if (mnstr_write(f, "", 1, 2) < 0)
+   return -1;
break;
case '"':
-   mnstr_write(f, "\"\"", 1, singleq ? 1 : 2);
+   if (mnstr_write(f, "\"\"", 1, singleq ? 1 : 2) < 0)
+   return -1;
break;
case '\'':
-   mnstr_write(f, "''", 1, singleq ? 2 : 1);
+   if (mnstr_write(f, "''", 1, singleq ? 2 : 1) < 0)
+   return -1;
break;
case '\n':
-   mnstr_write(f, "\\n", 1, 2);
+   if (mnstr_write(f, "\\n", 1, 2) < 0)
+   return -1;
break;
case '\t':
-   mnstr_write(f, "\\t", 1, 2);
+   if (mnstr_write(f, "\\t", 1, 2) < 0)
+   return -1;
break;
default:
-   if ((0 < *s && *s < 32) || *s == '\177')
-   mnstr_printf(f, "\\%03o", (uint8_t) *s);
-   else
-   mnstr_write(f, s, 1, 1);
+   if ((0 < *s && *s < 32) || *s == '\177') {
+   if (mnstr_printf(f, "\\%03o", (uint8_t) *s) < 0)
+   return -1;
+   } else {
+   if (mnstr_write(f, s, 1, 1) < 0)
+   return -1;
+   }
break;
}
s++;
}
-   mnstr_write(f, singleq ? "'" : "\"", 1, 1);
+   if (mnstr_write(f, singleq ? "'" : "\"", 1, 1) < 0)
+   return -1;
+   return 0;
 }
 
-static void
+static int
 comment_on(stream *toConsole, const char *object,
   const char *ident1, const char *ident2, const char *ident3,
   const char *remark)
 {
if (remark) {
-   mnstr_printf(toConsole, "COMMENT ON %s \"%s\"", object, ident1);
+   if (mnstr_printf(toConsole, "COMMENT ON %s \"%s\"", object, 
ident1) < 0)
+   return -1;
if (ident2) {
-   mnstr_printf(toConsole, ".\"%s\"", ident2);
+   if (mnstr_printf(toConsole, ".\"%s\"", ident2) < 0)
+   return -1;
if (ident3) {
-   mnstr_printf(toConsole, ".\"%s\"", ident3);
+   if (mnstr_printf(toConsole, ".\"%s\"", ident3) 
< 0)
+   return -1;
}
}
-   mnstr_write(toConsole, " IS ", 1, 4);
-   quoted_print(toConsole, remark, 

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-05-25 Thread Panagiotis Koutsourakis
Changeset: 07fc13e1e728 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07fc13e1e728
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files..

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


MonetDB: default - Merge with Mar2018 branch.

2018-05-25 Thread Panagiotis Koutsourakis
Changeset: 6d9df475fc44 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d9df475fc44
Modified Files:
.hgtags
MonetDB.spec
buildtools/ChangeLog-Archive
buildtools/ChangeLog.Mar2018
debian/changelog
libversions
sql/ChangeLog-Archive
sql/ChangeLog.Mar2018
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (227 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -695,3 +695,5 @@ 28edc063ceb6a3726af887911a3e4ac4a33c504f
 f34a57f73307a09909b3669ce5cfd9aad490f317 Mar2018_3
 28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_release
 f34a57f73307a09909b3669ce5cfd9aad490f317 Mar2018_release
+ee3d17d6f39930280f5aa914b42b87cda09008ca Mar2018_5
+ee3d17d6f39930280f5aa914b42b87cda09008ca Mar2018_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -132,7 +132,7 @@ Vendor: MonetDB BV 
 Group: Applications/Databases
 License: MPLv2.0
 URL: https://www.monetdb.org/
-Source: 
https://www.monetdb.org/downloads/sources/Mar2018/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Mar2018-SP1/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 # we need checkpolicy and selinux-policy-devel for the SELinux policy
@@ -1034,6 +1034,59 @@ done
 %postun -p /sbin/ldconfig
 
 %changelog
+* Fri May 25 2018 Panagiotis Koutsourakis  - 
11.29.5-20180525
+- Rebuilt.
+- BZ#6562: Sqlitelogictest crash on group by query with not in operator
+- BZ#6565: Sqlitelogictest crash on complex select query with coalesce
+  call
+- BZ#6566: Sqlitelogictest unavailable calc.- MAL operations
+- BZ#6568: Sqlitelogictest crash on complex case query
+- BZ#6569: Sqlitelogictest select query with not between cause with
+  wrong results
+- BZ#6570: Sqlitelogictest select coalesce undefined calc
+- BZ#6572: ordered index Error in optimizer garbageCollector
+- BZ#6573: Sqlitelogictest crash on complex select query with case
+  statement
+- BZ#6574: server crashed could not find ordered index while creating
+  a table
+- BZ#6575: Sqlitelogictest crash on groupby query with coalesce call
+- BZ#6576: Sqlitelogictest aritmetic expressions with negative numbers
+  handling
+- BZ#6577: creating temp table kills performance of the original query
+- BZ#6578: One two-tuple insert gives different results than two single
+  inserts
+- BZ#6579: Sqlitelogic test infinite loop while compiling SQL query
+- BZ#6581: Join condition errors.
+- BZ#6583: Fixed size string concatenation with integer results in fixed
+  size string of size 0
+- BZ#6584: SELECT FROM REMOTE TABLE WHERE IS NOT NULL produces wrong
+  result
+- BZ#6585: Nested Merge tables cause an infinite loop in rel_optimizer
+- BZ#6587: Sqlitelogictest crash on complex case statement
+- BZ#6589: Sqlitelogictest crash on complex on complex expression
+- BZ#6594: Sqlitelogictest crash on complex case statement
+- BZ#6595: Remote decimal division triggers assertion / returns wrong
+  answer
+- BZ#6598: Python 3.4 not supported (due to usage of Py_DecodeLocale)
+- BZ#6600: Sqlitelogictest queries fail to execute
+- BZ#6601: "where is null" clause on remote table causes problem with
+  next query
+- BZ#6602: Sqlitelogictest wrong results in IN query
+- BZ#6603: Sqlitelogictest: Aggregation query with distinct clause
+  produces duplicated rows
+- BZ#6605: Sqlitelogictest set queries with wrong results
+
+* Thu May 17 2018 Martin van Dinther  
- 11.29.5-20180525
+- sql: Corrected the definition of view: sys.ids.
+
+* Tue Apr  3 2018 Sjoerd Mullender  - 11.29.5-20180525
+- buildtools: On Linux and Unix, try not to link to libraries multiple times: 
that
+  only causes the code (and worse, the variables in those libraries) to be
+  included multiple times.  On Windows, we do need to link to libraries
+  multiple times (once for each DLL we create if the DLL references
+  anything from the library) but that doesn't cause the linked library
+  to be loaded multiple times.
+
 * Tue Mar 27 2018 Sjoerd Mullender  - 11.29.3-20180327
 - Rebuilt.
 - BZ#3824: Created table not visible from ODBC
diff --git a/buildtools/ChangeLog-Archive b/buildtools/ChangeLog-Archive
--- a/buildtools/ChangeLog-Archive
+++ b/buildtools/ChangeLog-Archive
@@ -1,6 +1,14 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Tue Apr  3 2018 Sjoerd Mullender  - 11.29.5-20180525
+- On Linux and Unix, try not to link to libraries multiple times: that
+  only causes the code (and worse, the variables in those libraries) to be
+  included multiple times.  On Windows, we do need to link to libraries
+  multiple times (once for each DLL we create if the DLL references
+  anything from the library) but that doesn't cause the linked library
+  to be loaded multiple times.
+
 * Mon Feb 12 2018 Sjoerd Mullender  - 11.29.1-20180315
 - Added the .pdb files needed for debug symbols to the Windows installer
   f

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-05-25 Thread Panagiotis Koutsourakis
Changeset: 88a93ca0317e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=88a93ca0317e
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files.

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


MonetDB: default - Merge with Mar2018 branch

2018-05-25 Thread Panagiotis Koutsourakis
Changeset: 2f72cb9133d4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f72cb9133d4
Modified Files:
debian/fix-deb.sh
Branch: default
Log Message:

Merge with Mar2018 branch


diffs (12 lines):

diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -65,5 +65,8 @@ wheezy)
 trusty)
 # the trusty linker produces unresolved references to openSSL functions
 sed -i '/openssl_LIBS/s/WIN32?//' clients/mapilib/Makefile.ag
+lib=$(grep openssl_LIBS clients/mapilib/Makefile.am)
+lib="${lib%% *}"
+sed -i "s/\\\$($lib)/\$(openssl_LIBS)/g" clients/mapilib/Makefile.am 
clients/mapilib/Makefile.in
 ;;
 esac
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-05-24 Thread Sjoerd Mullender
Changeset: 0e73d0138089 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0e73d0138089
Modified Files:
debian/fix-deb.sh
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (11 lines):

diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -64,6 +64,6 @@ wheezy)
 ;;
 trusty)
 # the trusty linker produces unresolved references to openSSL functions
-sed -i '/openssl_LIBS/s/WIN32\?//' clients/mapilib/Makefile.ag
+sed -i '/openssl_LIBS/s/WIN32?//' clients/mapilib/Makefile.ag
 ;;
 esac
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-05-24 Thread Sjoerd Mullender
Changeset: 2d9061addec5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d9061addec5
Added Files:
sql/backends/monet5/UDF/capi/Tests/capi15.sql
sql/backends/monet5/UDF/capi/Tests/capi15.stable.err
sql/backends/monet5/UDF/capi/Tests/capi15.stable.out
sql/backends/monet5/UDF/capi/Tests/capi16.sql
sql/backends/monet5/UDF/capi/Tests/capi16.stable.err
sql/backends/monet5/UDF/capi/Tests/capi16.stable.out
sql/backends/monet5/UDF/capi/Tests/capi17.sql
sql/backends/monet5/UDF/capi/Tests/capi17.stable.err
sql/backends/monet5/UDF/capi/Tests/capi17.stable.out
sql/backends/monet5/UDF/capi/Tests/capi18.sql
sql/backends/monet5/UDF/capi/Tests/capi18.stable.err
sql/backends/monet5/UDF/capi/Tests/capi18.stable.out
Modified Files:
debian/fix-deb.sh
sql/backends/monet5/UDF/capi/Tests/All
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/capi/cheader.h
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1188 to 300 lines):

diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -35,7 +35,7 @@ 1)
 esac
 
 case $SUITE in
-wheezy | precise | trusty)
+wheezy | trusty)
 # fix control file because these systems don't have liblas and a
 # too old version of libgeos
 sed -i -e 's/, libgeos-dev[^,]*//;s/, liblas-c-dev[^,]*//' \
@@ -47,7 +47,7 @@ wheezy | precise | trusty)
 esac
 
 case $SUITE in
-wheezy | jessie | precise | trusty | wily)
+wheezy | jessie | trusty | wily)
 # Xenial Xerus (and presumably newer releases) uses php-cli,
 # all others still have php5-cli and don't have php*-sockets
 sed -i 's/php-cli/php5-cli/;s/, *php-sockets//' debian/control
@@ -55,11 +55,15 @@ wheezy | jessie | precise | trusty | wil
 esac
 
 case $SUITE in
-wheezy | precise)
+wheezy)
 # numpy is too old
 sed -i -e 's/, python-dev[^,]*//;s/, python-numpy[^,]*//' \
-e '/^Package:.*monetdb-python2/,/^$/d' debian/control
 sed -i '/pyintegration=yes/s/yes/no/' debian/rules
 rm debian/monetdb-python2.install
 ;;
+trusty)
+# the trusty linker produces unresolved references to openSSL functions
+sed -i '/openssl_LIBS/s/WIN32\?//' clients/mapilib/Makefile.ag
+;;
 esac
diff --git a/sql/backends/monet5/UDF/capi/Tests/All 
b/sql/backends/monet5/UDF/capi/Tests/All
--- a/sql/backends/monet5/UDF/capi/Tests/All
+++ b/sql/backends/monet5/UDF/capi/Tests/All
@@ -14,4 +14,6 @@ NOT_WIN32?capi11
 NOT_WIN32?capi12
 NOT_WIN32?capi13
 NOT_WIN32?capi14
-
+NOT_WIN32?capi15
+NOT_WIN32?capi16
+NOT_WIN32?capi17
diff --git a/sql/backends/monet5/UDF/capi/Tests/capi15.sql 
b/sql/backends/monet5/UDF/capi/Tests/capi15.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/UDF/capi/Tests/capi15.sql
@@ -0,0 +1,19 @@
+
+START TRANSACTION;
+
+CREATE FUNCTION capi16(i INTEGER, j STRING, k BLOB, l DATE, m TIMESTAMP, n 
TIME)
+RETURNS INTEGER
+LANGUAGE C {
+result->initialize(result, i.count);
+for(size_t it = 0; it < i.count; it++) {
+result->data[it] = i.data[it] * 2;
+}
+};
+
+CREATE TABLE capi16table(i INTEGER, j STRING, k BLOB, l DATE, m TIMESTAMP, n 
TIME);
+SELECT i, capi16(i, j, k, l, m, n) FROM capi16table;
+
+DROP TABLE capi16table;
+DROP FUNCTION capi16;
+
+ROLLBACK;
diff --git a/sql/backends/monet5/UDF/capi/Tests/capi15.stable.err 
b/sql/backends/monet5/UDF/capi/Tests/capi15.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/UDF/capi/Tests/capi15.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'capi15` in directory 'sql/backends/monet5/UDF/capi` itself:
+
+
+# 14:47:44 >  
+# 14:47:44 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32682" "--set" 
"mapi_usock=/var/tmp/mtest-72472/.s.monetdb.32682" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5_UDF_capi" 
"--set" "embedded_c=true"
+# 14:47:44 >  
+
+# builtin opt  gdk_dbpath = /Users/myth/opt/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 = 32682
+# cmdline opt  mapi_usock = /var/tmp/mtest-72472/.s.monetdb.32682
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5_UDF_capi
+# cmdline opt  embedded_c = true
+# cmdline opt  gdk_debug = 553648138
+
+# 14:47:44 >  
+# 14:47:44 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-72472" "--port=32682"
+# 14:47:44 >  
+
+
+# 14:47:45 >  
+# 14:47:45 >  "Done."
+# 14:47:45 

MonetDB: default - Merge with Mar2018 branch.

2018-05-24 Thread Sjoerd Mullender
Changeset: aafe85f05aa3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aafe85f05aa3
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-coalesce-error-message.Bug-6608.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-coalesce-error-message.Bug-6608.stable.out
Modified Files:
MonetDB.spec
buildtools/selinux/monetdb.te
gdk/gdk_aggr.c
sql/test/BugTracker-2018/Tests/All
sql/test/orderidx/Tests/simpletable.sql
sql/test/orderidx/Tests/simpletable.stable.out
sql/test/orderidx/Tests/simpletable.stable.out.32bit
sql/test/orderidx/Tests/smalltable.sql
sql/test/orderidx/Tests/smalltable.stable.out
sql/test/orderidx/Tests/smalltable.stable.out.32bit
sql/test/pg_regress/Tests/vacuum.sql
sql/test/pg_regress/Tests/vacuum.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1147 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -640,7 +640,6 @@ fi
 %exclude %{_libdir}/monetdb5/fits.mal
 %exclude %{_libdir}/monetdb5/autoload/*_fits.mal
 %exclude %{_libdir}/monetdb5/createdb/*_fits.sql
-%exclude %{_libdir}/monetdb5/lib_fits.so
 %endif
 %if %{?with_geos:1}%{!?with_geos:0}
 %exclude %{_libdir}/monetdb5/geom.mal
@@ -674,25 +673,16 @@ fi
 %endif
 %exclude %{_libdir}/monetdb5/autoload/??_sql*.mal
 %{_libdir}/monetdb5/autoload/*.mal
-%if %{?with_geos:1}%{!?with_geos:0}
-%exclude %{_libdir}/monetdb5/lib_geom.so
-%endif
-%if %{?with_lidar:1}%{!?with_lidar:0}
-%exclude %{_libdir}/monetdb5/lib_lidar.so
-%endif
-%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
-%exclude %{_libdir}/monetdb5/lib_pyapi.so
-%endif
-%if %{?with_rintegration:1}%{!?with_rintegration:0}
-%exclude %{_libdir}/monetdb5/lib_rapi.so
-%endif
 %if %{?with_samtools:1}%{!?with_samtools:0}
 %exclude %{_libdir}/monetdb5/bam.mal
 %exclude %{_libdir}/monetdb5/autoload/*_bam.mal
-%exclude %{_libdir}/monetdb5/lib_bam.so
 %endif
-%exclude %{_libdir}/monetdb5/lib_sql.so
-%{_libdir}/monetdb5/*.so
+%{_libdir}/monetdb5/lib_capi.so
+%{_libdir}/monetdb5/lib_generator.so
+%{_libdir}/monetdb5/lib_lsst.so
+%{_libdir}/monetdb5/lib_opt_sql_append.so
+%{_libdir}/monetdb5/lib_udf.so
+%{_libdir}/monetdb5/lib_vault.so
 %doc %{_mandir}/man1/mserver5.1.gz
 %dir %{_datadir}/doc/MonetDB
 %docdir %{_datadir}/doc/MonetDB
diff --git a/buildtools/selinux/monetdb.te b/buildtools/selinux/monetdb.te
--- a/buildtools/selinux/monetdb.te
+++ b/buildtools/selinux/monetdb.te
@@ -1,7 +1,24 @@
-policy_module(monetdb, 0.2)
+policy_module(monetdb, 0.3)
 # The above line declares that this file is a SELinux policy file. Its
 # name is monetdb, so the file should be saved as monetdb.te
 
+# Declare the system types and classes we're using.
+require {
+   type proc_net_t;
+   type tmp_t;
+   type var_t;
+   class dir { read };
+   class fd { use };
+   class fifo_file { getattr read write };
+   class file { entrypoint execute getattr manage_file_perms map open read 
};
+   class netlink_selinux_socket create_socket_perms;
+   class process { rlimitinh siginh signal transition };
+   class tcp_socket create_stream_socket_perms;
+   class udp_socket create_stream_socket_perms;
+   class unix_dgram_socket create_socket_perms;
+   class unix_stream_socket { connectto create_stream_socket_perms getopt 
read shutdown write };
+}
+
 # First, we declare the monetdbd_t domain, used for the "monetdbd"
 # process.  Because it is launched by systemd, we tell the policy that
 # monetdbd_exec_t (the context of monetdbd), when launched by systemd,
@@ -79,6 +96,7 @@ allow monetdbd_t self:udp_socket create_
 allow monetdbd_t self:unix_dgram_socket create_socket_perms;
 allow monetdbd_t self:unix_stream_socket { create_stream_socket_perms 
connectto };
 allow monetdbd_t self:netlink_selinux_socket create_socket_perms;
+allow monetdbd_t proc_net_t:file read;
 manage_dirs_pattern(monetdbd_t, tmp_t, tmp_t)
 manage_sock_files_pattern(monetdbd_t, tmp_t, tmp_t)
 manage_sock_files_pattern(monetdbd_t, mserver5_db_t, mserver5_db_t)
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -147,7 +147,7 @@ BATgroupaggrinit(BAT *b, BAT *g, BAT *e,
 /* -- */
 /* sum */
 
-static inline int
+static inline bool
 samesign(double x, double y)
 {
return (x >= 0) == (y >= 0);
@@ -182,13 +182,13 @@ static BUN
 dofsum(const void *restrict values, oid seqb, BUN start, BUN end,
void *restrict results, BUN ngrp, int tp1, int tp2,
const oid *restrict cand, const oid *candend, const oid *restrict gids,
-   oid min, oid max, int skip_nils, int 

MonetDB: default - Merge with Mar2018 branch.

2018-05-23 Thread Sjoerd Mullender
Changeset: 7172916901d9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7172916901d9
Added Files:
sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql
Modified Files:
gdk/gdk_select.c
sql/ChangeLog.Mar2018
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/21_dependency_views.sql
sql/server/rel_optimizer.c
sql/server/rel_psm.c
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/sql_parser.h
sql/server/sql_parser.y
sql/test/BugTracker-2014/Tests/temporary.Bug-3430.stable.err
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-not-in.Bug-6594.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-not-in.Bug-6594.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1685 to 300 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -439,8 +439,8 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
 
 /* argument list for type-specific core scan select function call */
 #define scanargs   \
-   b, s, bn, tl, th, li, hi, equi, anti, lval, hval, p, q, cnt, off, \
-   dst, candlist, maximum, use_imprints
+   b, s, bn, tl, th, li, hi, equi, anti, lval, hval, lnil, p, q,   \
+   cnt, off, dst, candlist, maximum, use_imprints
 
 #define PREVVALUEbte(x)((x) - 1)
 #define PREVVALUEsht(x)((x) - 1)
@@ -499,8 +499,8 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
 #define scanfunc(NAME, TYPE, CAND, END)
\
 static BUN \
 NAME##_##TYPE(BAT *b, BAT *s, BAT *bn, const TYPE *tl, const TYPE *th, \
- bool li, bool hi, bool equi, bool anti, bool lval, bool hval, 
\
- BUN r, BUN q, BUN cnt, lng off, oid *restrict dst,\
+ bool li, bool hi, bool equi, bool anti, bool lval, bool hval, \
+ bool lnil, BUN r, BUN q, BUN cnt, lng off, oid *restrict dst, \
  const oid *candlist, BUN maximum, bool use_imprints)  \
 {  \
TYPE vl = *tl;  \
@@ -540,12 +540,15 @@ NAME##_##TYPE(BAT *b, BAT *s, BAT *bn, c
END;\
if (equi) { \
assert(!use_imprints);  \
-   scanloop(NAME, CAND, v == vl);  \
+   if (lnil)   \
+   scanloop(NAME, CAND, is_##TYPE##_nil(v));   \
+   else\
+   scanloop(NAME, CAND, v == vl);  \
} else if (anti) {  \
if (b->tnonil) {\
choose(NAME, CAND, (v <= vl || v >= vh), TYPE); \
} else {\
-   choose(NAME, CAND, (v <= vl || v >= vh) && v != nil, 
TYPE); 

MonetDB: default - Merge with Mar2018 branch.

2018-05-16 Thread Sjoerd Mullender
Changeset: 147ce09f077f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=147ce09f077f
Modified Files:
clients/mapiclient/mclient.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (12 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1976,7 +1976,7 @@ format_result(Mapi mid, MapiHdl hdl, boo
} while (!mnstr_errnr(toConsole) && (rc = mapi_next_result(hdl)) == 1);
/*
 * in case we called timerHuman() in the loop above with "total == 
false",
-* call is again with "total == true" to get the total wall-clock time
+* call it again with "total == true" to get the total wall-clock time
 * in case "singleinstr == false".
 */
if (timerHumanCalled)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-05-15 Thread Sjoerd Mullender
Changeset: 046b4c1a659e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=046b4c1a659e
Added Files:
sql/test/Dump/Tests/clean-again.reqtests
sql/test/Dump/Tests/clean-again.sql.src
sql/test/Dump/Tests/clean-again.stable.err
sql/test/Dump/Tests/clean-again.stable.out
sql/test/Dump/Tests/dump-again.SQL.py
sql/test/Dump/Tests/dump-again.reqtests
sql/test/Dump/Tests/dump-again.stable.err
sql/test/Dump/Tests/dump-again.stable.out
sql/test/Dump/Tests/reload-again.SQL.py
sql/test/Dump/Tests/reload-again.reqtests
sql/test/Dump/Tests/reload-again.stable.err
sql/test/Dump/Tests/reload-again.stable.out
sql/test/Dump/Tests/test-again.reqtests
sql/test/Dump/Tests/test-again.sql.src
sql/test/Dump/Tests/test-again.stable.err.src
sql/test/Dump/Tests/test-again.stable.out.src
Modified Files:
clients/mapiclient/dump.c
clients/odbc/driver/Makefile.ag
clients/odbc/driver/SQLExecute.c
configure.ag
sql/test/Dump/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 565 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1268,7 +1268,36 @@ dump_table_data(Mapi mid, const char *sc
s = mapi_fetch_field(hdl, i);
if (s == NULL)
mnstr_printf(toConsole, "NULL");
-   else if (string[i]) {
+   else if (useInserts) {
+   const char *tp = mapi_get_type(hdl, i);
+   if (strcmp(tp, "sec_interval") == 0) {
+   const char *p = strchr(s, '.');
+   if (p == NULL)
+   p = s + strlen(s);
+   mnstr_printf(toConsole, "INTERVAL 
'%.*s' SECOND", (int) (p - s), s);
+   } else if (strcmp(tp, "month_interval") == 0)
+   mnstr_printf(toConsole, "INTERVAL '%s' 
MONTH", s);
+   else if (strcmp(tp, "timestamptz") == 0)
+   mnstr_printf(toConsole, "TIMESTAMP WITH 
TIME ZONE '%s'", s);
+   else if (strcmp(tp, "timestamp") == 0)
+   mnstr_printf(toConsole, "TIMESTAMP 
'%s'", s);
+   else if (strcmp(tp, "timetz") == 0)
+   mnstr_printf(toConsole, "TIME WITH TIME 
ZONE '%s'", s);
+   else if (strcmp(tp, "time") == 0)
+   mnstr_printf(toConsole, "TIME '%s'", s);
+   else if (strcmp(tp, "date") == 0)
+   mnstr_printf(toConsole, "DATE '%s'", s);
+   else if (strcmp(tp, "blob") == 0)
+   mnstr_printf(toConsole, "BINARY LARGE 
OBJECT '%s'", s);
+   else if (strcmp(tp, "inet") == 0 ||
+strcmp(tp, "json") == 0 ||
+strcmp(tp, "url") == 0 ||
+strcmp(tp, "uuid") == 0 ||
+string[i])
+   quoted_print(toConsole, s, true);
+   else
+   mnstr_printf(toConsole, "%s", s);
+   } else if (string[i]) {
/* write double or single-quoted
   string with certain characters
   escaped */
diff --git a/clients/odbc/driver/Makefile.ag b/clients/odbc/driver/Makefile.ag
--- a/clients/odbc/driver/Makefile.ag
+++ b/clients/odbc/driver/Makefile.ag
@@ -107,7 +107,7 @@ lib_MonetODBC = {
SQLTransact.c \
driver.rc \
ODBC.syms
-   LIBS = ../../mapilib/libmapi $(LTLIBICONV) $(ODBCINST_LIBS) 
$(SOCKET_LIBS)
+   LIBS = ../../mapilib/libmapi ../../../common/stream/libstream 
$(LTLIBICONV) $(ODBCINST_LIBS) $(SOCKET_LIBS) $(openssl_LIBS)
 }
 
 EXTRA_DIST = Copyright
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -43,7 +43,9 @@ static struct msql_types {
{"decimal", SQL_DECIMAL},
{"double", SQL_DOUBLE},
{"hugeint", SQL_HUGEINT},
+   /* {"inet", SQL_WCHAR}, */
{"int", SQL_INTEGER},
+   /* {"json", SQL_WCHAR}, */
{"month_interval", SQL_INTERVAL_MONTH},
{"oid", SQL_BIGINT},
{"real", SQL_REAL},
@@ -55,7 +57,7 @@ static struct ms

MonetDB: default - Merge with Mar2018 branch.

2018-05-14 Thread Sjoerd Mullender
Changeset: 59b752c4a0d0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=59b752c4a0d0
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/msqldump.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 508 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -121,15 +121,15 @@ get_schema(Mapi mid)
 }
 
 /* return TRUE if the HUGEINT type exists */
-static int
+static bool
 has_hugeint(Mapi mid)
 {
MapiHdl hdl;
-   int ret;
+   bool ret;
static int hashge = -1;
 
if (hashge >= 0)
-   return hashge;
+   return (bool) hashge;
 
if ((hdl = mapi_query(mid,
  "SELECT id "
@@ -145,7 +145,7 @@ has_hugeint(Mapi mid)
if (mapi_error(mid))
goto bailout;
mapi_close_handle(hdl);
-   hashge = ret;
+   hashge = (int) ret;
return ret;
 
   bailout:
@@ -383,8 +383,8 @@ static int dump_column_definition(
const char *schema,
const char *tname,
const char *tid,
-   int foreign,
-   int hashge);
+   bool foreign,
+   bool hashge);
 
 static const char *geomsubtypes[] = {
NULL,   /* 0 */
@@ -399,7 +399,7 @@ static const char *geomsubtypes[] = {
 };
 
 static int
-dump_type(Mapi mid, stream *toConsole, const char *c_type, const char 
*c_type_digits, const char *c_type_scale, int hashge)
+dump_type(Mapi mid, stream *toConsole, const char *c_type, const char 
*c_type_digits, const char *c_type_scale, bool hashge)
 {
int space = 0;
 
@@ -533,7 +533,7 @@ dump_type(Mapi mid, stream *toConsole, c
 }
 
 static int
-dump_column_definition(Mapi mid, stream *toConsole, const char *schema, const 
char *tname, const char *tid, int foreign, int hashge)
+dump_column_definition(Mapi mid, stream *toConsole, const char *schema, const 
char *tname, const char *tid, bool foreign, bool hashge)
 {
MapiHdl hdl = NULL;
char *query;
@@ -782,7 +782,7 @@ describe_table(Mapi mid, const char *sch
int type = 0;
size_t maxquerylen;
char *sname = NULL;
-   int hashge;
+   bool hashge;
 
if (schema == NULL) {
if ((sname = strchr(tname, '.')) != NULL) {
@@ -1338,102 +1338,15 @@ dump_table(Mapi mid, const char *schema,
 }
 
 static int
-dump_function_comment(Mapi mid, stream *toConsole, const char *id)
-{
-   int len = 5120;
-   char *query = malloc(len);
-   MapiHdl hdl = NULL;
-   int hashge;
-
-   if (!query)
-   return 1;
-
-   snprintf(query, len,
-   "%s "
-   "SELECT coalesce(function_type_keyword, '') AS category, "
-  "s.name AS schema, "
-  "CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number 
ASC) WHEN 1 THEN f.name ELSE NULL END AS name, "
-  "p.type, "
-  "p.type_digits, "
-  "p.type_scale, "
-  "CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number 
DESC) WHEN 1 THEN c.remark ELSE NULL END AS remark, "
-  "ROW_NUMBER() OVER (ORDER BY f.id, p.number) AS line "
-   "FROM sys.functions f "
-"JOIN comments c ON f.id = c.id "
-"JOIN sys.schemas s ON f.schema_id = s.id "
-"LEFT OUTER JOIN sys.function_types ft ON f.type = 
ft.function_type_id "
-"LEFT OUTER JOIN sys.args p ON f.id = p.func_id AND 
p.inout = 1 "
-   "WHERE f.id = %s "
-   "ORDER BY line",
-   get_compat_clause(mid),
-   id);
-
-   hashge = has_hugeint(mid);
-   hdl = mapi_query(mid, query);
-   if (hdl == NULL || mapi_error(mid))
-   goto bailout;
-   while (!mnstr_errnr(toConsole) && mapi_fetch_row(hdl) != 0) {
-   int i = 0;
-   char *category = mapi_fetch_field(hdl, i++);
-   char *sname = mapi_fetch_field(hdl, i++);
-   char *name = mapi_fetch_field(hdl, i++);
-   char *type = mapi_fetch_field(hdl, i++);
-   char *type_digits = mapi_fetch_field(hdl, i++);
-   char *type_scale = mapi_fetch_field(hdl, i++);
-   char *remark = mapi_fetch_field(hdl, i++);
-
-   if (name) {
-   mnstr_printf(toConsole, "COMMENT ON %s ", category);
-   quoted_print(toConsole, sname, false);
-   mnstr_printf(toConsole, ".");
-   quoted_print(toConsole, name, false);
-   mnstr_printf(toConsole, "(");
-   } else {
-   mnstr_printf(toConsole, ", ");
-   }
-
-   if (type) {
-   dump_type(NULL, toConsole, type, type_digits, 
t

MonetDB: default - Merge with Mar2018 branch.

2018-05-14 Thread Sjoerd Mullender
Changeset: 669614968315 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=669614968315
Modified Files:
clients/mapiclient/dump.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 465 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -256,7 +256,7 @@ dump_foreign_keys(Mapi mid, const char *
  "pkt.schema_id = ps.id AND "
  "fkt.schema_id = fs.id AND "
  "fkt.system = FALSE "
-   "ORDER BY fs.name,fkt.name, "
+   "ORDER BY fs.name, fkt.name, "
  "fkk.name, nr";
}
hdl = mapi_query(mid, query);
@@ -804,7 +804,7 @@ describe_table(Mapi mid, const char *sch
 
query = malloc(maxquerylen);
snprintf(query, maxquerylen,
-"%s\n"
+"%s "
 "SELECT t.name, t.query, t.type, c.remark "
 "FROM sys.schemas s, sys._tables t LEFT OUTER JOIN comments c 
ON t.id = c.id "
 "WHERE s.name = '%s' AND "
@@ -949,8 +949,12 @@ describe_table(Mapi mid, const char *sch
if (cnt)
mnstr_printf(toConsole, ");\n");
snprintf(query, maxquerylen,
-   "%s\n"
-"SELECT i.name, c.remark FROM sys.idxs i, comments c 
WHERE i.id = c.id AND i.table_id = (SELECT id FROM sys._tables WHERE schema_id 
= (select id FROM sys.schemas WHERE name = '%s') AND name = '%s') ORDER BY 
i.name",
+   "%s "
+"SELECT i.name, c.remark "
+"FROM sys.idxs i, comments c "
+"WHERE i.id = c.id "
+  "AND i.table_id = (SELECT id FROM sys._tables WHERE 
schema_id = (select id FROM sys.schemas WHERE name = '%s') AND name = '%s') "
+"ORDER BY i.name",
 get_compat_clause(mid),
 schema, tname);
if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
@@ -965,10 +969,14 @@ describe_table(Mapi mid, const char *sch
}
 
snprintf(query, maxquerylen,
-   "%s\n"
-   "SELECT col.name, com.remark FROM sys._columns col, 
comments com WHERE col.id = com.id AND col.table_id = (SELECT id FROM 
sys._tables WHERE schema_id = (SELECT id FROM sys.schemas WHERE name = '%s') 
AND name = '%s') ORDER BY number",
-   get_compat_clause(mid),
-   schema, tname);
+   "%s "
+"SELECT col.name, com.remark "
+"FROM sys._columns col, comments com "
+"WHERE col.id = com.id "
+  "AND col.table_id = (SELECT id FROM sys._tables WHERE 
schema_id = (SELECT id FROM sys.schemas WHERE name = '%s') AND name = '%s') "
+"ORDER BY number",
+get_compat_clause(mid),
+schema, tname);
if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
goto bailout;
while (mapi_fetch_row(hdl) != 0) {
@@ -1037,21 +1045,21 @@ describe_sequence(Mapi mid, const char *
 
query = malloc(maxquerylen);
snprintf(query, maxquerylen,
-   "%s\n"
+   "%s "
"SELECT s.name, "
-"seq.name, "
-"get_value_for(s.name,seq.name), "
-"seq.\"minvalue\", "
-"seq.\"maxvalue\", "
-"seq.\"increment\", "
-"seq.\"cycle\", "
-"rem.\"remark\" "
+  "seq.name, "
+  "get_value_for(s.name, seq.name), "
+  "seq.\"minvalue\", "
+  "seq.\"maxvalue\", "
+  "seq.\"increment\", "
+  "seq.\"cycle\", "
+  "rem.\"remark\" "
"FROM sys.sequences seq LEFT OUTER JOIN comments rem ON seq.id 
= rem.id, "
 "sys.schemas s "
"WHERE s.id = seq.schema_id AND "
  "s.name = '%s' AND "
  "seq.name = '%s' "
-   "ORDER BY s.name,seq.name",
+   "ORDER BY s.name, seq.name",
get_compat_clause(mid),
schema, tname);
 
@@ -1118,7 +1126,7 @@ describe_schema(Mapi mid, const char *sn
char schemas[5120];
 
snprintf(schemas, sizeof(schemas),
-   "%s\n"
+   "%s "
"SELECT s.name, a.name, c.remark "
"FROM sys.auths a, "
 "sys.schemas s LEFT OUTER JOIN comments c ON s.id = c.id "
@@ -1163,8 +1171,9 @@ dump_table_data(Mapi mid, const char *sc
bool useInserts)
 {
int 

MonetDB: default - Merge with Mar2018 branch.

2018-05-09 Thread Sjoerd Mullender
Changeset: c906d3f37a64 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c906d3f37a64
Added Files:
sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.sql
sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.stable.err
sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.stable.out
Modified Files:
configure.ag
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (216 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2972,14 +2972,6 @@ typedef __uint128_t uhge;
 @%:@ define __declspec(x)
 @%:@endif
 
-/* work around problem compiling batxml.c with clang
- * clang 3.5.0 claims to be GnuC 4.3, but doesn't accept
- * __attribute__((alloc_size(N))), as libml2 2.9.2 expects
- */
-@%:@if defined(__GNUC__) && defined(__clang__)
-@%:@define LIBXML_ATTR_ALLOC_SIZE(x)
-@%:@endif
-
 /* These are required to make MonetDB's source tree CRAN-compliant */
 @%:@ifdef HAVE_EMBEDDED_R
 @%:@include "tools/embedded/undef.h"
diff --git a/sql/test/BugTracker-2018/Tests/All 
b/sql/test/BugTracker-2018/Tests/All
--- a/sql/test/BugTracker-2018/Tests/All
+++ b/sql/test/BugTracker-2018/Tests/All
@@ -59,3 +59,4 @@ sqlitelogictest-count-coalesce-nullif.Bu
 sqlitelogictest-case-not-in-count.Bug-6587
 sqlitelogictest-complex-expression.Bug-6589
 sqlitelogictest-complex-case-not-in.Bug-6594
+multiple-count.Bug-6599
diff --git a/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.sql 
b/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.sql
@@ -0,0 +1,24 @@
+start transaction;
+
+CREATE TABLE "sys"."unitTestDontDelete" (
+"A"VARCHAR(255),
+"B"BIGINT,
+"C"DOUBLE,
+"D"TIMESTAMP
+);
+INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 
11:10:10.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 
12:11:11.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 
13:12:12.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 
14:13:13.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 
15:14:14.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 
16:15:15.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 
17:16:16.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 
18:17:17.00');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 
19:18:18.00');
+
+select count(*) as "c3_recordcount" from "unitTestDontDelete" as "t2" where 
"t2"."A" = 'Nope';
+
+select count(*) as "c3_recordcount", count(distinct "t2"."B") as 
"c7_b__unique_count_"  from "unitTestDontDelete" as "t2" where "t2"."A" = 
'Nope';
+
+rollback;
diff --git a/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.stable.err 
b/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/multiple-count.Bug-6599.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'multiple-count.Bug-6599` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 15:27:37 >  
+# 15:27:37 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32594" "--set" 
"mapi_usock=/var/tmp/mtest-4889/.s.monetdb.32594" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_r=yes" "--set" "embedded_py=true" "--set" "embedded_c=true"
+# 15:27:37 >  
+
+# builtin opt  gdk_dbpath = /ufs/sjoerd/@Monet-stable/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 = 32594
+# cmdline opt  mapi_usock = /var/tmp/mtest-4889/.s.monetdb.32594
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2018
+# cmdline opt  embedded_r = yes
+# cmdline opt  embedded_py = true
+# cmdline opt  embedded_c = true
+# cmdline opt  gdk_debug = 553648138
+
+# 15:27:37 >  
+# 15:27:37 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-4889" "--port=32594"
+# 15:27:37 >  
+
+
+# 15:27:38 >  
+# 15:27:38 >  "Done."
+# 15:27:38 >  
+
diff --git a/sql/test/BugTracker-2018/Tests/

MonetDB: default - Merge with Mar2018 branch.

2018-05-09 Thread Sjoerd Mullender
Changeset: 8b90f7e2c4b7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b90f7e2c4b7
Added Files:
sql/test/Tests/copy-from-compressed.csv.bz2
sql/test/Tests/copy-from-compressed.csv.gz
sql/test/Tests/copy-from-compressed.csv.raw
sql/test/Tests/copy-from-compressed.csv.xz
sql/test/Tests/copy-from-compressed.sql.in
sql/test/Tests/copy-from-compressed.stable.err
sql/test/Tests/copy-from-compressed.stable.out
Modified Files:
clients/mapiclient/dump.c
common/stream/stream.c
configure.ag
sql/test/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 908 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1117,7 +1117,7 @@ describe_schema(Mapi mid, const char *sn
MapiHdl hdl = NULL;
char schemas[5120];
 
-   snprintf(schemas, 5120,
+   snprintf(schemas, sizeof(schemas),
"%s\n"
"SELECT s.name, a.name, c.remark "
"FROM sys.auths a, "
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -1630,7 +1630,18 @@ open_xzstream(const char *restrict filen
strncmp(buf, UTF8BOM, UTF8BOMLENGTH) == 0) {
s->isutf8 = 1;
} else {
-   rewind(xz->fp);
+   FILE *fp = xz->fp;
+   lzma_ret ret;
+   lzma_end(&xz->strm);
+   ret = lzma_stream_decoder(&xz->strm, UINT64_MAX, 
LZMA_CONCATENATED);
+   if (ret != LZMA_OK) {
+   destroy(s);
+   free(xz);
+   fclose(fp);
+   return NULL;
+   }
+   rewind(fp);
+   xz->fp = fp;
}
}
return s;
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -87,7 +87,7 @@ AS_VAR_IF([PKG_CONFIG], [],
 # need to be escapes with an extra \.  Configure does not support \'s
 # in path names, so there is no need to do anything special here
 # except set the variables.  The command to set them in case we do
-# need to escape the \'s is Qvar=`echo "$var" | sed 's///g'`
+# need to escape the \'s is Qvar=`AS_ECHO(["$var"]) | sed 's///g'`
 BUILD=[`pwd`]
 AC_SUBST([BUILD])
 
@@ -107,12 +107,12 @@ AS_VAR_IF([prefix], [NONE],
[Qprefix="${ac_default_prefix}"].
[Qprefix="${prefix}"])
 
-Qprefix=`echo "$Qprefix" | sed 's///g'`
+Qprefix=`AS_ECHO(["$Qprefix"]) | sed 's///g'`
 AC_SUBST([Qprefix])
 # exec_prefix is created very late, so let make do the expansion
 AS_VAR_IF([exec_prefix], [NONE],
[Qexec_prefix='${prefix}'],
-   [Qexec_prefix=`echo "$exec_prefix" | sed 's///g'`])
+   [Qexec_prefix=`AS_ECHO(["$exec_prefix"]) | sed 's///g'`])
 AC_SUBST([Qexec_prefix])
 
 # small hack to get icc -no-gcc, done here because AC_PROG_CC shouldn't
@@ -460,7 +460,7 @@ AS_CASE([$CC_version],
[*'Sun Ceres C '*|*'Sun C '*], [
# developer/sunstudioexpress and
# developer/sunstudio12u1 respectively
-   CC_ver="suncc-`echo "$CC_version" | sed -n 's/.*Sun 
Ceres C \(.*\) SunOS.*/\1/p;s/.*Sun C \(.*\) SunOS.*/\1/p'`"
+   CC_ver="suncc-`AS_ECHO(["$CC_version"]) | sed -n 
's/.*Sun Ceres C \(.*\) SunOS.*/\1/p;s/.*Sun C \(.*\) SunOS.*/\1/p'`"
CC_version="$CC_V"],
[AC_MSG_WARN([compiler not recognized:
 `$CC --version` says
@@ -499,7 +499,7 @@ AS_CASE([$host_os],
AS_IF([test -s /etc/os-release], [
# this is the new way of getting release 
information
# works for Fedora >= 17, Ubuntu >= 12.04 
(Precise Pangolin)
-   LINUX_DIST=`source /etc/os-release; echo 
${ID}:${VERSION_ID}`],
+   LINUX_DIST=`source /etc/os-release; 
AS_ECHO(["${ID}:${VERSION_ID}"])`],
[test -s /etc/fedora-release ], [
LINUX_DIST=`cat /etc/fedora-release | head -n1 \
| sed 's|^.*\(Fedora\).* release 
\([[0-9]][[^ \n]]*\)\( .*\)*$|\1:\2|'`],
@@ -529,7 +529,7 @@ AS_CASE([$host_os],
[test -s /etc/debian_version ], [
LINUX_DIST=Debian:`cat /etc/debian_version | 
head -n1`],
[LINUX_DIST=`uname -s`:`uname -r | sed 
's|^\([[0-9\.]]*\)\([[^0-9\.]].*\)$|\1|'`])
-   LINUX_DIST=`echo "$LINUX_DIST" | sed 's|:||'`
+   LINUX_DIST=`AS_ECHO(["$

MonetDB: default - Merge with Mar2018 branch.

2018-05-08 Thread Sjoerd Mullender
Changeset: 32f5ae566d8a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32f5ae566d8a
Added Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.reqtests
sql/test/emptydb-upgrade-chain/Tests/upgrade.reqtests
sql/test/emptydb-upgrade-hge/Tests/upgrade.reqtests
sql/test/emptydb-upgrade/Tests/upgrade.reqtests
Removed Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
Modified Files:
clients/mapiclient/dump.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/21_dependency_functions.sql
sql/server/sql_mvc.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 969 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -2416,13 +2416,13 @@ get_with_comments_as_clause(Mapi mid)
", function_types AS (\n"
"   SELECT function_type_id, function_type_name, 
function_type_keyword\n"
"   FROM sys.function_types, (VALUES\n"
-   "   (1, \'FUNCTION\'), \n"
-   "   (2, \'PROCEDURE\'),\n"
-   "   (3, \'AGGREGATE\'),\n"
-   "   (4, \'FILTER FUNCTION\'),\n"
-   "   (5, \'FUNCTION\'), \n"
-   "   (6, \'FUNCTION\'), \n"
-   "   (7, \'LOADER\')) AS (id, 
function_type_keyword)\n"
+   "   (1, 'FUNCTION'), \n"
+   "   (2, 'PROCEDURE'),\n"
+   "   (3, 'AGGREGATE'),\n"
+   "   (4, 'FILTER FUNCTION'),\n"
+   "   (5, 'FUNCTION'), \n"
+   "   (6, 'FUNCTION'), \n"
+   "   (7, 'LOADER')) AS (id, function_type_keyword)\n"
"   WHERE id = function_type_id\n"
")\n"
", function_languages AS (\n"
diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -1502,6 +1502,34 @@ sql_update_mar2018_samtools(Client c, mv
 #endif /* HAVE_SAMTOOLS */
 
 static str
+sql_update_mar2018_sp1(Client c, mvc *sql)
+{
+   size_t bufsize = 2048, pos = 0;
+   char *buf = GDKmalloc(bufsize), *err = NULL;
+   char *schema = stack_get_string(sql, "current_schema");
+
+   if (buf == NULL)
+   throw(SQL, "sql_update_dec2016_sp3", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   pos += snprintf(buf + pos, bufsize - pos,
+   "set schema \"sys\";\n"
+   "drop function 
sys.dependencies_functions_os_triggers();\n"
+   "CREATE FUNCTION dependencies_functions_on_triggers()\n"
+   "RETURNS TABLE (sch varchar(100), usr varchar(100), 
dep_type varchar(32))\n"
+   "RETURN TABLE (SELECT f.name, tri.name, 'DEP_TRIGGER' 
from functions as f, triggers as tri, dependencies as dep where dep.id = f.id 
AND dep.depend_id =tri.id AND dep.depend_type = 8);\n"
+   "insert into sys.systemfunctions (select id from 
sys.functions where name in ('dependencies_functions_on_triggers') and 
schema_id = (select id from sys.schemas where name = 'sys') and id not in 
(select function_id from sys.systemfunctions));\n"
+   "delete from systemfunctions where function_id not in 
(select id from functions);\n");
+   if (schema)
+   pos += snp

MonetDB: default - Merge with Mar2018 branch.

2018-04-18 Thread Sjoerd Mullender
Changeset: f7b48e986b08 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f7b48e986b08
Modified Files:
NT/mkodbcwxs.py
NT/mksqlwxs.py
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (24 lines):

diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -75,7 +75,7 @@ def main():
r'lib\libMonetODBC.dll', r'lib\libMonetODBC.pdb',
r'lib\libMonetODBCs.dll', r'lib\libMonetODBCs.pdb',
r'lib\libstream.dll', r'lib\libstream.pdb',
-   r'%s\bin\iconv.dll' % makedefs['LIBICONV'],
+   r'%s\bin\iconv-2.dll' % makedefs['LIBICONV'],
r'%s\bin\libbz2.dll' % makedefs['LIBBZIP2'],
r'%s\bin\libcrypto-1_1%s.dll' % (makedefs['LIBOPENSSL'], 
libcrypto),
r'%s\bin\zlib1.dll' % makedefs['LIBZLIB']])
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -86,7 +86,7 @@ def main():
r'lib\libmapi.dll', r'lib\libmapi.pdb',
r'lib\libmonetdb5.dll', r'lib\libmonetdb5.pdb',
r'lib\libstream.dll', r'lib\libstream.pdb',
-   r'%s\bin\iconv.dll' % makedefs['LIBICONV'],
+   r'%s\bin\iconv-2.dll' % makedefs['LIBICONV'],
r'%s\bin\libbz2.dll' % makedefs['LIBBZIP2'],
r'%s\bin\libcrypto-1_1%s.dll' % (makedefs['LIBOPENSSL'], 
libcrypto),
r'%s\bin\libxml2.dll' % makedefs['LIBXML2'],
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-04-18 Thread Sjoerd Mullender
Changeset: 9aa8cb614c9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9aa8cb614c9a
Modified Files:
NT/mksqlwxs.py
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (12 lines):

diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -126,7 +126,7 @@ def main():
r'lib\libmapi.lib',
r'lib\libmonetdb5.lib',
r'lib\libstream.lib',
-   r'%s\lib\iconv.lib' % makedefs['LIBICONV'],
+   r'%s\lib\iconv.dll.lib' % makedefs['LIBICONV'],
r'%s\lib\libbz2.lib' % makedefs['LIBBZIP2'],
r'%s\lib\libcrypto.lib' % makedefs['LIBOPENSSL'],
r'%s\lib\libxml2.lib' % makedefs['LIBXML2'],
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-04-17 Thread Sjoerd Mullender
Changeset: 2087723d7c66 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2087723d7c66
Modified Files:
NT/mkodbcwxs.py
NT/mksqlwxs.py
NT/monetdb_config.h.in
NT/rules.msc
buildtools/doc/windowsbuild.rst
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 576 to 300 lines):

diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -34,9 +34,11 @@ def main():
 if makedefs['bits'] == '64':
 folder = r'ProgramFiles64Folder'
 arch = 'x64'
+libcrypto = '-x64'
 else:
 folder = r'ProgramFilesFolder'
 arch = 'x86'
+libcrypto = ''
 vs = os.getenv('vs')# inherited from TestTools\common.bat
 features = []
 print(r'')
@@ -75,8 +77,7 @@ def main():
r'lib\libstream.dll', r'lib\libstream.pdb',
r'%s\bin\iconv.dll' % makedefs['LIBICONV'],
r'%s\bin\libbz2.dll' % makedefs['LIBBZIP2'],
-   r'%s\bin\libeay32.dll' % makedefs['LIBOPENSSL'],
-   r'%s\bin\ssleay32.dll' % makedefs['LIBOPENSSL'],
+   r'%s\bin\libcrypto-1_1%s.dll' % (makedefs['LIBOPENSSL'], 
libcrypto),
r'%s\bin\zlib1.dll' % makedefs['LIBZLIB']])
 print(r'')
 id = comp(features, id, 12,
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -34,9 +34,11 @@ def main():
 if makedefs['bits'] == '64':
 folder = r'ProgramFiles64Folder'
 arch = 'x64'
+libcrypto = '-x64'
 else:
 folder = r'ProgramFilesFolder'
 arch = 'x86'
+libcrypto = ''
 vs = os.getenv('vs')# inherited from TestTools\common.bat
 features = []
 print(r'')
@@ -86,10 +88,9 @@ def main():
r'lib\libstream.dll', r'lib\libstream.pdb',
r'%s\bin\iconv.dll' % makedefs['LIBICONV'],
r'%s\bin\libbz2.dll' % makedefs['LIBBZIP2'],
-   r'%s\bin\libeay32.dll' % makedefs['LIBOPENSSL'],
+   r'%s\bin\libcrypto-1_1%s.dll' % (makedefs['LIBOPENSSL'], 
libcrypto),
r'%s\bin\libxml2.dll' % makedefs['LIBXML2'],
r'%s\bin\pcre.dll' % makedefs['LIBPCRE'],
-   r'%s\bin\ssleay32.dll' % makedefs['LIBOPENSSL'],
r'%s\bin\zlib1.dll' % makedefs['LIBZLIB']])
 print(r'')
 print(r'')
@@ -127,10 +128,9 @@ def main():
r'lib\libstream.lib',
r'%s\lib\iconv.lib' % makedefs['LIBICONV'],
r'%s\lib\libbz2.lib' % makedefs['LIBBZIP2'],
-   r'%s\lib\libeay32.lib' % makedefs['LIBOPENSSL'],
+   r'%s\lib\libcrypto.lib' % makedefs['LIBOPENSSL'],
r'%s\lib\libxml2.lib' % makedefs['LIBXML2'],
r'%s\lib\pcre.lib' % makedefs['LIBPCRE'],
-   r'%s\lib\ssleay32.lib' % makedefs['LIBOPENSSL'],
r'%s\lib\zdll.lib' % makedefs['LIBZLIB']])
 print(r'')
 print(r'')
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -600,7 +600,7 @@
 #endif
 
 /* Define as const if the declaration of iconv() needs const. */
-#define ICONV_CONST const
+#define ICONV_CONST /* const */
 
 /* Define as SQLLEN * or SQLPOINTER depending on the include file */
 #ifdef _WIN64
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -99,9 +99,9 @@ pcre_CFLAGS = -DHAVE_LIBPCRE "-I$(LIBPCR
 !IFDEF HAVE_OPENSSL
 # This is the location of the OpenSSL library
 !IFNDEF LIBOPENSSL
-LIBOPENSSL = C:\openssl-0.9.8k.win$(bits)
+LIBOPENSSL = C:\openssl-1.1.0g.win$(bits)
 !ENDIF
-openssl_LIBS = "$(LIBOPENSSL)\lib\ssleay32.lib" 
"$(LIBOPENSSL)\lib\libeay32.lib"
+openssl_LIBS = "$(LIBOPENSSL)\lib\libcrypto.lib"
 openssl_CFLAGS = -DHAVE_OPENSSL "-I$(LIBOPENSSL)\include"
 !ENDIF
 
@@ -110,7 +110,7 @@ openssl_CFLAGS = -DHAVE_OPENSSL "-I$(LIB
 !IFNDEF LIBICONV
 LIBICONV = C:\iconv-1.9.2.win$(bits)
 !ENDIF
-LTLIBICONV = "$(LIBICONV)\lib\iconv.lib"
+LTLIBICONV = "$(LIBICONV)\lib\iconv.dll.lib"
 ICONV_CFLAGS = -DHAVE_ICONV "-I$(LIBICONV)\include"
 !ENDIF
 
diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -18,7 +18,7 @@ architecture, but there are notes throug
 on a 64-bit architecture which is indicated with Windows64.  We have
 successfully built on Windows XP, Windows Server, and Windows 7.
 
-.. _MonetDB: http://dev.monetdb.org/hg/MonetDB/
+.. _MonetDB: https://dev.monetdb.org/hg/MonetDB/
 
 __ MonetDB_
 
@@ -132,7 +132,7 @@ using the command
 
 ::
 
- hg clone http://dev.monetdb.org/hg/MonetDB/
+ hg clone https://dev.monetdb.org/hg/MonetDB/
 
 This will create a folder ``MonetDB`` that contains everything.
 
@@ -154,25 +154,23 @@ Compiler
 
 The suite can be compiled using on

MonetDB: default - Merge with Mar2018 branch.

2018-04-16 Thread Sjoerd Mullender
Changeset: 2704de9856ab for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2704de9856ab
Added Files:

sql/test/BugTracker-2018/Tests/multiple-insertinto-table-Bug-6578.stable.err

sql/test/BugTracker-2018/Tests/multiple-insertinto-table-Bug-6578.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-not-between-wrong.Bug-6569.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-not-between-wrong.Bug-6569.stable.out
Modified Files:
gdk/gdk_batop.c
gdk/gdk_select.c
monetdb5/modules/kernel/Tests/select.malC
monetdb5/modules/kernel/Tests/select.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1736 to 300 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -531,9 +531,6 @@ BATappend(BAT *b, BAT *n, BAT *s, bit fo
}
}
 
-   if (BATcount(b) == 0)
-   BAThseqbase(b, s ? s->hseqbase : n->hseqbase);
-
if (b->tunique) {
/* if b has the unique bit set, only insert values
 * from n that don't already occur in b, and make sure
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -28,7 +28,7 @@
A = (oid *) Tloc((B), 0);   \
}   \
A[(I)] = (V);   \
-   } while (0)
+   } while (false)
 
 BAT *
 virtualize(BAT *bn)
@@ -38,13 +38,13 @@ virtualize(BAT *bn)
   (((bn->ttype == TYPE_void && !is_oid_nil(bn->tseqbase)) ||
 bn->ttype == TYPE_oid) &&
bn->tkey && bn->tsorted));
-   /* since bn has unique and strictly ascending tail values, we
-* can easily check whether the tail is dense */
+   /* since bn has unique and strictly ascending values, we can
+* easily check whether the column is dense */
if (bn && bn->ttype == TYPE_oid &&
(BATcount(bn) <= 1 ||
 * (const oid *) Tloc(bn, 0) + BATcount(bn) - 1 ==
 * (const oid *) Tloc(bn, BUNlast(bn) - 1))) {
-   /* tail is dense, replace by virtual oid */
+   /* column is dense, replace by virtual oid */
ALGODEBUG fprintf(stderr, 
"#virtualize(bn=%s#"BUNFMT",seq="OIDFMT")\n",
  BATgetId(bn), BATcount(bn),
  BATcount(bn) > 0 ? * (const oid *) Tloc(bn, 
0) : 0);
@@ -56,7 +56,7 @@ virtualize(BAT *bn)
bn->theap.storage = bn->theap.newstorage = STORE_MEM;
bn->theap.size = 0;
bn->ttype = TYPE_void;
-   bn->tvarsized = 1;
+   bn->tvarsized = true;
bn->twidth = 0;
bn->tshift = 0;
}
@@ -85,11 +85,11 @@ doublerange(oid l1, oid h1, oid l2, oid 
*p++ = l1++;
while (l2 < h2)
*p++ = l2++;
-   bn->tkey = 1;
-   bn->tsorted = 1;
+   bn->tkey = true;
+   bn->tsorted = true;
bn->trevsorted = BATcount(bn) <= 1;
-   bn->tnil = 0;
-   bn->tnonil = 1;
+   bn->tnil = false;
+   bn->tnonil = true;
return bn;
 }
 
@@ -119,11 +119,11 @@ doubleslice(BAT *b, BUN l1, BUN h1, BUN 
o = (const oid *) Tloc(b, l2);
while (l2++ < h2)
*p++ = *o++;
-   bn->tkey = 1;
-   bn->tsorted = 1;
+   bn->tkey = true;
+   bn->tsorted = true;
bn->trevsorted = BATcount(bn) <= 1;
-   bn->tnil = 0;
-   bn->tnonil = 1;
+   bn->tnil = false;
+   bn->tnonil = true;
return virtualize(bn);
 }
 
@@ -221,7 +221,7 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
}
}
BATsetcount(bn, cnt);
-   bn->tkey = 1;
+   bn->tkey = true;
if (cnt > 1) {
/* hash chains produce results in the order high to
 * low, so we just need to reverse */
@@ -231,7 +231,7 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
dst[h] = o;
}
}
-   bn->tsorted = 1;
+   bn->tsorted = true;
bn->trevsorted = bn->batCount <= 1;
bn->tseqbase = bn->batCount == 0 ? 0 : bn->batCount == 1 ? *dst : 
oid_nil;
return bn;
@@ -240,37 +240,37 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
 /* Imprints select code */
 
 /* inner check */
-#define impscheck(CAND,TEST,ADD)   \
-do {   \
-   e = (BUN) (i+limit-pr_off+off); \
-   if (im[icnt] & mask) {  \
-   if ((im[icnt] & ~innermask) == 0) { \
-   while (p < q && o < e) {\
-   v = src[o-off]; \
-   ADD;  

MonetDB: default - Merge with Mar2018 branch.

2018-04-09 Thread Sjoerd Mullender
Changeset: 21e5b70001ca for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=21e5b70001ca
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/generator/generator.c
sql/backends/monet5/generator/generator.mal
sql/backends/monet5/generator/generator_hge.mal
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 464 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
@@ -9994,6 +9994,20 @@ Ready.
 [ "generator", "projection",   "pattern generator.projection(b:bat[:oid], 
cand:bat[:lng]):bat[:lng] ", "VLTgenerator_projection;", ""  ]
 [ "generator", "projection",   "pattern generator.projection(b:bat[:oid], 
cand:bat[:sht]):bat[:sht] ", "VLTgenerator_projection;", ""  ]
 [ "generator", "projection",   "pattern generator.projection(b:bat[:oid], 
cand:bat[:timestamp]):bat[:timestamp] ", "VLTgenerator_projection;", 
"Overloaded projection operation"   ]
+[ "generator", "select",   "pattern generator.select(b:bat[:bte], 
cand:bat[:oid], low:bte, high:bte, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:bte], low:bte, 
high:bte, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:dbl], 
cand:bat[:oid], low:dbl, high:dbl, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:dbl], low:dbl, 
high:dbl, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:flt], 
cand:bat[:oid], low:flt, high:flt, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:flt], low:flt, 
high:flt, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:int], 
cand:bat[:oid], low:int, high:int, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:int], low:int, 
high:int, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:lng], 
cand:bat[:oid], low:lng, high:lng, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:lng], low:lng, 
high:lng, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:sht], 
cand:bat[:oid], low:sht, high:sht, li:bit, hi:bit, anti:bit):bat[:oid] ",   
 "VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:sht], low:sht, 
high:sht, li:bit, hi:bit, anti:bit):bat[:oid] ",
"VLTgenerator_subselect;",  ""  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:timestamp], 
cand:bat[:oid], low:timestamp, high:timestamp, li:bit, hi:bit, 
anti:bit):bat[:oid] ",  "VLTgenerator_subselect;",  "Overloaded 
selection routine"  ]
+[ "generator", "select",   "pattern generator.select(b:bat[:timestamp], 
low:timestamp, high:timestamp, li:bit, hi:bit, anti:bit):bat[:oid] ",  
"VLTgenerator_subselect;",  "Overloaded selection routine"  ]
 [ "generator", "series",   "pattern generator.series(first:bte, 
last:bte):bat[:bte] ", "VLTgenerator_table;",  ""  ]
 [ "generator", "series",   "pattern generator.series(first:bte, last:bte, 
step:bte):bat[:bte] ",   "VLTgenerator_table;",  ""  ]
 [ "generator", "series",   "pattern generator.series(first:dbl, 
last:dbl):bat[:dbl] ", "VLTgenerator_table;",  ""  ]
@@ -10007,34 +10021,20 @@ Ready.
 [ "generator", "series",   "pattern generator.series(first:sht, 
last:sht):bat[:sht] ", "VLTgenerator_table;",  ""  ]
 [ "generator", "series",   "pattern generator.series(first:sht, last:sht, 
step:sht):bat[:sht] ",   "VLTgenerator_table;",  ""  ]
 [ "generator", "series",   "pattern generator.series(first:timestamp, 
last:timestamp, step:lng):bat[:timestamp] ", "VLTgenerator_table;",  ""  ]
-[ "generator", "subselect","pattern generator.subselect(b:bat[:bte], 
cand:bat[:oid], low:bte, high:bte, li:bit, hi:bit, anti:bit):bat[:oid] ", 
"VLTgenerator_subselect;",  ""  ]
-[ "generator", "subselect","patt

MonetDB: default - Merge with Mar2018 branch.

2018-04-09 Thread Sjoerd Mullender
Changeset: 46a56da78765 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46a56da78765
Modified Files:
sql/backends/monet5/generator/Tests/generator00.stable.out
sql/backends/monet5/generator/Tests/generator03.stable.out
sql/backends/monet5/generator/Tests/joins01.stable.out
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (56 lines):

diff --git a/sql/backends/monet5/generator/Tests/generator00.stable.out 
b/sql/backends/monet5/generator/Tests/generator00.stable.out
--- a/sql/backends/monet5/generator/Tests/generator00.stable.out
+++ b/sql/backends/monet5/generator/Tests/generator00.stable.out
@@ -177,7 +177,8 @@ Ready.
 % .L4 # table_name
 % value # name
 % tinyint # type
-% 1 # length
+% 2 # length
+[ 10   ]
 [ 8]
 [ 4]
 [ 2]
diff --git a/sql/backends/monet5/generator/Tests/generator03.stable.out 
b/sql/backends/monet5/generator/Tests/generator03.stable.out
--- a/sql/backends/monet5/generator/Tests/generator03.stable.out
+++ b/sql/backends/monet5/generator/Tests/generator03.stable.out
@@ -138,6 +138,7 @@ Ready.
 % value # name
 % timestamp # type
 % 26 # length
+[ 2008-03-04 18:00:00.00   ]
 [ 2008-03-04 08:00:00.00   ]
 [ 2008-03-03 22:00:00.00   ]
 [ 2008-03-03 12:00:00.00   ]
diff --git a/sql/backends/monet5/generator/Tests/joins01.stable.out 
b/sql/backends/monet5/generator/Tests/joins01.stable.out
--- a/sql/backends/monet5/generator/Tests/joins01.stable.out
+++ b/sql/backends/monet5/generator/Tests/joins01.stable.out
@@ -95,6 +95,7 @@ Ready.
 [ 2008-03-03 12:00:00.00   ]
 [ 2008-03-03 22:00:00.00   ]
 [ 2008-03-04 08:00:00.00   ]
+[ 2008-03-04 18:00:00.00   ]
 #select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i 
order by X.value, Y.i;
 % .x,  sys.y # table_name
 % value,   i # name
diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -730,7 +730,7 @@ wrapup:
v = (TPE*) Tloc(bn,0);\
for(; cnt-- > 0; ol ? *ol++ : o++){\
val = f + ((TPE) ( b->ttype == TYPE_void?o:*ol)) * s;\
-   if ( (s > 0 &&  (val < f || val >= l)) || (s < 0 && (val=f))) \
+   if ( (s > 0 &&  (val < f || val >= l)) || (s < 0 && (val <= l 
|| val > f))) \
continue;\
*v++ = val;\
c++;\
@@ -822,7 +822,7 @@ str VLTgenerator_projection(Client cntxt
continue;
if (s > 0 && ((val.days < f.days || (val.days 
== f.days && val.msecs < f.msecs)) || ((val.days>l.days || (val.days== l.days 
&& val.msecs >= l.msecs)))  ) )
continue;
-   if (s < 0 && ((val.days < l.days || (val.days 
== l.days && val.msecs < l.msecs)) || ((val.days>f.days || (val.days== f.days 
&& val.msecs >= f.msecs)))  ) )
+   if (s < 0 && ((val.days < l.days || (val.days 
== l.days && val.msecs <= l.msecs)) || ((val.days > f.days || (val.days == 
f.days && val.msecs > f.msecs)))  ) )
continue;
*v++ = val;
c++;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-04-05 Thread Sjoerd Mullender
Changeset: c416ac4ba363 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c416ac4ba363
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-nullif-coalesce.Bug-6565.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-nullif-coalesce.Bug-6565.stable.out
sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case.Bug-6568.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-mal-calc-undefined.Bug-6566.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-mal-calc-undefined.Bug-6566.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-not-between-wrong.Bug-6569.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-undefined-calc.Bug-6570.sql
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk_cross.c
gdk/gdk_group.c
monetdb5/mal/mal_interpreter.c
sql/server/rel_optimizer.c
sql/server/rel_select.c
sql/test/BugTracker-2015/Tests/null.Bug-3833.stable.out
sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-cast-null.Bug-6551.stable.out
testing/listexports.py.in
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 503 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -428,16 +428,6 @@ lng logger_read_last_transaction_id(logg
 gdk_return logger_reload(logger *lg);
 gdk_return logger_restart(logger *lg);
 int logger_sequence(logger *lg, int seq, lng *id);
-char *mcrypt_BackendSum(const char *string, size_t len);
-char *mcrypt_MD5Sum(const char *string, size_t len);
-char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
-char *mcrypt_SHA1Sum(const char *string, size_t len);
-char *mcrypt_SHA224Sum(const char *string, size_t len);
-char *mcrypt_SHA256Sum(const char *string, size_t len);
-char *mcrypt_SHA384Sum(const char *string, size_t len);
-char *mcrypt_SHA512Sum(const char *string, size_t len);
-const char *mcrypt_getHashAlgorithms(void);
-char *mcrypt_hashPassword(const char *algo, const char *password, const char 
*challenge);
 void *mdlopen(const char *library, int mode);
 int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name, 
const char *value);
 int mo_builtin_settings(opt **Set);
@@ -445,23 +435,6 @@ char *mo_find_option(opt *set, int setle
 void mo_free_options(opt *set, int setlen);
 void mo_print_options(opt *set, int setlen);
 int mo_system_config(opt **Set, int setlen);
-void msab_dbfarminit(const char *dbfarm);
-void msab_dbpathinit(const char *dbpath);
-char *msab_deserialise(sabdb **ret, char *sabdb);
-char *msab_freeStatus(sabdb **ret);
-char *msab_getDBfarm(char **ret);
-char *msab_getDBname(char **ret);
-char *msab_getMyStatus(sabdb **ret);
-char *msab_getStatus(sabdb **ret, char *dbname);
-char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
-char *msab_marchConnection(const char *host, const int port);
-char *msab_marchScenario(const char *lang);
-char *msab_registerStarted(void);
-char *msab_registerStarting(void);
-char *msab_registerStop(void);
-char *msab_retreatScenario(const char *lang);
-char *msab_serialise(char **ret, const sabdb *db);
-char *msab_wildRetreat(void);
 const oid oid_nil;
 DIR *opendir(const char *dirname);
 void print_trace(void);
@@ -595,6 +568,22 @@ MapiMsg mapi_timeout(Mapi mid, unsigned 
 void mapi_trace(Mapi mid, int flag);
 char *mapi_unquote(char *msg);
 MapiMsg mapi_virtual_result(MapiHdl hdl, int columns, const char 
**columnnames, const char **columntypes, const int *columnlengths, int 
tuplecount, const char ***tuples);
+char *mcrypt_BackendSum(const char *string, size_t len);
+char *mcrypt_MD5Sum(const char *string, size_t len);
+char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
+char *mcrypt_SHA1Sum(const char *string, size_t len);
+char *mcrypt_SHA224Sum(const char *string, size_t len);
+char *mcrypt_SHA256Sum(const char *string, size_t len);
+char *mcrypt_SHA384Sum(const char *string, size_t len);
+char *mcrypt_SHA512Sum(const char *string, size_t len);
+const char *mcrypt_getHashAlgorithms(void);
+char *mcrypt_hashPassword(const char *algo, const char *password, const char 
*challenge);
+int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name, 
const char *value);
+int mo_builtin_settings(opt **Set);
+char *mo_find_option(opt *set, int setlen, const char *name);
+void mo_free_options(opt *set, int setlen);
+void mo_print_options(opt *set, int setlen);
+int mo_system_config(opt **Set, int setlen);
 const char *wsaerror(int);
 
 # monetdb5
@@ -2367,6 +2356,23 @@ char monet_characteristics[4096];
 char monet_cwd[FILENAME_MAX];
 size_t monet_memory;
 void moveInstruction(MalBlkPtr mb, int pc, int target);
+void msab_dbfarminit(const char *

MonetDB: default - Merge with Mar2018 branch.

2018-04-04 Thread Sjoerd Mullender
Changeset: cd76f6265166 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cd76f6265166
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-nullif-coalesce.Bug-6565.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-mal-calc-undefined.Bug-6566.sql
Modified Files:
clients/mapiclient/Makefile.ag
clients/mapilib/Makefile.ag
common/utils/mcrypt.h
monetdb5/extras/mal_optimizer_template/Makefile.ag
monetdb5/tools/Makefile.ag
sql/backends/monet5/Makefile.ag
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (155 lines):

diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -35,7 +35,7 @@ bin_stethoscope = {
LIBS = libmcutil ../../common/utils/libmutils \
../mapilib/libmapi \
../../common/stream/libstream \
-   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) 
$(PTHREAD_LIBS)
+   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS)
 }
 
 bin_tachograph = {
@@ -43,7 +43,7 @@ bin_tachograph = {
LIBS = libmcutil ../../common/utils/libmutils \
../mapilib/libmapi \
../../common/stream/libstream \
-   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) 
$(PTHREAD_LIBS)
+   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS)
 }
 
 bin_tomograph = {
@@ -51,7 +51,7 @@ bin_tomograph = {
LIBS = libmcutil ../../common/utils/libmutils \
../mapilib/libmapi \
../../common/stream/libstream \
-   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) 
$(PTHREAD_LIBS)
+   $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) 
$(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS)
 }
 
 # disabled: it's not really a tool for users, more to debug mapi
diff --git a/clients/mapilib/Makefile.ag b/clients/mapilib/Makefile.ag
--- a/clients/mapilib/Makefile.ag
+++ b/clients/mapilib/Makefile.ag
@@ -7,7 +7,7 @@
 MTSAFE
 
 INCLUDES = ../../common/options ../../common/stream ../../common/utils \
-  $(MSGCONTROL_FLAGS)
+  $(MSGCONTROL_FLAGS) $(openssl_CFLAGS)
 
 lib_mapi = {
VERSION = $(MAPI_VERSION)
diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h
--- a/common/utils/mcrypt.h
+++ b/common/utils/mcrypt.h
@@ -9,14 +9,25 @@
 #ifndef _SEEN_MCRYPT_H
 #define _SEEN_MCRYPT_H 1
 
-const char *mcrypt_getHashAlgorithms(void);
-char *mcrypt_MD5Sum(const char *string, size_t len);
-char *mcrypt_SHA1Sum(const char *string, size_t len);
-char *mcrypt_SHA224Sum(const char *string, size_t len);
-char *mcrypt_SHA256Sum(const char *string, size_t len);
-char *mcrypt_SHA384Sum(const char *string, size_t len);
-char *mcrypt_SHA512Sum(const char *string, size_t len);
-char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
-char *mcrypt_BackendSum(const char *string, size_t len);
-char *mcrypt_hashPassword(const char *algo, const char *password, const char 
*challenge);
+#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+#if !defined(LIBMAPI) && !defined(LIBMCRYPT)
+#define mcrypt_export extern __declspec(dllimport)
+#else
+#define mcrypt_export extern __declspec(dllexport)
+#endif
+#else
+#define mcrypt_export extern
 #endif
+
+mcrypt_export const char *mcrypt_getHashAlgorithms(void);
+mcrypt_export char *mcrypt_MD5Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_SHA1Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_SHA224Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_SHA256Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_SHA384Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_SHA512Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
+mcrypt_export char *mcrypt_BackendSum(const char *string, size_t len);
+mcrypt_export char *mcrypt_hashPassword(const char *algo, const char 
*password, const char *challenge);
+#endif
+
diff --git a/monetdb5/extras/mal_optimizer_template/Makefile.ag 
b/monetdb5/extras/mal_optimizer_template/Makefile.ag
--- a/monetdb5/extras/mal_optimizer_template/Makefile.ag
+++ b/monetdb5/extras/mal_optimizer_template/Makefile.ag
@@ -18,10 +18,8 @@ lib_opt_sql_append = {
DIR = libdir/monetdb5
SEP = _
SOURCES = opt_sql_append.c opt_sql_append.h
-   LIBS = NATIVE_WIN32?../../tools/libmonetd

MonetDB: default - Merge with Mar2018 branch.

2018-04-03 Thread Sjoerd Mullender
Changeset: c9074751e6f1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9074751e6f1
Modified Files:
buildtools/ChangeLog.Mar2018
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/msc.py
clients/examples/C/Makefile.ag
clients/mapiclient/Makefile.ag
clients/mapilib/Makefile.ag
common/stream/Makefile.ag
common/stream/monetdb-stream.pc.in
configure.ag
gdk/Makefile.ag
gdk/monetdb-gdk.pc.in
geom/monetdb5/Makefile.ag
monetdb5/extras/rapi/Makefile.ag
monetdb5/tools/Makefile.ag
monetdb5/tools/monetdb5.pc.in
sql/backends/monet5/LSST/Makefile.ag
sql/backends/monet5/Makefile.ag
sql/backends/monet5/UDF/capi/Makefile.ag
sql/backends/monet5/UDF/pyapi/Makefile.ag
sql/backends/monet5/UDF/pyapi3/Makefile.ag
sql/backends/monet5/UDF/udf/Makefile.ag
sql/backends/monet5/generator/Makefile.ag
sql/backends/monet5/vaults/Makefile.ag
sql/backends/monet5/vaults/bam/Makefile.ag
sql/backends/monet5/vaults/fits/Makefile.ag
sql/backends/monet5/vaults/lidar/Makefile.ag
sql/backends/monet5/vaults/netcdf/Makefile.ag
sql/backends/monet5/vaults/shp/Makefile.ag
sql/include/sql_mem.h
tools/merovingian/client/Makefile.ag
tools/merovingian/daemon/Makefile.ag
tools/mserver/Makefile.ag
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 828 to 300 lines):

diff --git a/buildtools/ChangeLog.Mar2018 b/buildtools/ChangeLog.Mar2018
--- a/buildtools/ChangeLog.Mar2018
+++ b/buildtools/ChangeLog.Mar2018
@@ -1,3 +1,11 @@
 # ChangeLog file for buildtools
 # This file is updated with Maddlog
 
+* Tue Apr  3 2018 Sjoerd Mullender 
+- On Linux and Unix, try not to link to libraries multiple times: that
+  only causes the code (and worse, the variables in those libraries) to be
+  included multiple times.  On Windows, we do need to link to libraries
+  multiple times (once for each DLL we create if the DLL references
+  anything from the library) but that doesn't cause the linked library
+  to be loaded multiple times.
+
diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -208,12 +208,19 @@ def am_additional_libs(name, sep, type, 
 if l[0] not in ("-", "$", "@"):
 l = am_translate_dir(l, am) + ".la"
 if c:
-if c in ('NATIVE_WIN32', 'WIN32'):
+c = c.split('&')
+if 'NATIVE_WIN32' in c:
 continue
 global libno
 v = 'LIB%d' % libno
 libno = libno + 1
-add = 'if %s\n%s = %s\nelse\n%s =\nendif\n%s' % (c, v, l, v, add)
+s = ''
+for x in c:
+s += 'if %s\n' % x
+s += '%s = %s\n' % (v, l)
+for x in c:
+s += 'else\n%s =\nendif\n' % v
+add = s + add
 l = '$(%s)' % v
 add = add + " " + l
 return add + "\n"
diff --git a/buildtools/autogen/autogen/msc.py 
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -209,8 +209,15 @@ def msc_additional_libs(fd, name, sep, t
 for l in list:
 if '?' in l:
 c, l = l.split('?', 1)
-if c in ('NATIVE_WIN32', 'WIN32'):
-c = None
+c = c.split('&')
+try:
+c.remove('NATIVE_WIN32')
+except ValueError:
+pass
+try:
+c.remove('WIN32')
+except ValueError:
+pass
 else:
 c = None
 d = None
@@ -243,7 +250,7 @@ def msc_additional_libs(fd, name, sep, t
 global libno
 v = 'LIB%d' % libno
 libno = libno + 1
-cond += '!IF defined(%s)\n%s = %s\n!ELSE\n%s =\n!ENDIF\n' % (c, v, 
l, v)
+cond += '!IF defined(%s)\n%s = %s\n!ELSE\n%s =\n!ENDIF\n' % (') && 
defined('.join(c), v, l, v)
 l = '$(%s)' % v
 if d:
 deps = '%s %s' % (deps, l)
diff --git a/clients/examples/C/Makefile.ag b/clients/examples/C/Makefile.ag
--- a/clients/examples/C/Makefile.ag
+++ b/clients/examples/C/Makefile.ag
@@ -5,15 +5,14 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2018 MonetDB B.V.
 
 MTSAFE
-INCLUDES = ../../mapilib ../../../common/options $(READLINE_INCS)
-
-MAPI_LIBS = $(SOCKET_LIBS) 
+INCLUDES = ../../mapilib
 
 BINS = {
CONDINST = HAVE_TESTING
DIR = bindir
SOURCES = sample0.c sample1.c sample4.c \
smack00.c smack01.c
-   LIBS = $(MAPI_LIBS) ../../mapilib/libmapi \
-   $(curl_LIBS)
+   LIBS = ../../mapilib/libmapi \
+   ../../../common/stream/libstream \
+   $(SOCKET_LI

MonetDB: default - Merge with Mar2018 branch.

2018-03-30 Thread Sjoerd Mullender
Changeset: 0f8372f1920c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f8372f1920c
Modified Files:
monetdb5/optimizer/opt_candidates.c
sql/backends/monet5/sql_statistics.c

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-query.stable.out

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-view.stable.out

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-query.stable.out

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-view.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (211 lines):

diff --git a/monetdb5/optimizer/opt_candidates.c 
b/monetdb5/optimizer/opt_candidates.c
--- a/monetdb5/optimizer/opt_candidates.c
+++ b/monetdb5/optimizer/opt_candidates.c
@@ -44,7 +44,7 @@ OPTcandidatesImplementation(Client cntxt
setVarCList(mb,getArg(p,0));
else if(getFunctionId(p) == likeselectRef || 
getFunctionId(p) == likethetaselectRef)
setVarCList(mb,getArg(p,0));
-   else if(getFunctionId(p) == intersectRef )
+   else if(getFunctionId(p) == intersectRef || 
getFunctionId(p) == differenceRef )
setVarCList(mb,getArg(p,0));
else if(getFunctionId(p) == uniqueRef )
setVarCList(mb,getArg(p,0));
@@ -52,6 +52,10 @@ OPTcandidatesImplementation(Client cntxt
setVarCList(mb,getArg(p,0));
else if(getFunctionId(p) == subsliceRef )
setVarCList(mb,getArg(p,0));
+   else if (getFunctionId(p) == projectionRef &&
+isVarCList(mb,getArg(p,p->retc + 0)) &&
+isVarCList(mb,getArg(p,p->retc + 1)))
+   setVarCList(mb,getArg(p,0));
}
else if( getModuleId(p) == generatorRef){
if(getFunctionId(p) == selectRef || getFunctionId(p) == 
thetaselectRef)
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -59,8 +59,8 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
str msg = getSQLContext(cntxt, mb, &m, NULL);
sql_trans *tr = m->session->tr;
node *nsch, *ntab, *ncol;
-   char *query, *dquery;
-   size_t querylen;
+   char *query = NULL, *dquery;
+   size_t querylen = 0;
char *maxval = NULL, *minval = NULL;
size_t minlen = 0, maxlen = 0;
str sch = 0, tbl = 0, col = 0;
@@ -76,9 +76,7 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
if (msg != MAL_SUCCEED || (msg = checkSQLContext(cntxt)) != NULL)
return msg;
 
-   querylen = 0;
-   query = NULL;
-   dquery = (char *) GDKzalloc(8192);
+   dquery = (char *) GDKzalloc(96);
if (dquery == NULL) {
throw(SQL, "analyze", SQLSTATE(HY001) MAL_MALLOC_FAIL);
}
@@ -112,8 +110,13 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
 
if (tbl && strcmp(bt->name, tbl))
continue;
-   if (t->persistence != SQL_PERSIST)
+   if (t->persistence != SQL_PERSIST) {
+   GDKfree(dquery);
+   GDKfree(query);
+   GDKfree(maxval);
+   GDKfree(minval);
throw(SQL, "analyze", SQLSTATE(42S02) 
"Table '%s' is not persistent", bt->name);
+   }
tfnd = 1;
if (isTable(t) && t->columns.set)
for (ncol = (t)->columns.set->h; ncol; 
ncol = ncol->next) {
@@ -144,7 +147,7 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
if (tostr == 
BATatoms[TYPE_str].atomToStr)
tostr = strToStrSQuote;
 
-   snprintf(dquery, 8192, "delete 
from sys.statistics where \"column_id\" = %d;", c->base.id);
+   snprintf(dquery, 96, "delete 
from sys.statistics where \"column_id\" = %d;", c->base.id);
cfnd = 1;
if (samplesize > 0) {
bsample = BATsample(bn, 
(BUN) samplesize);
@@ -174,7 +177,7 @@ sql_analyze(Client cntxt, MalBl

MonetDB: default - Merge with Mar2018 branch.

2018-03-29 Thread Sjoerd Mullender
Changeset: 64179043f7a5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64179043f7a5
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-null-not-in.Bug-6562.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-null-not-in.Bug-6562.stable.out
Removed Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
Modified Files:
monetdb5/extras/rapi/rapi.c
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_session.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/language.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/wlc.c
sql/backends/monet5/UDF/pyapi/emit.c
sql/server/rel_select.c
sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out

sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out.FreeBSD

sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out.Windows
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.stable.out
sql/test/BugTracker-2018/Tests/sqlitelogictest-count-not-in.Bug-6518.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-count-not-in.Bug-6518.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in-cast.Bug-6561.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-null-not-in.Bug-6562.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-aggregation-count.Bug-6510.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-aggregation-count.Bug-6510.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 122477 to 300 lines):

diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -330,8 +330,6 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
goto wrapup;
}
}
-   BATsetcount(b, 1);
-   BATsettrivprop(b);
} else {
b = BATdescriptor(*getArgReference_bat(stk, pci, i));
if (b == NULL) {
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -183,9 +183,9 @@ AUTHinitTables(const char *passwd) {
/* don't check this bat since we'll fix it below */
GDKdebug &= ~CHECKMASK;
user = BATdescriptor(bid);
+   GDKdebug = dbg;
if (user == NULL)
throw(MAL, "initTables.user", SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
-   GDKdebug = dbg;
isNew = 0;
}
assert(user);
@@ -206,9 +206,9 @@ AUTHinitTables(const char *passwd) {
/* don't check this bat since we'll fix it below */
GDKdebug &= ~CHECKMASK;
pass = BATdescriptor(bid);
+   GDKdebug = dbg;
if (pass == NULL)
throw(MAL, "initTables.passwd", SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
-   GDKdebug = dbg;
isNew = 0;
}
assert(pass);
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-03-27 Thread Sjoerd Mullender
Changeset: ea00849b5e2c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea00849b5e2c
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files..

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


MonetDB: default - Merge with Mar2018 branch.

2018-03-27 Thread Sjoerd Mullender
Changeset: 2c89f57d27bc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c89f57d27bc
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
sql/ChangeLog-Archive
sql/ChangeLog.Mar2018
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (107 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -692,3 +692,6 @@ 4fd4a5c7b66747468a2b41930d1b987a4b0efff4
 a294cafd5cac3397e148032bee9d8efc89f5c82a Mar2018_root
 28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_1
 28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_release
+f34a57f73307a09909b3669ce5cfd9aad490f317 Mar2018_3
+28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_release
+f34a57f73307a09909b3669ce5cfd9aad490f317 Mar2018_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1046,6 +1046,21 @@ done
 %postun -p /sbin/ldconfig
 
 %changelog
+* Tue Mar 27 2018 Sjoerd Mullender  - 11.29.3-20180327
+- Rebuilt.
+- BZ#3824: Created table not visible from ODBC
+- BZ#6556: Sqlitelogictest division by zero on COALESCE call
+- BZ#6557: Sqlitelogictest crash on aggregation query with not in
+- BZ#6559: rows in sys.statistics are not removed when a temporary table
+  is dropped.
+- BZ#6560: Sqlitelogictest crash on group by query with having in
+- BZ#6561: Sqlitelogictest crash on group by query with having not
+  in clause
+
+* Thu Mar 15 2018 Sjoerd Mullender  - 11.29.3-20180327
+- sql: Extended support to use CREATE ORDERED INDEX on columns of type: char,
+  varchar, clob, blob, url, json, inet and uuid.
+
 * Thu Mar 15 2018 Sjoerd Mullender  - 11.29.1-20180315
 - Rebuilt.
 - BZ#3574: Add support for: create OR REPLACE view ...
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
+monetdb (11.29.3) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#3824: Created table not visible from ODBC
+  * BZ#6556: Sqlitelogictest division by zero on COALESCE call
+  * BZ#6557: Sqlitelogictest crash on aggregation query with not in
+  * BZ#6559: rows in sys.statistics are not removed when a temporary table
+is dropped.
+  * BZ#6560: Sqlitelogictest crash on group by query with having in
+  * BZ#6561: Sqlitelogictest crash on group by query with having not
+in clause
+
+ -- Sjoerd Mullender   Tue, 27 Mar 2018 14:27:04 +0200
+
+monetdb (11.29.3) unstable; urgency=low
+
+  * sql: Extended support to use CREATE ORDERED INDEX on columns of type: char,
+varchar, clob, blob, url, json, inet and uuid.
+
+ -- Sjoerd Mullender   Thu, 15 Mar 2018 14:27:04 +0200
+
 monetdb (11.29.1) unstable; urgency=low
 
   * Rebuilt.
diff --git a/libversions b/libversions
--- a/libversions
+++ b/libversions
@@ -36,13 +36,13 @@
 
 # version of the GDK library (subdirectory gdk; also includes
 # common/options and common/utils)
-GDK_VERSION=16:0:0
+GDK_VERSION=16:1:0
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=10:0:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras)
-MONETDB5_VERSION=24:0:0
+MONETDB5_VERSION=24:1:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=11:0:0
diff --git a/sql/ChangeLog-Archive b/sql/ChangeLog-Archive
--- a/sql/ChangeLog-Archive
+++ b/sql/ChangeLog-Archive
@@ -1,6 +1,10 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Tue Nov 28 2017 Sjoerd Mullender  - 11.29.3-20180327
+- Extended support to use CREATE ORDERED INDEX on columns of type: char,
+  varchar, clob, blob, url, json, inet and uuid.
+
 * Thu Feb  1 2018 Martin van Dinther  
- 11.29.1-20180315
 - Added new system view: sys.ids which contains all database objects
   ids which can be used in sys.dependencies table.
diff --git a/sql/ChangeLog.Mar2018 b/sql/ChangeLog.Mar2018
--- a/sql/ChangeLog.Mar2018
+++ b/sql/ChangeLog.Mar2018
@@ -1,7 +1,3 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
-* Tue Nov 28 2017 Sjoerd Mullender 
-- Extended support to use CREATE ORDERED INDEX on columns of type: char,
-  varchar, clob, blob, url, json, inet and uuid.
-
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-03-27 Thread Sjoerd Mullender
Changeset: 584a56fba7a6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=584a56fba7a6
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files.

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


MonetDB: default - Merge with Mar2018 branch.

2018-03-27 Thread Sjoerd Mullender
Changeset: e581dd6398ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e581dd6398ed
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in-cast.Bug-6561.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in-cast.Bug-6561.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in-cast.Bug-6561.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in.Bug-6560.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in.Bug-6560.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-null-not-in.Bug-6562.sql
Modified Files:
gdk/gdk_bat.c
gdk/gdk_bbp.c
gdk/gdk_join.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/sql_statistics.c
sql/server/rel_rel.c
sql/server/rel_rel.h
sql/server/rel_select.c
sql/server/rel_updates.c
sql/server/sql_privileges.c

sql/test/BugTracker-2017/Tests/statistics_nils_not_eq_zero.Bug-6331.stable.err
sql/test/BugTracker-2018/Tests/All
sql/test/BugTracker-2018/Tests/truncate_tmp_tables.Bug-6543.stable.err
testing/Mtest.py.in
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/utils/properties.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 752 to 300 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2048,6 +2048,7 @@ BATassertProps(BAT *b)
/* tseqbase must correspond to actual value */
assert(* (oid *) BUNtail(bi, 0) == b->tseqbase);
}
+   assert(b->tseqbase + b->batCount <= GDK_oid_max);
}
/* a column cannot both have and not have NILs */
assert(!b->tnil || !b->tnonil);
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -877,10 +877,8 @@ headheapinit(oid *hseq, const char *buf,
 
if (strcmp(type, "void") != 0)
GDKfatal("BBPinit: head column must be VOID (ID = %d).", (int) 
bid);
-#if SIZEOF_OID < SIZEOF_LNG
if (base > (uint64_t) GDK_oid_max)
GDKfatal("BBPinit: head seqbase out of range (ID = %d, seq = %" 
PRIu64 ").", (int) bid, base);
-#endif
*hseq = (oid) base;
return n;
 }
@@ -1088,7 +1086,8 @@ BBPreadEntries(FILE *fp, unsigned bbpver
 #endif
 
if (first != 0)
-   GDKfatal("BBPinit: first != 0 (ID = %" PRIu64 ").", 
batid);
+   GDKfatal("BBPinit: first != 0 (ID = %" PRIu64 ").",
+batid);
 
bid = (bat) batid;
if (batid >= (uint64_t) ATOMIC_GET(BBPsize, BBPsizeLock)) {
@@ -1097,7 +1096,8 @@ BBPreadEntries(FILE *fp, unsigned bbpver
BBPextend(0, false);
}
if (BBP_desc(bid) != NULL)
-   GDKfatal("BBPinit: duplicate entry in BBP.dir (ID = %" 
PRIu64 ").", batid);
+   GDKfatal("BBPinit: duplicate entry in BBP.dir (ID = "
+"%" PRIu64 ").", batid);
bn = GDKzalloc(sizeof(BAT));
if (bn == NULL)
GDKfatal("BBPinit: cannot allocate memory for BAT.");
@@ -1114,10 +1114,8 @@ BBPreadEntries(FILE *fp, unsigned bbpver
if (bbpversion <= GDKLIBRARY_HEADED) {
nread += headheapinit(&bn->hseqbase, buf + nread, bid);
} else {
-#if SIZEOF_OID < SIZEOF_LNG
if (base > (uint64_t) GDK_oid_max)
GDKfatal("BBPinit: head seqbase out of range 
(ID = %" PRIu64 ", seq = %" PRIu64 ").", batid, base);
-#endif
bn->hseqbase = (oid) base;
}
nread += heapinit(bn, buf + nread, &Thashash, "T", bbpversion, 
bid, filename);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -461,13 +461,36 @@ selectjoin(BAT *r1, BAT *r2, BAT *l, BAT
 
 static gdk_return
 mergejoin_void(BAT *r1, BAT *r2, BAT *l, BAT *r, BAT *sl, BAT *sr,
-  bool nil_on_miss, bool only_misses, lng t0)
+  bool nil_on_miss, bool only_misses, lng t0, bool swapped)
 {
oid lo, hi;
BUN cnt, i;
const oid *lvals;
oid o, seq;
 
+   ALGODEBUG fprintf(stderr, "#mergejoin_void(l=%s#" BUNFMT "[%s]%s%s%s,"
+ "r=%s#" BUNFMT "[%s]%s%s%s,sl=%s#" BUNFMT "%s%s%s,"
+ "sr=%s#" BUNFMT "%s%s%s,"
+ "nil_on_miss=%d,only_misses=%d)%s\n",
+ BATgetId(l), BATcount(l), ATOMname(l->ttype),
+ l->tsorted ? "-sorted" : "",
+ l->trevsorted ? "-r

MonetDB: default - Merge with Mar2018 branch.

2018-03-23 Thread Sjoerd Mullender
Changeset: 581273b0c613 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=581273b0c613
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-in.Bug-6560.sql
Modified Files:
gdk/gdk_join.c
gdk/gdk_select.c
sql/test/BugTracker-2018/Tests/All
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 387 to 300 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -295,6 +295,163 @@ nomatch(BAT *r1, BAT *r2, BAT *l, BAT *r
return GDK_FAIL;
 }
 
+static gdk_return
+selectjoin(BAT *r1, BAT *r2, BAT *l, BAT *r, BAT *sl, BAT *sr,
+  bool nil_matches, lng t0, bool swapped)
+{
+   BATiter li = bat_iterator(l);
+   const void *v;
+   const oid *restrict lcand, *lcandend;
+   BUN lstart, lend, lcnt;
+   BAT *bn = NULL;
+
+   ALGODEBUG fprintf(stderr, "#selectjoin(l=%s#" BUNFMT "[%s]%s%s%s,"
+ "r=%s#" BUNFMT "[%s]%s%s%s,sl=%s#" BUNFMT "%s%s%s,"
+ "sr=%s#" BUNFMT "%s%s%s,nil_matches=%d)%s\n",
+ BATgetId(l), BATcount(l), ATOMname(l->ttype),
+ l->tsorted ? "-sorted" : "",
+ l->trevsorted ? "-revsorted" : "",
+ l->tkey ? "-key" : "",
+ BATgetId(r), BATcount(r), ATOMname(r->ttype),
+ r->tsorted ? "-sorted" : "",
+ r->trevsorted ? "-revsorted" : "",
+ r->tkey ? "-key" : "",
+ sl ? BATgetId(sl) : "NULL", sl ? BATcount(sl) : 0,
+ sl && sl->tsorted ? "-sorted" : "",
+ sl && sl->trevsorted ? "-revsorted" : "",
+ sl && sl->tkey ? "-key" : "",
+ sr ? BATgetId(sr) : "NULL", sr ? BATcount(sr) : 0,
+ sr && sr->tsorted ? "-sorted" : "",
+ sr && sr->trevsorted ? "-revsorted" : "",
+ sr && sr->tkey ? "-key" : "",
+ nil_matches,
+ swapped ? " swapped" : "");
+
+   assert(BATcount(l) > 0);
+   CANDINIT(l, sl, lstart, lend, lcnt, lcand, lcandend);
+   if (lcand)
+   lcnt = lcandend - lcand;
+   else
+   lcnt = lend - lstart;
+   if (lcnt == 0) {
+   return nomatch(r1, r2, l, r, lstart, lend,
+  lcand, lcandend, false, false,
+  "selectjoin", t0);
+   }
+   assert(lcnt == 1 || (l->tsorted && l->trevsorted));
+   if (lcand) {
+   v = BUNtail(li, *lcand - l->hseqbase);
+   } else {
+   v = BUNtail(li, lstart);
+   }
+
+   if (!nil_matches &&
+   (*ATOMcompare(l->ttype))(v, ATOMnilptr(l->ttype)) == 0) {
+   /* NIL doesn't match anything */
+   return nomatch(r1, r2, l, r, lstart, lend,
+  lcand, lcandend, false, false,
+  "selectjoin", t0);
+   }
+
+   bn = BATselect(r, sr, v, NULL, true, true, false);
+   if (bn == NULL) {
+   goto bailout;
+   }
+   if (BATcount(bn) == 0) {
+   BBPunfix(bn->batCacheid);
+   return nomatch(r1, r2, l, r, lstart, lend,
+  lcand, lcandend, false, false,
+  "selectjoin", t0);
+   }
+   if (BATextend(r1, lcnt * BATcount(bn)) != GDK_SUCCEED ||
+   BATextend(r2, lcnt * BATcount(bn)) != GDK_SUCCEED)
+   goto bailout;
+
+   r1->tsorted = true;
+   r1->trevsorted = lcnt == 1;
+   r1->tseqbase = BATcount(bn) == 1 && lcand == NULL ? l->hseqbase + 
lstart : oid_nil;
+   r1->tkey = BATcount(bn) == 1;
+   r1->tnil = false;
+   r1->tnonil = true;
+   r2->tsorted = lcnt == 1 || BATcount(bn) == 1;
+   r2->trevsorted = BATcount(bn) == 1;
+   r2->tseqbase = lcnt == 1 && BATtdense(bn) ? bn->tseqbase : oid_nil;
+   r2->tkey = lcnt == 1;
+   r2->tnil = false;
+   r2->tnonil = true;
+   if (BATtdense(bn)) {
+   oid *r1p = (oid *) Tloc(r1, 0);
+   oid *r2p = (oid *) Tloc(r2, 0);
+   oid bno = bn->tseqbase;
+   BUN q = BATcount(bn);
+
+   if (lcand) {
+   w

MonetDB: default - Merge with Mar2018 branch.

2018-03-23 Thread Sjoerd Mullender
Changeset: 7a4e0e8d8a30 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a4e0e8d8a30
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
sql/test/BugTracker-2018/Tests/truncate_tmp_tables.Bug-6543.reqtests
sql/test/BugTracker-2018/Tests/truncate_tmp_tables.Bug-6543.sql
sql/test/BugTracker-2018/Tests/truncate_tmp_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_tmp_tables.Bug-6543.stable.out
Modified Files:
clients/mapiclient/mclient.c
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_cand.h
gdk/gdk_join.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/vaults/bam/Tests/mergetable.stable.out
sql/backends/monet5/vaults/fits/fits.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/test/BugTracker-2010/Tests/prepare_stmt.Bug-2533.Bug-2534.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out

sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
sql/test/BugTracker-2017/Tests/caching_stats_bug.6374.stable.out
sql/test/BugTracker-2017/Tests/side-effect.Bug-6397.stable.out
sql/test/BugTracker-2017/Tests/side-effect.Bug-6397.stable.out.single
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.sql
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-plan-0join-query.stable.out

sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-plan-0join-view.stable.out
sql/test/Skyserver/Tests/Skyserver.stable.out
sql/test/VOC/Tests/VOC.stable.out
sql/test/pg_regress/Tests/alter_table.stable.err
sql/test/pg_regress/Tests/alter_table.stable.out
sql/test/pg_regress/Tests/random.stable.out
sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.stable.out
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out
sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.sql
sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 3414 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -269,7 +269,7 @@ timerHuman(int64_t sqloptimizer, int64_t
 
/*
 * report only the times we do actually measure:
-* - client-measured wall-clock time per query only when executing 
indivual queries,
+* - client-measured wall-clock time per query only when executing 
individual queries,
 *   otherwise only the total wall-clock time at the end of a batch;
 * - server-measured detailed performance measures only per query.
 */
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -345,23 +345,14 @@
 #define GDKisalnum(c)  isalnum((unsigned char) (c))
 #define GDKisdigit(c)  isdigit((unsigned char) (c))
 
-#define TEMPDIR_NAME "TEMP_DATA"
+#define BATDIR "bat"
+#define TEMPDIR_NAME   "TEMP_DATA"
 
-#ifndef NATIVE_WIN32
-#define BATDIR "bat"
-#define DELDIR "bat/DELETE_ME"
-#define BAKDIR "bat/BACKUP"
-#define SUBDIR "bat/BACKUP/SUBCOMMIT"
-#define LEFTDIR"bat/LEFTOVERS"
-#define TEMPDIR "bat/"TEMPDIR_NAME
-#else
-#define BATDIR "bat"
-#define DELDIR "bat\\DELETE_ME"
-#define BAKDIR "bat\\BACKUP"
-#define SUBDIR "bat\\BACKUP\\SUBCOMMIT"
-#define LEFTDIR"bat\\LEFTOVERS"
-#define TEMPDIR "bat\\"TEMPDIR_NAME
-#endif
+#define DELDIR BATDIR DIR_SEP_STR "DELETE_ME"
+#define BAKDIR BATDIR DIR_SEP_STR "BACKUP"
+#define SUBDIR BAKDIR DIR_SEP_STR "SUBCOMMIT" /* note K, not T */
+#define LEFTDIRBATDIR DIR_SEP_STR "LEFTOVERS"
+#define TEMPDIRBATDIR DIR_SEP_STR TEMPDIR_NAME
 
 /*
See `man mserver5` or tools/mserver/mserver5.1
@@ -770,7 +761,7 @@ typedef struct {
unsigned short width;   /* byte-width of the atom array */
b

MonetDB: default - Merge with Mar2018 branch.

2018-03-19 Thread Sjoerd Mullender
Changeset: 02cc4c071924 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=02cc4c071924
Added Files:
sql/test/orderidx/Tests/imprints_all_types.sql
sql/test/orderidx/Tests/imprints_all_types.stable.err
sql/test/orderidx/Tests/imprints_all_types.stable.out
sql/test/orderidx/Tests/imprints_hge_type.sql
sql/test/orderidx/Tests/imprints_hge_type.stable.err
sql/test/orderidx/Tests/imprints_hge_type.stable.out.int128
Modified Files:
clients/mapiclient/mhelp.c
monetdb5/optimizer/opt_mergetable.c
sql/ChangeLog.Mar2018
sql/backends/monet5/UDF/capi/capi.c
sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.sql
sql/test/orderidx/Tests/All
sql/test/orderidx/Tests/oidx_all_types.sql
sql/test/orderidx/Tests/oidx_all_types.stable.out
sql/test/orderidx/Tests/oidx_hge_type.sql
sql/test/orderidx/Tests/oidx_hge_type.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 3185 to 300 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -71,11 +71,11 @@ SQLhelp sqlhelp[] = {
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"},
{"ALTER USER",
 "",
-"ALTER USER ident  WITH [ ENCRYPTED | UNENCRYPTED] PASSWORD string\n"
-"ALTER USER ident  SET SCHEMA ident\n"
-"ALTER USER ident  WITH [ENCRYPTED | UNENCRYPTED] PASSWORD SET SCHEMA 
ident\n"
+"ALTER USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string\n"
+"ALTER USER ident SET SCHEMA schemaname\n"
+"ALTER USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string SET 
SCHEMA schemaname\n"
 "ALTER USER RENAME TO ident\n"
-"ALTER USER SET [ ENCRYPTED | UNENCRYPTED] PASSWORD string USING OLD 
PASSWORD string",
+"ALTER USER SET [ENCRYPTED | UNENCRYPTED] PASSWORD string USING OLD 
PASSWORD string",
 NULL,
 "See also https://www.monetdb.org/Documentation/SQLreference/Users"},
{"ANALYZE",
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -611,7 +611,7 @@ mat_setop(MalBlkPtr mb, InstrPtr p, matl
return -1;
}
 
-   getArg(s,0) = newTmpVariable(mb, tpe);
+   getArg(s,0) = newTmpVariable(mb, getArgType(mb, 
mat[m].mi, k));

for (j=1; jargc; j++) {
if (overlap(ml, getArg(mat[m].mi, k), 
getArg(mat[n].mi, j), -1, -2, 1)){
diff --git a/sql/ChangeLog.Mar2018 b/sql/ChangeLog.Mar2018
--- a/sql/ChangeLog.Mar2018
+++ b/sql/ChangeLog.Mar2018
@@ -1,3 +1,7 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Tue Nov 28 2017 Sjoerd Mullender 
+- Extended support to use CREATE ORDERED INDEX on columns of type: char,
+  varchar, clob, blob, url, json, inet and uuid.
+
diff --git a/sql/backends/monet5/UDF/capi/capi.c 
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -23,6 +23,11 @@
 #pragma GCC diagnostic ignored "-Wclobbered"
 #endif
 
+const char *mprotect_enableflag = "enable_mprotect";
+static bool option_enable_mprotect = false;
+const char *longjmp_enableflag = "enable_longjmp";
+static bool option_enable_longjmp = false;
+
 struct _allocated_region;
 typedef struct _allocated_region {
struct _allocated_region *next;
@@ -80,6 +85,8 @@ str CUDFprelude(void *ret)
if (!cudf_initialized) {
MT_lock_init(&cache_lock, "cache_lock");
cudf_initialized = true;
+   option_enable_mprotect = GDKgetenv_istrue(mprotect_enableflag) 
|| GDKgetenv_isyes(mprotect_enableflag);
+   option_enable_longjmp = GDKgetenv_istrue(longjmp_enableflag) || 
GDKgetenv_isyes(longjmp_enableflag);
}
return MAL_SUCCEED;
 }
@@ -107,6 +114,7 @@ static void handler(int sig, siginfo_t *
 }
 
 static bool can_mprotect_region(void* addr) {
+   if (!option_enable_mprotect) return false;
int pagesize = getpagesize();
void* page_begin = (void *)((size_t)addr - (size_t)addr % pagesize);
return page_begin == addr;
@@ -160,7 +168,7 @@ static char *clear_mprotect(void *addr, 
 static void *jump_GDK_malloc(size_t size)
 {
void *ptr = GDKmalloc(size);
-   if (!ptr) {
+   if (!ptr && option_enable_longjmp) {
longjmp(jump_buffer[THRgettid()], 2);
}
return ptr;
@@ -211,7 +219,8 @@ static void *wrapped_GDK_zalloc_nojump(s
}   
   \
b = COLnew(0, TYPE_##tpename, count, TRANSIENT);

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-03-15 Thread Sjoerd Mullender
Changeset: ece153d81746 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ece153d81746
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files..

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


MonetDB: default - Merge with Mar2018 branch.

2018-03-15 Thread Sjoerd Mullender
Changeset: f8172279caf6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f8172279caf6
Added Files:
common/utils/ChangeLog-Archive
debian/libmonetdb-client10.install
debian/libmonetdb-stream11.install
debian/libmonetdb16.install
Removed Files:
ChangeLog.Jul2017
buildtools/ChangeLog.Jul2017
clients/ChangeLog.Jul2017
clients/mapilib/ChangeLog.Jul2017
common/stream/ChangeLog.Jul2017
debian/libmonetdb-client9.install
debian/libmonetdb-stream8.install
debian/libmonetdb15.install
gdk/ChangeLog.Jul2017
geom/ChangeLog.Jul2017
monetdb5/ChangeLog.Jul2017
sql/ChangeLog.Jul2017
testing/ChangeLog.Jul2017
tools/merovingian/ChangeLog.Jul2017
Modified Files:
.hgtags
ChangeLog-Archive
ChangeLog.Mar2018
MonetDB.spec
buildtools/ChangeLog-Archive
clients/ChangeLog-Archive
clients/ChangeLog.Mar2018
clients/mapilib/ChangeLog-Archive
clients/mapilib/ChangeLog.Mar2018
common/stream/ChangeLog-Archive
common/stream/ChangeLog.Mar2018
common/utils/ChangeLog.Mar2018
debian/changelog
debian/control
gdk/ChangeLog-Archive
gdk/ChangeLog.Mar2018
libversions
monetdb5/ChangeLog-Archive
monetdb5/ChangeLog.Mar2018
sql/ChangeLog-Archive
sql/ChangeLog.Mar2018
testing/ChangeLog-Archive
testing/ChangeLog.Mar2018
tools/merovingian/ChangeLog-Archive
tools/merovingian/ChangeLog.Mar2018
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1617 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -690,3 +690,5 @@ b9276cb02ced7d98bcb27b5e6df600b2791f1fcd
 4fd4a5c7b66747468a2b41930d1b987a4b0efff4 Jul2017_13
 4fd4a5c7b66747468a2b41930d1b987a4b0efff4 Jul2017_SP4_release
 a294cafd5cac3397e148032bee9d8efc89f5c82a Mar2018_root
+28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_1
+28edc063ceb6a3726af887911a3e4ac4a33c504f Mar2018_release
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,43 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Wed Feb 14 2018 Stefan Manegold  - 11.29.1-20180315
+- mclient's execution time profiling options and output format have
+  been changed. Instead of implicitly via the "--interactive"/"-i"
+  option (or when using an interactive mclient console), execution time
+  profiling is now controlled via an explicit "--timer=timermode"/"-t
+  timermode" command-line option, or a "\t timermode" command in the
+  interactive mclient console. The default (also in the interactive
+  mclient console) is now timermode "none", i.e., no timing information
+  is given. Timermode "clock" activates client-side wall-clock timing
+  ("clk") in "human-friendly" format much like the interactive mode did
+  before. Timermode "performance" also provides detailed server-side
+  timings: "sql" is the time to parse the SQL query, optimize the
+  logical relational plan and create the initial physical (MAL) plan;
+  "opt" is the time to optimize the physical (MAL) plan; "run" is the
+  time to execute the physical (MAL) plan. With timermode "performance"
+  all server-side timings and the client-side wall-clock time are given
+  in milliseconds (ms). Note that the client-measured wall-clock time
+  "clk" is reported per query only when options "--interactive" or
+  "--echo" are used, because only then does mclient send individual
+  lines (statements) of the SQL script to the server. Otherwise, mclient
+  sends the SQL script in large(r) batch(es) to the server, and, thus,
+  only the total wall-clock time per batch is measured and reported. The
+  server-measured detailed performance timings "sql", "opt", "run" are
+  always measured and reported per query. Also, all timing information
+  is now given on a separate line and sent to stderr rather than stdout.
+
+* Fri Feb  9 2018 Sjoerd Mullender  - 11.29.1-20180315
+- Some types and constants were moved from configure (and hence
+  monetdb_config.h) to gdk.h.  In particular, the types "lng" and
+  "ulng" have been moved and can therefore no longer be used by code
+  that doesn't (ultimately) include gdk.h.  Just use int64_t instead.
+  A bunch of format defines have been removed: SZFMT, SSZFMT, PTRFMT,
+  PDFMT.  Just use the C standard codes for those (%zu, %zd, %p, %td).
+  The define for printing a lng (LLFMT) was also moved.  Use PRId64 for
+  printing int64_t in code not using gdk.h.  Removed all references to
+  __int64 and long long (use int64_t instead).
+
 * Thu Apr 13 2017 Mark Raasveldt  - 11.27.1-20170705
 - Added a new server-side protocol implementation. The new protocol
   is backwards compatible with the old protocol. Clients can choose
diff --git a/ChangeLog.Jul2017

MonetDB: default - Merge with Mar2018 branch, not changing any f...

2018-03-15 Thread Sjoerd Mullender
Changeset: f327c7cf27e3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f327c7cf27e3
Modified Files:
MonetDB.spec
NT/monetdb_config.h.in
NT/rules.msc
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
configure.ag
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
vertoo.data
Branch: default
Log Message:

Merge with Mar2018 branch, not changing any files.

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


MonetDB: default - Merge with Mar2018 branch.

2018-03-15 Thread Sjoerd Mullender
Changeset: 08755d3095b2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=08755d3095b2
Modified Files:
configure.ag
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (15 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -743,9 +743,9 @@ AS_VAR_IF([enable_sanitizer], [no], [], 
 AC_SUBST([CFLAGS])
 AC_SUBST([X_CFLAGS])
 
-AC_MSG_CHECKING([for ld -Bsymbolic option])
+AC_MSG_CHECKING([for ld -Bsymbolic-functions option])
 save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
+LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
 AC_LINK_IFELSE([
AC_LANG_SOURCE([[
@%:@include 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-03-15 Thread Sjoerd Mullender
Changeset: dc1d8e991845 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc1d8e991845
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
Modified Files:
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/msc.py
configure.ag
monetdb5/mal/mal_linker.c
sql/ChangeLog.Mar2018
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (131 lines):

diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -208,6 +208,8 @@ def am_additional_libs(name, sep, type, 
 if l[0] not in ("-", "$", "@"):
 l = am_translate_dir(l, am) + ".la"
 if c:
+if c in ('NATIVE_WIN32', 'WIN32'):
+continue
 global libno
 v = 'LIB%d' % libno
 libno = libno + 1
@@ -241,6 +243,8 @@ def am_additional_install_libs(name, sep
 l = l[3:]
 l = 'install-%sLTLIBRARIES' % l
 if c:
+if c in ('NATIVE_WIN32', 'WIN32'):
+continue
 global libno
 v = 'LIB%d' % libno
 libno = libno + 1
diff --git a/buildtools/autogen/autogen/msc.py 
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -209,6 +209,8 @@ def msc_additional_libs(fd, name, sep, t
 for l in list:
 if '?' in l:
 c, l = l.split('?', 1)
+if c in ('NATIVE_WIN32', 'WIN32'):
+c = None
 else:
 c = None
 d = None
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -743,6 +743,30 @@ AS_VAR_IF([enable_sanitizer], [no], [], 
 AC_SUBST([CFLAGS])
 AC_SUBST([X_CFLAGS])
 
+AC_MSG_CHECKING([for ld -Bsymbolic option])
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
+AC_LINK_IFELSE([
+   AC_LANG_SOURCE([[
+   @%:@include 
+   @%:@include 
+   @%:@include 
+
+   @%:@if -_LARGEFILE64_SOURCE - -1 == 1
+   @%:@include 
+   @%:@endif
+   int main(int argc, char **av) {
+   char buf[24];
+   double d = atof("4.2");
+   if (argc == 0 || strchr(av[0], av[0][0]) != NULL)
+   snprintf(buf, sizeof(buf), "%f", d);
+   return 0;
+   }
+   ]])],
+   [result=yes],
+   [LDFLAGS="$save_LDFLAGS"; result=no])
+AC_MSG_RESULT([$result])
+
 # icc needs -fPIC (but the current autoconf still uses -KPIC)
 AS_CASE([$GCC-$CC-$host_os],
[-*icc*-linux*|-*ecc*-linux*], [
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
@@ -34,10 +34,6 @@
 
 #define MAXMODULES 128
 
-#ifndef RTLD_DEEPBIND
-#define RTLD_DEEPBIND 0
-#endif
-
 typedef struct{
str modname;
str fullname;
@@ -107,7 +103,7 @@ getAddress(str fcnname)
 *
 * the first argument must be the same as the base name of the
 * library that is created in src/tools */
-   dl = mdlopen("libmonetdb5", RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND);
+   dl = mdlopen("libmonetdb5", RTLD_NOW | RTLD_GLOBAL);
if (dl == NULL) 
return NULL;
 
@@ -147,7 +143,7 @@ getAddress(str fcnname)
 str
 loadLibrary(str filename, int flag)
 {
-   int mode = RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND;
+   int mode = RTLD_NOW | RTLD_GLOBAL;
char nme[FILENAME_MAX];
void *handle = NULL;
str s;
diff --git a/sql/ChangeLog.Mar2018 b/sql/ChangeLog.Mar2018
--- a/sql/ChangeLog.Mar2018
+++ b/sql/ChangeLog.Mar2018
@@ -30,10 +30,7 @@
   If a database object is dropped, the associated comment is also removed.
   Note: it is not allowed or possible to add comments for temporary tables or
 objects in schema "tmp".
-  The sql catalog has been extended with system table: sys.comments and system
-  views: sys.describe_all_objects and sys.commented_function_signatures. These
-  system views are used by the dump functionality as provided in msqldump and
-  mclient and not intended to be used by users or user applications.
+  The sql catalog has been extended with system table: sys.comments.
   The keyword 'COMMENT' has now become a reserved keyword.
 
 * Thu Dec  7 2017 Martin van Dinther 
diff --git a/sql/test/BugTracker-2018/Tests/All 
b/sql/test/BugTracker-2018/Tests/All
--- a/sql/test/BugTracker-2018/Tests/All
+++ b/sql/test/BugTracker-2018/Tests/All
@@ -35,3 +35,4 @@ sqlitelogictest-groupby-having-not-in.Bu
 sqlitelogictest-nested-case.Bug-6554
 sqlitelogictest-complex-case-extra-columns.Bug-6555
 sqlitelogictest-coalesce-division-by-zero.Bug-6556
+sq

MonetDB: default - Merge with Mar2018 branch.

2018-03-15 Thread Sjoerd Mullender
Changeset: e24594f676af for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e24594f676af
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-coalesce-division-by-zero.Bug-6556.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-extra-columns.Bug-6555.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-extra-columns.Bug-6555.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case-extra-columns.Bug-6555.stable.out
sql/test/BugTracker-2018/Tests/sqlitelogictest-nested-case.Bug-6554.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-nested-case.Bug-6554.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-nested-case.Bug-6554.stable.out
Modified Files:
geom/monetdb5/Makefile.ag
monetdb5/extras/mal_optimizer_template/Makefile.ag
monetdb5/extras/rapi/Makefile.ag
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_linker.c
monetdb5/modules/mal/manifold.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_projectionpath.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_wlc.c
monetdb5/scheduler/run_adder.c
sql/backends/monet5/LSST/Makefile.ag
sql/backends/monet5/Makefile.ag
sql/backends/monet5/UDF/capi/Makefile.ag
sql/backends/monet5/UDF/pyapi/Makefile.ag
sql/backends/monet5/UDF/pyapi3/Makefile.ag
sql/backends/monet5/UDF/udf/Makefile.ag
sql/backends/monet5/generator/Makefile.ag
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/vaults/Makefile.ag
sql/backends/monet5/vaults/bam/Makefile.ag
sql/backends/monet5/vaults/fits/Makefile.ag
sql/backends/monet5/vaults/lidar/Makefile.ag
sql/backends/monet5/vaults/netcdf/Makefile.ag
sql/backends/monet5/vaults/shp/Makefile.ag
sql/include/sql_relation.h
sql/server/rel_select.c
sql/test/BugTracker-2018/Tests/All
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 2320 to 300 lines):

diff --git a/geom/monetdb5/Makefile.ag b/geom/monetdb5/Makefile.ag
--- a/geom/monetdb5/Makefile.ag
+++ b/geom/monetdb5/Makefile.ag
@@ -17,9 +17,9 @@ lib__geom = {
DIR = libdir/monetdb5
SOURCES = geom.h geom.c geomBulk.c geom_upgrade.c
LIBS = ../lib/libgeom \
-  ../../gdk/libbat \
-  ../../common/stream/libstream \
-  ../../monetdb5/tools/libmonetdb5 \
+  NATIVE_WIN32?../../gdk/libbat \
+  NATIVE_WIN32?../../common/stream/libstream \
+  NATIVE_WIN32?../../monetdb5/tools/libmonetdb5 \
   $(GEOS_LIBS) $(PROJ_LIBS)
 }
 
diff --git a/monetdb5/extras/mal_optimizer_template/Makefile.ag 
b/monetdb5/extras/mal_optimizer_template/Makefile.ag
--- a/monetdb5/extras/mal_optimizer_template/Makefile.ag
+++ b/monetdb5/extras/mal_optimizer_template/Makefile.ag
@@ -18,9 +18,9 @@ lib_opt_sql_append = {
DIR = libdir/monetdb5
SEP = _
SOURCES = opt_sql_append.c opt_sql_append.h
-   LIBS = ../../tools/libmonetdb5 \
-   ../../../gdk/libbat \
-   ../../../common/stream/libstream \
+   LIBS = NATIVE_WIN32?../../tools/libmonetdb5 \
+   NATIVE_WIN32?../../../gdk/libbat \
+   NATIVE_WIN32?../../../common/stream/libstream \
$(MALLOC_LIBS)
 }
 
diff --git a/monetdb5/extras/rapi/Makefile.ag b/monetdb5/extras/rapi/Makefile.ag
--- a/monetdb5/extras/rapi/Makefile.ag
+++ b/monetdb5/extras/rapi/Makefile.ag
@@ -29,9 +29,9 @@ lib__rapi = {
DIR = libdir/monetdb5
SOURCES = rapi.c rapi.h converters.c.h
XDEPS = $(libr_LIBDEP)
-   LIBS = ../../tools/libmonetdb5 \
-   ../../../gdk/libbat \
-   $(MALLOC_LIBS) $(libr_LIBS)
+   LIBS = NATIVE_WIN32?../../tools/libmonetdb5 \
+  NATIVE_WIN32?../../../gdk/libbat \
+  $(MALLOC_LIBS) $(libr_LIBS)
 }
 
 headers_rapi_mal = {
diff --git a/monetdb5/mal/mal_builder.c b/monetdb5/mal/mal_builder.c
--- a/monetdb5/mal/mal_builder.c
+++ b/monetdb5/mal/mal_builder.c
@@ -172,7 +172,6 @@ newExitStmt(MalBlkPtr mb, str nme)
}
} else
getArg(q,0) = i;
-pushInstruction(mb, q);
return q;
 }
 
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
@@ -34,6 +34,10 @@
 
 #define MAXMODULES 128
 
+#ifndef RTLD_DEEPBIND
+#define RTLD_DEEPBIND 0
+#endif
+
 typedef struct{
str modname;
str fullname;
@@ -103,7 +107,7 @@ getAddress(str fcnname)
 *
 * the first argument must be the same as the base name of the
 * l

MonetDB: default - Merge with Mar2018 branch.

2018-03-14 Thread Sjoerd Mullender
Changeset: c2d7ddd2809c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c2d7ddd2809c
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case.Bug-6552.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case.Bug-6552.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-in.Bug-6553.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-in.Bug-6553.stable.out
Modified Files:
clients/mapiclient/dump.c
configure.ag
gdk/gdk.h
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_logger.c
gdk/gdk_private.h
gdk/gdk_system.c
gdk/gdk_utils.c
geom/monetdb5/geom.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_profiler.c
monetdb5/modules/atoms/url.c
monetdb5/modules/mal/tablet.c
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/vaults/shp/shp.c
sql/backends/monet5/vaults/vault.c
sql/server/rel_select.c
sql/server/sql_scan.c
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 756 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -38,7 +38,7 @@ quoted_print(stream *f, const char *s, b
break;
default:
if ((0 < *s && *s < 32) || *s == '\177')
-   mnstr_printf(f, "\\%03o", *s & 0377);
+   mnstr_printf(f, "\\%03o", (uint8_t) *s);
else
mnstr_write(f, s, 1, 1);
break;
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -590,10 +590,13 @@ AS_VAR_IF([enable_strict], [yes], [
MCHECK_ADD_FLAG([-Werror-implicit-function-declaration])
 
MCHECK_ADD_FLAG([-Wpointer-arith])
-dnlMCHECK_ADD_FLAG([-Wdeclaration-after-statement])
MCHECK_ADD_FLAG([-Wundef])
MCHECK_ADD_FLAG([-Wformat=2])
+   MCHECK_ADD_FLAG([-Wformat-overflow=1])
+   MCHECK_ADD_FLAG([-Wno-format-truncation])
MCHECK_ADD_FLAG([-Wno-format-nonliteral])
+dnlMCHECK_ADD_FLAG([-Wformat-signedness]) -- numpy messes this up
+   MCHECK_ADD_FLAG([-Wno-cast-function-type])
MCHECK_ADD_FLAG([-Winit-self])
MCHECK_ADD_FLAG([-Winvalid-pch])
MCHECK_ADD_FLAG([-Wmissing-declarations])
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -797,15 +797,15 @@ typedef struct {
 /* assert that atom width is power of 2, i.e., width == 1< %p"   \
" %s[%s:%d]\n", \
-   _path ? _path : "NULL", _mode, _len,\
+   _path ? _path : "NULL", \
+   (unsigned) _mode, _len, \
_res,   \
__func__, __FILE__, __LINE__);  \
_res;   \
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1114,7 +1114,7 @@ headheapinit(oid *hseq, const char *buf,
 }
 
 static int
-heapinit(BAT *b, const char *buf, int *hashash, const char *HT, int 
bbpversion, bat bid, const char *filename)
+heapinit(BAT *b, const char *buf, int *hashash, const char *HT, unsigned 
bbpversion, bat bid, const char *filename)
 {
int t;
char type[11];
@@ -1241,7 +1241,7 @@ vheapinit(BAT *b, const char *buf, int h
 }
 
 static void
-BBPreadEntries(FILE *fp, int bbpversion)
+BBPreadEntries(FILE *fp, unsigned bbpversion)
 {
bat bid = 0;
char buf[4096];
@@ -1369,7 +1369,7 @@ BBPreadEntries(FILE *fp, int bbpversion)
BBP_desc(bid) = bn;
BBP_status(bid) = BBPEXISTING;  /* do we need other status 
bits? */
if ((s = strchr(headname, '~')) != NULL && s == headname) {
-   snprintf(logical, sizeof(logical), "tmp_%o", (int) bid);
+   snprintf(logical, sizeof(logical), "tmp_%o", (unsigned) 
bid);
} else {
if (s)
*s = 0;
@@ -1399,17 +1399,18 @@ BBPreadEntries(FILE *fp, int bbpversion)
 #define SIZEOF_MAX_INT SIZEOF_LNG
 #endif
 
-static int
+static unsigned
 BBPheader(FILE *fp)
 {
char buf[BUFSIZ];
-   int sz, bbpversion, ptrsize, oidsize, intsize;
+   int sz, ptrsize, oidsize, intsize;
+   unsigned bbpve

MonetDB: default - Merge with Mar2018 branch.

2018-03-14 Thread Sjoerd Mullender
Changeset: 04055d064027 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04055d064027
Modified Files:
clients/ChangeLog.Mar2018
clients/mapiclient/tomograph.c
monetdb5/ChangeLog.Mar2018
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (23 lines):

diff --git a/clients/ChangeLog.Mar2018 b/clients/ChangeLog.Mar2018
--- a/clients/ChangeLog.Mar2018
+++ b/clients/ChangeLog.Mar2018
@@ -27,6 +27,6 @@
 - Add a new pretty printing option to stethoscope
   Running stethoscope with the flag -j will produce not pretty printed
   output (one json object per line). Running with the -y flag will produce
-  pretty printed output. Running with neither, wiil produce the legacy,
+  pretty printed output. Running with neither will produce the legacy,
   line oriented format
 
diff --git a/monetdb5/ChangeLog.Mar2018 b/monetdb5/ChangeLog.Mar2018
--- a/monetdb5/ChangeLog.Mar2018
+++ b/monetdb5/ChangeLog.Mar2018
@@ -8,7 +8,7 @@
 * Wed Aug 23 2017 Martin Kersten 
 - The EXPLAIN command now shows all the MAL type resolutions, because in
   general users may not be aware of their signatures.  It also simplifies
-  programs to analyse such plans.
+  programs to analyze such plans.
 
 * Sat Aug 19 2017 Sjoerd Mullender 
 - Implemented versions of group.(sub)group(done) that don't return
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-03-12 Thread Sjoerd Mullender
Changeset: 34eecc7f2810 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=34eecc7f2810
Added Files:
common/utils/ChangeLog.Mar2018

sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.stable.out
sql/test/BugTracker-2018/Tests/sqlitelogictest-complex-case.Bug-6552.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-having-not-in.Bug-6553.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-cast-null.Bug-6551.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-cast-null.Bug-6551.stable.out
sql/test/Dump/Tests/dump-empty.sql
sql/test/emptydb-upgrade-chain-hge/Tests/dump.sql
sql/test/emptydb-upgrade-chain/Tests/dump.sql
sql/test/emptydb-upgrade-hge/Tests/dump.sql
sql/test/emptydb-upgrade/Tests/dump.sql
sql/test/emptydb/Tests/dump.sql
sql/test/testdb-upgrade-chain-hge/Tests/dump.sql
sql/test/testdb-upgrade-chain/Tests/dump.sql
sql/test/testdb-upgrade-hge/Tests/dump.sql
sql/test/testdb-upgrade/Tests/dump.sql
sql/test/testdb/Tests/testdb-dump.sql
Removed Files:
sql/test/Dump/Tests/dump-empty.SQL.py
sql/test/emptydb-upgrade-chain-hge/Tests/dump.SQL.py
sql/test/emptydb-upgrade-chain/Tests/dump.SQL.py
sql/test/emptydb-upgrade-hge/Tests/dump.SQL.py
sql/test/emptydb-upgrade/Tests/dump.SQL.py
sql/test/emptydb/Tests/dump.SQL.py
sql/test/testdb-upgrade-chain-hge/Tests/dump.SQL.py.src
sql/test/testdb-upgrade-chain/Tests/dump.SQL.py.src
sql/test/testdb-upgrade-hge/Tests/dump.SQL.py.src
sql/test/testdb-upgrade/Tests/dump.SQL.py.src
sql/test/testdb/Tests/testdb-dump.SQL.py
testing/trace.py
Modified Files:
ChangeLog.Mar2018
NT/makelibdef.py
NT/mkgeomwxs.py
NT/mkodbcwxs.py
NT/mksqlwxs.py
NT/rules.msc
buildtools/autogen/autogen.py
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/codegen.py
buildtools/autogen/autogen/msc.py
buildtools/conf/fixlicense.py
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
clients/examples/python/basics.py
clients/examples/python/mclient-python2.py
clients/examples/python/sqlsample.py
clients/mapiclient/dotfile.py
clients/mapiclient/mclient.c
clients/mapiclient/stethoscope.c
clients/mapiclient/tachograph.c
clients/mapiclient/tomograph.c
clients/mapilib/ChangeLog.Mar2018
clients/mapilib/mapi.c
clients/mapilib/mapi.h
common/utils/mcrypt.c
common/utils/mcrypt.h
configure.ag
monetdb5/modules/mal/mal_mapi.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_user.c
sql/benchmarks/hist-uva/ground/create.py
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_select.c

sql/test/BugTracker-2009/Tests/parallel_bulk-load.SF-2771052.unpack_csv.py
sql/test/BugTracker-2010/Tests/new-readonly-db.Bug-2695.py
sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.py
sql/test/BugTracker-2014/Tests/acidity-fail.Bug-3635.py
sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py
sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
sql/test/BugTracker-2015/Tests/null.Bug-3833.stable.out
sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out
sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out

sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out.FreeBSD

sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out.Windows

sql/test/BugTracker-2017/Tests/python_loader_clobbers_default_with_null.Bug-6464.stable.err
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.sql

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
sql/test/Dependencies/Tests/dependency_loop.stable.out
sql/test/Dependencies/Tests/dependency_loop.stable.out.int128
sql/test/Tests/keys.stable.out
sql/test/Tests/systemfunct

MonetDB: default - Merge with Mar2018 branch.

2018-03-07 Thread Sjoerd Mullender
Changeset: dd3363bd8503 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dd3363bd8503
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
monetdb5/modules/mal/pcre.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/51_sys_schema_extension.sql
sql/server/sql_parser.y
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.SQL.py
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 2433 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -817,8 +817,17 @@ describe_table(Mapi mid, const char *sch
remark = NULL;
goto bailout;
}
-   if (view)
+   if (view) {
+   /* skip initial comments and empty lines */
+   while ((view[0] == '-' && view[1] == '-') || view[0] == '\n') {
+   view = strchr(view, '\n');
+   if (view == NULL)
+   view = "";
+   else
+   view++;
+   }
view = strdup(view);
+   }
if (remark)
remark = strdup(remark);
mapi_close_handle(hdl);
@@ -1384,17 +1393,17 @@ static int
 dump_function(Mapi mid, stream *toConsole, const char *fid, int hashge)
 {
MapiHdl hdl;
-   size_t qlen = 200 + strlen(fid);
+   size_t qlen = 400 + strlen(fid);
char *query = malloc(qlen);
const char *sep;
-   char *ffunc;
-   const char *sname, *fname;
+   char *ffunc, *flkey;
+   const char *sname, *fname, *ftkey;
int flang, ftype;
 
if (!query)
return 1;
 
-   snprintf(query, qlen, "SELECT f.id, f.func, f.language, f.type, s.name, 
f.name FROM sys.functions f, sys.schemas s WHERE f.schema_id = s.id AND f.id = 
%s", fid);
+   snprintf(query, qlen, "SELECT f.id, f.func, f.language, f.type, s.name, 
f.name, ft.function_type_keyword, fl.language_keyword FROM sys.functions f JOIN 
sys.schemas s ON f.schema_id = s.id JOIN sys.function_types ft ON f.type = 
ft.function_type_id LEFT OUTER JOIN sys.function_languages fl ON f.language = 
fl.language_id WHERE f.id = %s", fid);
hdl = mapi_query(mid, query);
if (mapi_fetch_row(hdl) == 0) {
free(query);
@@ -1406,40 +1415,28 @@ dump_function(Mapi mid, stream *toConsol
ftype = atoi(mapi_fetch_field(hdl, 3));
sname = mapi_fetch_field(hdl, 4);
fname = mapi_fetch_field(hdl, 5);
+   ftkey = mapi_fetch_field(hdl, 6);
+   flkey = mapi_fetch_field(hdl, 7);
if (flang == 1 || flang == 2) {
-   /* all information is stored in the func column */
+   /* all information is stored in the func column
+* first skip initial comments and empty lines */
+   while ((ffunc[0] == '-' && ffunc[1] == '-') || ffunc[0] == 
'\n') {
+   ffunc = strchr(ffunc, '\n');
+   if (ffunc == NULL)
+   ffunc = "";
+   else
+   ffunc++;
+   }
mnstr_printf(toConsole, "%s\n", ffunc);
mapi_close_handle(hdl);
free(query);
return 0;
}
-   mnstr_printf(toConsole, "CREATE ");
-   switch (ftype) {
-   case 1: /* scalar function */
-   case

MonetDB: default - Merge with Mar2018 branch.

2018-03-06 Thread Sjoerd Mullender
Changeset: 0816b84fbfad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0816b84fbfad
Added Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
Removed Files:
sql/scripts/97_comments.sql
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
configure.ag
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/51_sys_schema_extension.sql
sql/scripts/99_system.sql
sql/scripts/Makefile.ag
sql/storage/bat/bat_table.c

sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/All
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/All
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/All
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/All
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
testing/README
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 19756 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1307,9 +1307,21 @@ dump_function_comment(Mapi mid, stream *
return 1;
 
snprintf(query, len,
-   "SELECT category, schema, name, type, type_digits, type_scale, 
remark "
-   "FROM sys.commented_function_signatures "
-   "WHERE fid = %s "
+   "SELECT \n"
+   "coalesce(function_type_keyword, '') AS category,\n"
+   "s.name AS schema,\n"
+   "CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number 
ASC) WHEN 1 THEN f.name ELSE NULL END AS name,\n"
+   "p.type, \n"
+   "p.type_digits, \n"
+   "p.type_scale,\n"
+   "CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number 
DESC) WHEN 1 THEN c.remark ELSE NULL END AS remark,\n"
+   "ROW_NUMBER() OVER (ORDER BY f.id, p.number) AS line\n"
+   "FROM sys.functions f\n"
+   "JOIN sys.comments c ON f.id = c.id\n"
+   "JOIN sys.schemas s ON f.schema_id = s.id\n"
+   "LEFT OUTER JOIN sys.function_types ft ON f.type = 
ft.function_type_id\n"
+   "LEFT OUTER JOIN sys.args p ON f.id = p.func_id AND p.inout = 
1\n"
+   "WHERE f.id = %s\n"
"ORDER BY line;", id);
 
hashge = has_hugeint(mid);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2192,7 +2192,6 @@ showCommands(void)
mnstr_printf(toConsole, "\\q  - terminate session\n");
 }
 
-/* These values must match those used in view sys.describe_all_objects */
 #define MD_TABLE1
 #define MD_VIEW 2
 #define MD_SEQ  4
@@ -2540,7 +2539,59 @@ doFile(Mapi mid, stream *fp, bool useins
 #endif
} else {
/* get all object names in 
current schema */
-   size_t len = 500 + strlen(line);
+   char *with_clause = 
+   "WITH 
describe_all_objects AS (\n"
+   "  SELECT s.name AS 
sname,\n"
+   "  t.name,\n"
+   "  s.name

MonetDB: default - Merge with Mar2018 branch.

2018-03-05 Thread Sjoerd Mullender
Changeset: 4cf7f79098d8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4cf7f79098d8
Added Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-cast-null.Bug-6551.sql
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_cat.h
sql/backends/monet5/sql_upgrades.c
sql/include/sql_relation.h
sql/scripts/97_comments.sql
sql/server/sql_mvc.c
sql/server/sql_privileges.c
sql/test/BugTracker-2018/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 860 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
@@ -10810,8 +10810,6 @@ Ready.
 [ "sql",   "copy_from","pattern sql.copy_from(t:ptr, sep:str, 
rsep:str, ssep:str, ns:str, fname:str, nr:lng, offset:lng, locked:int, 
best:int, fwf:str):bat[:any]... ","mvc_import_table_wrap;",   
"Import a table from bstream s with the \n\tgiven tuple and seperators 
(sep/rsep)"  ]
 [ "sql",   "copy_rejects", "pattern sql.copy_rejects() (rowid:bat[:lng], 
fldid:bat[:int], msg:bat[:str], inp:bat[:str]) ", "COPYrejects;", ""  ]
 [ "sql",   "copy_rejects_clear",   "pattern sql.copy_rejects_clear():void 
",   "COPYrejects_clear;",   ""  ]
-[ "sql",   "create_func_upgrade_oct2014",  "pattern 
sql.create_func_upgrade_oct2014(sname:str, f:str):int ",   
"UPGcreate_func;",  "Create the function described by f, needed for the 
Oct2014 upgrade"]
-[ "sql",   "create_view_upgrade_oct2014",  "pattern 
sql.create_view_upgrade_oct2014(sname:str, v:str):int ",   
"UPGcreate_view;",  "Create the view described by f, needed for the Oct2014 
upgrade"]
 [ "sql",   "createorderindex", "pattern sql.createorderindex(sch:str, 
tbl:str, col:str):void ","sql_createorderindex;","Instantiate 
the order index on a column"   ]
 [ "sql",   "current_time", "pattern sql.current_time():daytime ",  
"SQLcurrent_daytime;",  "Get the clients current daytime"   ]
 [ "sql",   "current_timestamp","pattern 
sql.current_timestamp():timestamp ",   "SQLcurrent_timestamp;","Get the 
clients current timestamp" ]
@@ -10828,7 +10826,6 @@ Ready.
 [ "sql",   "dense_rank",   "pattern sql.dense_rank(b:any_1, p:bit, 
o:bit):int ",   "SQLdense_rank;",   "return the densely ranked groups"  
]
 [ "sql",   "diff", "pattern sql.diff(b:any_1):bit ",   "SQLdiff;", 
"return true if cur != prev row"]
 [ "sql",   "diff", "pattern sql.diff(p:bit, b:any_1):bit ",
"SQLdiff;", "return true if cur != prev row"]
-[ "sql",   "drop_func_upgrade_oct2014","pattern 
sql.drop_func_upgrade_oct2014(id:int):int ",   "UPGdrop_func;","Drop 
the function identified by id, needed for the Oct2014 upgrade"]
 [ "sql",   "drop_hash","pattern sql.drop_hash(sch:str, tbl:str):void 
","SQLdrop_hash;","Drop hash indices for the given table" ]
 [ "sql",   "droporderindex",   "pattern sql.droporderindex(sch:str, 
tbl:str, col:str):void ",  "sql_droporderindex;",  "Drop the order index on a 
column

MonetDB: default - Merge with Mar2018 branch.

2018-02-28 Thread Sjoerd Mullender
Changeset: 7d93776ac912 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d93776ac912
Added Files:
clients/odbc/driver/ODBCQueries.h
Modified Files:
clients/ChangeLog.Mar2018
clients/odbc/driver/Makefile.ag
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/SQLColumnPrivileges.c
clients/odbc/driver/SQLColumns.c
clients/odbc/driver/SQLConnect.c
clients/odbc/driver/SQLDisconnect.c
clients/odbc/driver/SQLGetFunctions.c
clients/odbc/driver/SQLGetInfo.c
clients/odbc/driver/SQLProcedureColumns.c
clients/odbc/driver/SQLProcedures.c
clients/odbc/driver/SQLSpecialColumns.c
clients/odbc/driver/SQLTablePrivileges.c
clients/odbc/driver/SQLTables.c
monetdb5/modules/mal/Tests/remote13.stable.err
monetdb5/modules/mal/Tests/remote13.stable.out
sql/common/sql_keyword.c
sql/server/rel_schema.c
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/storage/store.c
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.stable.err

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.out
sql/test/mergetables/Tests/alter.stable.err
testing/Mtest.py.in
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 2174 to 300 lines):

diff --git a/clients/ChangeLog.Mar2018 b/clients/ChangeLog.Mar2018
--- a/clients/ChangeLog.Mar2018
+++ b/clients/ChangeLog.Mar2018
@@ -1,6 +1,9 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Wed Feb 28 2018 Sjoerd Mullender 
+- ODBC: The driver function SQLProcedureColumns was implemented.
+
 * Thu Feb  1 2018 Sjoerd Mullender 
 - ODBC: Changed table types as used by SQLTables from "LOCAL TEMPORARY"
   and "GLOBAL TEMPORARY" to "LOCAL TEMPORARY TABLE" and "GLOBAL TEMPORARY
diff --git a/clients/odbc/driver/Makefile.ag b/clients/odbc/driver/Makefile.ag
--- a/clients/odbc/driver/Makefile.ag
+++ b/clients/odbc/driver/Makefile.ag
@@ -24,6 +24,7 @@ lib_MonetODBC = {
ODBCError.c \
ODBCError.h \
ODBCGlobal.h \
+   ODBCQueries.h \
ODBCStmt.c \
ODBCStmt.h \
ODBCUtil.c \
diff --git a/clients/odbc/driver/ODBCDbc.c b/clients/odbc/driver/ODBCDbc.c
--- a/clients/odbc/driver/ODBCDbc.c
+++ b/clients/odbc/driver/ODBCDbc.c
@@ -66,7 +66,8 @@ newODBCDbc(ODBCEnv *env)
dbc->port = 0;
dbc->dbname = NULL;
 
-   dbc->Connected = 0;
+   dbc->Connected = false;
+   dbc->has_comment = false;
dbc->sql_attr_autocommit = SQL_AUTOCOMMIT_ON;   /* default is 
autocommit */
dbc->sql_attr_metadata_id = SQL_FALSE;
dbc->sql_attr_connection_timeout = 0;
diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h
--- a/clients/odbc/driver/ODBCDbc.h
+++ b/clients/odbc/driver/ODBCDbc.h
@@ -53,7 +53,8 @@ typedef struct tODBCDRIVERDBC {
char *host; /* Server host */
int port;   /* Server port */
char *dbname;   /* Database Name or NULL */
-   int Connected;  /* 1 is Yes, 0 is No */
+   bool Connected; /* whether we are connecte to a server */
+   bool has_comment;   /* whether the server has sys.comments */
SQLUINTEGER sql_attr_autocommit;
SQLUINTEGER sql_attr_metadata_id;
SQLUINTEGER sql_attr_connection_timeout;
diff --git a/clients/odbc/driver/ODBCQueries.h 
b/clients/odbc/driver/ODBCQueries.h
new file mode 100644
--- /dev/null
+++ b/clients/odbc/driver/ODBCQueries.h
@@ -0,0 +1,292 @@
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * Copyright 1997 - July 2008 CWI, August 2008 - 2018 MonetDB B.V.
+ */
+
+/* this file contains parts of queries that are used in multiple
+ * places */
+
+#define DATA_TYPE(t)   \
+   "case " #t ".type " \
+"when 'bigint' then %d "   \
+"when 'blob' then %d " \
+"when 'boolean' then %d "  \
+"when 'char' then %d " \
+"when 'clob' then %d " \
+"when 'date' then %d " \
+"when 'decimal' then %d "  \
+"when 'double' then %d "   \
+"when 'hugeint' then %d "  \
+"when 'int' then %d "  \
+"when 'month_interval' then "  \
+  

MonetDB: default - Merge with Mar2018 branch.

2018-02-26 Thread Sjoerd Mullender
Changeset: 8d0d2eb50794 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8d0d2eb50794
Added Files:
sql/test/Users/Tests/grantAndRevokeUserLoggedIN.Bug-3476.SQL.py
sql/test/Users/Tests/grantAndRevokeUserLoggedIN.Bug-3476.stable.err
sql/test/Users/Tests/grantAndRevokeUserLoggedIN.Bug-3476.stable.out
Removed Files:
sql/test/Users/Tests/grantAndRevokeUserLogedIN.Bug-3476.SQL.py
sql/test/Users/Tests/grantAndRevokeUserLogedIN.Bug-3476.stable.err
sql/test/Users/Tests/grantAndRevokeUserLogedIN.Bug-3476.stable.out
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_private.h
gdk/gdk_project.c
gdk/gdk_qsort.c
gdk/gdk_select.c
gdk/gdk_ssort_impl.h
sql/backends/monet5/sql_upgrades.c
sql/server/rel_schema.c
sql/storage/store.c
sql/test/Users/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1289 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -253,8 +253,8 @@ gdk_return GDKmmapfile(str buffer, size_
 int GDKms(void);
 int GDKnr_threads;
 void GDKprepareExit(void);
-void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, int ts, 
int tpe);
-void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int hs, int 
ts, int tpe);
+void GDKqsort(void *restrict h, void *restrict t, const void *restrict base, 
size_t n, int hs, int ts, int tpe);
+void GDKqsort_rev(void *restrict h, void *restrict t, const void *restrict 
base, size_t n, int hs, int ts, int tpe);
 void *GDKrealloc(void *pold, size_t size) 
__attribute__((__warn_unused_result__));
 void GDKregister(MT_Id pid);
 gdk_return GDKreleasemmap(void *ptr, size_t size, size_t id, str *msg);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1467,8 +1467,8 @@ gdk_export gdk_return BATsort(BAT **sort
__attribute__ ((__warn_unused_result__));
 
 
-gdk_export void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, 
int ts, int tpe);
-gdk_export void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int 
hs, int ts, int tpe);
+gdk_export void GDKqsort(void *restrict h, void *restrict t, const void 
*restrict base, size_t n, int hs, int ts, int tpe);
+gdk_export void GDKqsort_rev(void *restrict h, void *restrict t, const void 
*restrict base, size_t n, int hs, int ts, int tpe);
 
 #define BATtordered(b) ((b)->ttype == TYPE_void || (b)->tsorted)
 #define BATtrevordered(b) (((b)->ttype == TYPE_void && 
is_oid_nil((b)->tseqbase)) || (b)->trevsorted)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1278,7 +1278,7 @@ BATordered_rev(BAT *b)
  * stable sort can produce an error (not enough memory available),
  * "quick" sort does not produce errors */
 static gdk_return
-do_sort(void *h, void *t, const void *base, size_t n, int hs, int ts, int tpe,
+do_sort(void *restrict h, void *restrict t, const void *restrict base, size_t 
n, int hs, int ts, int tpe,
int reverse, int stable)
 {
if (n <= 1) /* trivially sorted */
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -141,10 +141,10 @@ void BBPdump(void);   /* never called: fo
 __hidden gdk_return GDKsave(int farmid, const char *nme, const char *ext, void 
*buf, size_t size, storage_t mode, int dosync)
__attribute__((__warn_unused_result__))
__attribute__((__visibilit

MonetDB: default - Merge with Mar2018 branch.

2018-02-23 Thread Sjoerd Mullender
Changeset: a05b340c0496 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a05b340c0496
Added Files:
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.sql
Removed Files:
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.SQL.py
Modified Files:
clients/mapiclient/mclient.c
gdk/gdk.h
gdk/gdk_batop.c
monetdb5/mal/mal_readline.c
sql/test/BugTracker/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 454 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -71,11 +71,11 @@ static stream *fromConsole = NULL;
 static char *language = NULL;
 static char *logfile = NULL;
 static char promptbuf[16];
-static int echoquery = 0;
+static bool echoquery = false;
 #ifdef HAVE_ICONV
 static char *encoding;
 #endif
-static int errseen = 0;
+static bool errseen = false;
 
 #define setPrompt() sprintf(promptbuf, "%.*s>", (int) sizeof(promptbuf) - 2, 
language)
 #define debugMode() (strncmp(promptbuf, "mdb", 3) == 0)
@@ -94,7 +94,7 @@ enum formatters {
 };
 static enum formatters formatter = NOformatter;
 char *separator = NULL;/* column separator for CSV/TAB format 
*/
-int csvheader = 0; /* include header line in CSV format */
+bool csvheader = false;/* include header line in CSV format */
 
 #define DEFWIDTH 80
 
@@ -123,9 +123,9 @@ static char *pager = 0; /* use external
 #endif
 static int rowsperpage = 0;/* for SQL pagination */
 static int pagewidth = 0;  /* -1: take whatever is necessary, >0: limit */
-static int pagewidthset = 0;   /* whether the user set the width explicitly */
+static bool pagewidthset = false; /* whether the user set the width explicitly 
*/
 static int croppedfields = 0;  /* whatever got cropped/truncated */
-static char firstcrop = 1; /* first time we see cropping/truncation */
+static bool firstcrop = true;  /* first time we see cropping/truncation */
 
 enum modifiers {
NOmodifier,
@@ -259,13 +259,13 @@ static enum itimers {
T_PERF  // return detailed performance
 } timermode = T_NONE;
 
-static int timerHumanCalled = 0;
+static bool timerHumanCalled = false;
 static void
 timerHuman(int64_t sqloptimizer, int64_t maloptimizer, int64_t querytime, int 
singleinstr, int total)
 {
timertype t = th - t0;
 
-   timerHumanCalled = 1;
+   timerHumanCalled = true;
 
/*
 * report only the times we do actually measure:
@@ -571,7 +571,8 @@ utf8skip(char *s, size_t i)
 static int
 SQLrow(int *len, int *numeric, char **rest, int fields, int trim, char wm)
 {
-   int i, more, first = 1;
+   int i;
+   bool more, first = true;
char *t;
int rows = 0;   /* return number of output lines printed */
size_t ulen;
@@ -598,7 +599,7 @@ SQLrow(int *len, int *numeric, char **re
cutafter[i] = -1;
 
do {
-   more = 0;
+   more = false;
for (i = 0; i < fields; i++) {
if (rest[i] == NULL || *rest[i] == 0) {
mnstr_printf(toConsole, "%c %*s ",
@@ -697,7 +698,7 @@ SQLrow(int *len, int *numeric, char **re
if (cutafter[i] == 0)
rest[i] = NULL;
if (rest[i])
-   more = 1;
+   more = true;
} else {
mnstr_printf(toConsole, "%c",
 first ? '|' : i > 0 && 
cutafter[i - 1] == 0 ? '>' : ':');
@@ -736,7 +737,7 @@ SQLrow(int *len, int *numeric, char **re
mnstr_printf(toConsole, "%c%s\n",
 first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' 
: ':',
 wm ? ">" : "");
-   first = 0;
+   first = false;
rows++;
} while (more);
 
@@ -1667,8 +1668,8 @@ SQLrenderer(MapiHdl hdl)
   croppedfields, croppedfields != 1 ? "s" : "");
if (fields != printfields || croppedfields > 0) {
mnstr_printf(toConsole, "!");
-   if (firstcrop == 1) {
-   firstcrop = 0;
+   if (firstcrop) {
+   firstcrop = false;
mnstr_printf(toConsole, "\nnote: to disable dropping 
columns and/or truncating fields use \\w-1");
}
}
@@ -1686,7 +1687,7 @@ setFormatter(const char *s)
if (separator)
free(separator);
separator = NULL;
-   csvheader = 0;
+   csvheader = false;
 #ifdef _TWO_DIGIT_EXPONENT
if (format

MonetDB: default - Merge with Mar2018 branch.

2018-02-23 Thread Sjoerd Mullender
Changeset: e13866a018c8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e13866a018c8
Added Files:
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out
sql/test/BugTracker-2018/Tests/truncate_add_user.sql
sql/test/BugTracker-2018/Tests/truncate_add_user.stable.err
sql/test/BugTracker-2018/Tests/truncate_add_user.stable.out
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.reqtests
sql/test/BugTracker-2018/Tests/truncate_remove_user.sql
sql/test/BugTracker-2018/Tests/truncate_remove_user.stable.err
sql/test/BugTracker-2018/Tests/truncate_remove_user.stable.out

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.reqtests
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.reqtests
Removed Files:
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Darwin
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.FreeBSD
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Windows
Modified Files:
clients/mapiclient/mclient.c
clients/odbc/setup/drvcfg.h
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/modules/mal/pcre.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/vaults/bam/85_bam.sql
sql/backends/monet5/vaults/netcdf/74_netcdf.sql
sql/scripts/97_comments.sql
sql/server/rel_schema.c
sql/server/rel_updates.c
sql/test/BugTracker-2016/Tests/storagemodel.sql
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
sql/test/BugTracker-2018/Tests/All
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.sql

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/Tests/comment-auth.stable.err
sql/test/Tests/comment-auth.stable.out
sql/test/Tests/comment-on.stable.out
sql/test/Tests/systemfunctions.stable.out
sql/test/Tests/systemfunctions.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 3589 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1414,7 +1414,7 @@ SQLdebugRendering(MapiHdl hdl)
 }
 
 static void
-SQLpagemove(int *len, int fields, int *ps, int *silent)
+SQLpagemove(int *len, int fields, int *ps, bool *silent)
 {
char buf[512];
ssize_t sz;
@@ -1427,11 +1427,11 @@ SQLpagemove(int *len, int fields, int *p
if (buf[0] == 'c')
*ps = 0;
if (buf[0] == 'q')
-   *silent = 1;
+   *silent = true;
while (sz > 0 && buf[sz - 1] != '\n')
sz = mnstr_readline(fromConsole, buf, sizeof(buf));
}
-   if (*silent == 0)
+   if (!*silent)
SQLseparator(len, fields, '-');
 }
 
@@ -1443,7 +1443,8 @@ SQLrenderer(MapiHdl hdl)
int *len = NULL, *hdr = NULL, *numeric = NULL;
char **rest = NULL;
char buf[50];
-   int ps = rowsperpage, silent = 0;
+   int ps = rowsperpage;
+ 

MonetDB: default - Merge with Mar2018 branch.

2018-02-19 Thread Sjoerd Mullender
Changeset: 5d01b8c0cd97 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d01b8c0cd97
Added Files:
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.err
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-in-cast-null.Bug-6529.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-in-cast-null.Bug-6529.stable.out
sql/test/BugTracker-2018/Tests/sqlitelogictest-in-query.Bug-6545.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-in-with-division.Bug-6546.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-not-in-wrong-results.Bug-6530.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-not-in-wrong-results.Bug-6530.stable.out
Modified Files:
gdk/gdk_atomic.h
monetdb5/modules/mal/mkey.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_optimizer.c
sql/backends/monet5/sql_optimizer.h
sql/backends/monet5/sql_upgrades.c
sql/scripts/97_comments.sql
sql/server/rel_optimizer.c
sql/server/rel_select.c
sql/test/BugTracker-2018/Tests/All

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1207 to 300 lines):

diff --git a/gdk/gdk_atomic.h b/gdk/gdk_atomic.h
--- a/gdk/gdk_atomic.h
+++ b/gdk/gdk_atomic.h
@@ -24,7 +24,7 @@
  * ATOMIC_INC -- increment a variable's value, return new value;
  * ATOMIC_DEC -- decrement a variable's value, return new value;
  * These interfaces work on variables of type ATOMIC_TYPE
- * (int or lng depending on architecture).
+ * (int or int64_t depending on architecture).
  *
  * In addition, the following operations are defined:
  * ATOMIC_TAS -- test-and-set: set variable to "true" and return old value
@@ -67,9 +67,9 @@
 
 #include 
 
-#if SIZEOF_SSIZE_T == SIZEOF_LNG
+#if SIZEOF_SSIZE_T == 8
 
-#define ATOMIC_TYPElng
+#define ATOMIC_TYPEint64_t
 
 #define ATOMIC_GET(var, lck)   var
 #define ATOMIC_SET(var, val, lck)  _InterlockedExchange64(&var, (val))
@@ -110,10 +110,10 @@
 #define ATOMIC_TAS(var, lck)   _InterlockedCompareExchange(&var, 1, 0)
 #pragma intrinsic(_InterlockedCompareExchange)
 
-#elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) 
&& SIZEOF_SIZE_T == SIZEOF_LNG) && !defined(_MSC_VER) && 
!defined(NO_ATOMIC_INSTRUCTIONS)
+#elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) 
&& SIZEOF_SIZE_T == 8) && !defined(_MSC_VER) && !defined(NO_ATOMIC_INSTRUCTIONS)
 
-#if SIZEOF_SSIZE_T == SIZEOF_LNG
-#define ATOMIC_TYPElng
+#if SIZEOF_SSIZE_T == 8
+#define ATOMIC_TYPEint64_t
 #else
 #define ATOMIC_TYPEint
 #endif
@@ -154,8 +154,8 @@
 
 #else
 
-#if SIZEOF_SSIZE_T == SIZEOF_LNG
-#define ATOMIC_TYPElng
+#if SIZEOF_SSIZE_T == 8
+#define ATOMIC_TYPEint64_t
 #else
 #define ATOMIC_TYPEint
 #endif
diff --git a/monetdb5/modules/mal/mkey.c b/monetdb5/modules/mal/mkey.c
--- a/monetdb5/modules/mal/mkey.c
+++ b/monetdb5/modules/mal/mkey.c
@@ -357,7 +357,7 @@ MKEYbulk_rotate_xor_hash(bat *res, const
BATkey(bn, 0);
bn->tsorted = bn->trevsorted = 0;
}
-   bn->tnonil = 1;
+   bn->tnonil = 0;
bn->tnil = 0;
 
BBPkeepref(*res = bn->batCacheid);
@@ -439,7 +439,7 @@ MKEYbulkconst_rotate_xor_hash(Client cnt
BATkey(bn, 0);
bn->tsorted = bn->trevsorted = 0;
}
-   bn->tnonil = 1;
+   bn->tnonil = 0;

MonetDB: default - Merge with Mar2018 branch.

2018-02-16 Thread Sjoerd Mullender
Changeset: b6c4f7029651 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b6c4f7029651
Modified Files:
gdk/gdk_join.c
monetdb5/optimizer/opt_candidates.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_optimizer.c
sql/backends/monet5/sql_optimizer.h
sql/server/rel_updates.c

sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.stable.out

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.stable.err

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.stable.out
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.out
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/mapi/Tests/utf8test.SQL.py
sql/test/mapi/Tests/utf8test.stable.out
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1352 to 300 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -19,13 +19,11 @@
  * first two arguments.  The join operations differ in the way in
  * which tuples from the two inputs are matched.
  *
- * All inputs BATs must be dense headed, the output BATs will also be
- * dense headed.  The outputs consist of two aligned BATs (i.e. same
- * length and same seqbase in the head column (0@0)) that contain in
- * their tails the OIDs of the input BATs that match.  The candidate
- * lists, if given, contain in their tail the OIDs of the associated
+ * The outputs consist of two aligned BATs (i.e. same length and same
+ * hseqbase (0@0)) that contain the OIDs of the input BATs that match.
+ * The candidate lists, if given, contain the OIDs of the associated
  * input BAT which must be considered for matching.  The input BATs
- * must have the same tail type.
+ * must have the same type.
  *
  * All functions also have a parameter nil_matches which indicates
  * whether NIL must be considered an ordinary value that can match, or
@@ -86,7 +84,7 @@ joinparamcheck(BAT *l, BAT *r1, BAT *r2,
}
if ((sl && ATOMtype(sl->ttype) != TYPE_oid) ||
(sr && ATOMtype(sr->ttype) != TYPE_oid)) {
-   GDKerror("%s: candidate lists must have OID tail.\n", func);
+   GDKerror("%s: candidate lists must have type OID.\n", func);
return GDK_FAIL;
}
if ((sl && !BATtordered(sl)) ||
@@ -313,10 +311,10 @@ mergejoin_void(BAT *r1, BAT *r2, BAT *l,
const oid *lvals;
oid o, seq;
 
-   /* r has a dense tail, and if there is a candidate list, it
-* too is dense.  This means we don't have to do any searches,
-* we only need to compare ranges to know whether a value from
-* l has a match in r */
+   /* r is dense, and if there is a candidate list, it too is
+* dense.  This means we don't have to do any searches, we
+* only need to compare ranges to know whether a value from l
+* has a match in r */
assert(ATOMtype(l->ttype) == ATOMtype(r->ttype));
assert(r->tsorted || r->trevsorted);
assert(sl == NULL || sl->tsorted);
@@ -339,9 +337,8 @@ mergejoin_void(BAT *r1, BAT *r2, BAT *l,
}
/* at this point, the matchable values in r are [lo..hi) */
if (BATtdense(l)) {
-   /* if l has a dense tail, we can further restrict the
-* [lo..hi) range to values in l that match with
-* values in r */
+   /* if l is dense, we can further restrict the [lo..hi)
+* range to values in l that match with values in r */
i = hi - lo;/* remember these for nil_on_miss case below */
o = lo;
if (l->tseqbase > lo)
@@ -349,13 +346,13 @@ mergejoin_void(BAT *r1, BAT *r2, BAT *l,
if (l->tseqbase + BATcount(l) < hi)
hi = l->tseqbase + BATcount(l);
if (sl == NULL || BATtdense(sl)) {
-   /* l has a dense tail, and so does the left
-* candidate list (if it exists); this means
-* we don't have to actually look at any
-* values in l: we can just do some
-* arithmetic; it also means that r1 will be
-* dense, and if nil_on_miss is not set, or if
-* all values in l match, r2 will too */
+   /* l is dense, and so is the left c

MonetDB: default - Merge with Mar2018 branch.

2018-02-16 Thread Sjoerd Mullender
Changeset: c711df1cde84 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c711df1cde84
Added Files:

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.sql

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.err

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.sql
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.stable.out
sql/test/BugTracker-2018/Tests/truncate_empty_table.Bug-6544.sql
sql/test/BugTracker-2018/Tests/truncate_empty_table.Bug-6544.stable.err
sql/test/BugTracker-2018/Tests/truncate_empty_table.Bug-6544.stable.out
sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.sql

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.stable.err

sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.stable.out
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.sql
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.err
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.stable.out
Modified Files:
clients/Tests/exports.stable.out
clients/mapiclient/mclient.c
clients/mapiclient/mhelp.c
gdk/ChangeLog.Mar2018
gdk/gdk.h
gdk/gdk_aggr.c
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_storage.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mdb.c
sql/ChangeLog.Mar2018
sql/backends/monet5/sql_fround_impl.h
sql/backends/monet5/sql_round_impl.h
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
sql/storage/bat/bat_utils.c
sql/test/BugTracker-2018/Tests/All
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 2189 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -159,7 +159,7 @@ BAT *BATproject(BAT *l, BAT *r);
 BAT *BATprojectchain(BAT **bats);
 gdk_return BATrangejoin(BAT **r1p, BAT **r2p, BAT *l, BAT *rl, BAT *rh, BAT 
*sl, BAT *sr, int li, int hi, BUN estimate) 
__attribute__((__warn_unused_result__));
 gdk_return BATreplace(BAT *b, BAT *p, BAT *n, bit force) 
__attribute__((__warn_unused_result__));
-void BATroles(BAT *b, const char *tnme);
+gdk_return BATroles(BAT *b, const char *tnme);
 BAT *BATsample(BAT *b, BUN n);
 BAT *BATselect(BAT *b, BAT *s, const void *tl, const void *th, int li, int hi, 
int anti);
 gdk_return BATsemijoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, 
int nil_matches, BUN estimate) __attribute__((__warn_unused_result__));
@@ -479,7 +479,7 @@ size_t strLen(const char *s);
 int strNil(const char *s);
 const char str_nil[2];
 gdk_return void_inplace(BAT *b, oid id, const void *val, bit force) 
__attribute__((__warn_unused_result__));
-BUN void_replace_bat(BAT *b, BAT *p, BAT *u, bit force) 
__attribute__((__warn_unused_result__));
+gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bit force) 
__attribute__((__warn_unused_result__));
 int win_mkdir(const char *, const int mode);
 int win_rename(const char *, const char *);
 int win_rmdir(const char *);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -301,12 +301,10 @@ timerHuman(int64_t sqloptimizer, int64_t
fflush(stderr);
return;
}
-   if (timermode == T_PERF) {
+   if (timermode == T_PERF && ((!singleinstr != !total) || !total)) {
/* for performance measures we use milliseconds as the base */
-   if ((!singleinstr != !total) || !total) {
-   fflush(stderr);
-   mnstr_flush(toConsole);
-   }
+   fflush(stderr);
+   mnstr_flush(toConsole);
if (!total)
fprintf(stderr, "sql:%" PRId64 ".%03d opt:%" PRId64 
".%03d run:%" PRId64 ".%03d ",
 sqloptimizer / 1000, (int) (sqloptimizer % 
1000),
@@ -314,10 +312,8 @@ timerHuman(int64_t sqloptimizer, int64_t
 querytime / 1000, (int) (querytime % 1000));
if (!singleinstr != !total)
fprintf(stderr, "clk:%" PRId64 ".%03d ", t / 1000, 
(int) (t % 1000));
-   if ((!singleinstr != !total) || !total) {
-   fprintf(stderr, "ms\n"

MonetDB: default - Merge with Mar2018 branch.

2018-02-14 Thread Sjoerd Mullender
Changeset: 45336a8d22d3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=45336a8d22d3
Modified Files:
ChangeLog.Mar2018
clients/Tests/mclient-uri.SQL.bat
clients/Tests/mclient-uri.SQL.sh
clients/mapiclient/Tests/mclient--help.stable.err
clients/mapiclient/Tests/mclient--help.stable.err.Windows
clients/mapiclient/mclient.1
clients/mapiclient/mclient.c
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_logger.c

sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe-mclient.SF-1146092.SQL.bat

sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe-mclient.SF-1146092.SQL.sh

sql/test/BugTracker-2018/Tests/sqlitelogictest-group-by-having-in-count.Bug-6524.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-group-by-having-in-count.Bug-6524.stable.out
sql/test/pg_regress/Tests/float8.stable.err
testing/README
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 811 to 300 lines):

diff --git a/ChangeLog.Mar2018 b/ChangeLog.Mar2018
--- a/ChangeLog.Mar2018
+++ b/ChangeLog.Mar2018
@@ -1,6 +1,32 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Wed Feb 14 2018 Stefan Manegold 
+- mclient's executing time profiling options and output format have
+  been changed. Instead of implicitly via the "--interactive"/"-i"
+  option (or when using and interactive mclient console), execution time
+  profiling is now controlled via an explicit "--timer=timermode"/"-t
+  timermode" command-line option, or a "\t timermode" command in the
+  interactive mclient console. The default (also in the interactive
+  mclient console) is now timermode "none", i.e., no timing information
+  is given. Timermode "clock" activates client-side wall-clock timing
+  ("clk") in "human-friendly" format much like the interactive mode did
+  before. Timermode "performance" also provides detailed server-side
+  timings: "sql" is the time to parse the SQL query, optimize the
+  logical relational plan and create the initial physical (MAL) plan;
+  "opt" is the time to optimize the physical (MAL) plan; "run" is the
+  time to execute the physical (MAL) plan. With timermode "performance"
+  all server-side timings and the client-side wall-clock time are given
+  in milliseconds (ms). Note that the client-measured wall-clock time
+  "clk" is reported per query only when options "--interactive" or
+  "--echo" are used, because only then does mclient send individual
+  lines (statements) of the SQL script to the server. Otherwise, mclient
+  sends the SQL script in large(r) batch(es) to the server, and, thus,
+  only the total wall-clock time per batch is measured and reported. The
+  server-measured detailed performance timings "sql", "opt", "run" are
+  always measured and reported per query. Also, all timing information
+  is now given on a separate line and set to stderr rather than stdout.
+
 * Fri Feb  9 2018 Sjoerd Mullender 
 - Some types and constants were moved from configure (and hence
   monetdb_config.h) to gdk.h.  In particular, the types "lng" and
diff --git a/clients/Tests/mclient-uri.SQL.bat 
b/clients/Tests/mclient-uri.SQL.bat
--- a/clients/Tests/mclient-uri.SQL.bat
+++ b/clients/Tests/mclient-uri.SQL.bat
@@ -3,4 +3,4 @@
 
 @rem Windows doesn't do UNIX domain sockets, so only the one test here.
 
-mclient -d 
"mapi:monetdb://%HOST%:%MAPIPORT%/%TSTDB%?language=sql&user=monetdb" -f test -E 
utf-8 -s "select 1"
+mclient -d 
"mapi:monetdb://%HOST%:%MAPIPORT%/%TSTDB%?language=sql&user=monetdb" -f test -t 
none -E utf-8 -s "select 1"
diff --git a/clients/Tests/mclient-uri.SQL.sh b/clients/Tests/mclient-uri.SQL.sh
--- a/clients/Tests/mclient-uri.SQL.sh
+++ b/clients/Tests/mclient-uri.SQL.sh
@@ -3,7 +3,7 @@
 # test the URI parsing capabilities of the MAPI library
 
 Mlog "mclient -d 
mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -t none 
-E utf-8 -s select 1"
-mclient -d "mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb" 
-f test -E utf-8 -s 'select 1'
+mclient -d "mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb" 
-f test -t none -E utf-8 -s 'select 1'
 
 Mlog "mclient -d 
mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb
 -f test -t none -E utf-8 -s select 1"
-mclient -d 
"mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb"
 -f test -E utf-8 -s 'select 1'
+mclient -d 
"mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb"
 -f test -t none -E utf-8 -s 'select 1'
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err 
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -22,7 +22,7 @@ Options are:
  -f kind | --format=kind  specify output format 
{csv,tab,raw,sql

MonetDB: default - Merge with Mar2018 branch.

2018-02-13 Thread Sjoerd Mullender
Changeset: b8be1823eb29 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8be1823eb29
Modified Files:
buildtools/ChangeLog.Jul2017
clients/Tests/mclient-uri.SQL.sh
clients/mapiclient/mclient.c
gdk/gdk_batop.c
gdk/gdk_project.c
monetdb5/optimizer/opt_pushselect.c
sql/backends/monet5/sql_cat.c
sql/server/rel_psm.c
sql/server/rel_schema.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/storage/sql_storage.h
sql/storage/store.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1556 to 300 lines):

diff --git a/buildtools/ChangeLog.Jul2017 b/buildtools/ChangeLog.Jul2017
--- a/buildtools/ChangeLog.Jul2017
+++ b/buildtools/ChangeLog.Jul2017
@@ -1,3 +1,7 @@
 # ChangeLog file for buildtools
 # This file is updated with Maddlog
 
+* Mon Feb 12 2018 Sjoerd Mullender 
+- Added the .pdb files needed for debug symbols to the Windows installer
+  for MonetDB/SQL.
+
diff --git a/clients/Tests/mclient-uri.SQL.sh b/clients/Tests/mclient-uri.SQL.sh
--- a/clients/Tests/mclient-uri.SQL.sh
+++ b/clients/Tests/mclient-uri.SQL.sh
@@ -2,7 +2,7 @@
 
 # test the URI parsing capabilities of the MAPI library
 
-Mlog "mclient -d 
mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -t 
none-E utf-8 -s select 1"
+Mlog "mclient -d 
mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -t none 
-E utf-8 -s select 1"
 mclient -d "mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb" 
-f test -E utf-8 -s 'select 1'
 
 Mlog "mclient -d 
mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb
 -f test -t none -E utf-8 -s select 1"
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -88,9 +88,8 @@ enum formatters {
TABLEformatter, // render as a bordered table
CSVformatter,   // render as a comma separate file
XMLformatter,   // render as a valid XML document
-   JSONformatter,  // render as a valid JSON document
TESTformatter,  // for testing, escape characters
-   TRASHformatter, // remove the result set 
+   TRASHformatter, // remove the result set
SAMformatter,   // render a SAM result set
EXPANDEDformatter   // render as multi-row single record
 };
@@ -127,8 +126,8 @@ static char *pager = 0; /* use external
 static int rowsperpage = 0;/* for SQL pagination */
 static int pagewidth = 0;  /* -1: take whatever is necessary, >0: limit */
 static int pagewidthset = 0;   /* whether the user set the width explicitly */
-static int croppedfields = 0;  /* whatever got cropped/truncated */
-static char firstcrop = 1; /* first time we see cropping/truncation */
+static int croppedfields = 0;  /* whatever got cropped/truncated */
+static char firstcrop = 1; /* first time we see cropping/truncation */
 
 enum modifiers {
NOmodifier,
@@ -268,33 +267,31 @@ timerHuman(int64_t sqloptimizer, int64_t
 {
timertype t = th - t0;
 
-
-   (void) sqloptimizer;
-   if (timermode == T_CLOCK){
-   if( t / 1000 < 950) {
+   if (timermode == T_CLOCK) {
+   if (t / 1000 < 950) {
snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%03d 
ms" , t / 1000, (int) (t % 1000));
-   return(htimbuf);
+   return htimbuf;
}
t /= 1000;
if (t / 1000 < 60) {
snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%02d 
sec", t / 1000, (int) ((t % 1000) / 100));
-   return(htimbuf);
+   return htimbuf;
}
t /= 1000;
snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ":%02d min", t 
/ 60, (int) (t % 60));
-   return(htimbuf);
+   return htimbuf;
}
/* for performance measures we use milliseconds as the base */
-   if (timermode == T_PERF){ 
-   snprintf(htimbuf, sizeof(htimbuf), "clk:%" PRId64 
".%03d sql:%" PRId64 ".%03d opt:%" PRId64 ".%03d run:%" PRId64 ".%03d ms", 
-   t / 1000, (int)(t % 1000),
-   sqloptimizer/1000, (int)(sqloptimizer % 1000), 
-   maloptimizer /1000, (int)(maloptimizer % 1000), 
-   querytime /1000, (int)(querytime % 1000));
-   return(htimbuf);
+   if (timermode == T_PERF) {
+   snprintf(htimbuf, sizeof(htimbuf), "clk:%" PRId64 ".%03d sql:%" 
PRId64 ".%03d opt:%" PRId64 ".%03d run:%" PRId64 ".%03d ms",
+t / 1000, (int) (t % 1000),
+sqloptimizer / 1000, (int) (sqloptimizer % 1000),
+mal

MonetDB: default - Merge with Mar2018 branch.

2018-02-09 Thread Sjoerd Mullender
Changeset: 5be17c9a60b5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5be17c9a60b5
Modified Files:
ChangeLog.Mar2018
NT/monetdb_config.h.in
clients/Tests/exports.stable.out
clients/mapiclient/eventparser.c
clients/mapiclient/eventparser.h
clients/mapiclient/mhelp.c
clients/mapiclient/stethoscope.c
clients/mapiclient/tachograph.c
clients/mapiclient/tomograph.c
clients/mapilib/mapi.c
clients/odbc/driver/ODBCConvert.c
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDesc.c
clients/odbc/driver/ODBCEnv.c
clients/odbc/driver/ODBCStmt.c
clients/odbc/driver/ODBCUtil.h
clients/odbc/driver/SQLAllocConnect.c
clients/odbc/driver/SQLAllocHandle.c
clients/odbc/driver/SQLAllocStmt.c
clients/odbc/driver/SQLBindCol.c
clients/odbc/driver/SQLBindParameter.c
clients/odbc/driver/SQLBrowseConnect.c
clients/odbc/driver/SQLBulkOperations.c
clients/odbc/driver/SQLCancel.c
clients/odbc/driver/SQLCloseCursor.c
clients/odbc/driver/SQLColAttribute.c
clients/odbc/driver/SQLColAttributes.c
clients/odbc/driver/SQLColumnPrivileges.c
clients/odbc/driver/SQLColumns.c
clients/odbc/driver/SQLConnect.c
clients/odbc/driver/SQLCopyDesc.c
clients/odbc/driver/SQLDataSources.c
clients/odbc/driver/SQLDescribeCol.c
clients/odbc/driver/SQLDescribeParam.c
clients/odbc/driver/SQLDisconnect.c
clients/odbc/driver/SQLDriverConnect.c
clients/odbc/driver/SQLEndTran.c
clients/odbc/driver/SQLError.c
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLExtendedFetch.c
clients/odbc/driver/SQLFetch.c
clients/odbc/driver/SQLFetchScroll.c
clients/odbc/driver/SQLForeignKeys.c
clients/odbc/driver/SQLFreeConnect.c
clients/odbc/driver/SQLFreeEnv.c
clients/odbc/driver/SQLFreeHandle.c
clients/odbc/driver/SQLFreeStmt.c
clients/odbc/driver/SQLGetConnectAttr.c
clients/odbc/driver/SQLGetConnectOption.c
clients/odbc/driver/SQLGetCursorName.c
clients/odbc/driver/SQLGetData.c
clients/odbc/driver/SQLGetDescField.c
clients/odbc/driver/SQLGetDescRec.c
clients/odbc/driver/SQLGetDiagField.c
clients/odbc/driver/SQLGetDiagRec.c
clients/odbc/driver/SQLGetEnvAttr.c
clients/odbc/driver/SQLGetFunctions.c
clients/odbc/driver/SQLGetInfo.c
clients/odbc/driver/SQLGetStmtAttr.c
clients/odbc/driver/SQLGetStmtOption.c
clients/odbc/driver/SQLGetTypeInfo.c
clients/odbc/driver/SQLMoreResults.c
clients/odbc/driver/SQLNativeSql.c
clients/odbc/driver/SQLNumParams.c
clients/odbc/driver/SQLNumResultCols.c
clients/odbc/driver/SQLParamData.c
clients/odbc/driver/SQLParamOptions.c
clients/odbc/driver/SQLPrepare.c
clients/odbc/driver/SQLPrimaryKeys.c
clients/odbc/driver/SQLProcedureColumns.c
clients/odbc/driver/SQLProcedures.c
clients/odbc/driver/SQLPutData.c
clients/odbc/driver/SQLRowCount.c
clients/odbc/driver/SQLSetConnectAttr.c
clients/odbc/driver/SQLSetConnectOption.c
clients/odbc/driver/SQLSetCursorName.c
clients/odbc/driver/SQLSetDescField.c
clients/odbc/driver/SQLSetDescRec.c
clients/odbc/driver/SQLSetEnvAttr.c
clients/odbc/driver/SQLSetParam.c
clients/odbc/driver/SQLSetPos.c
clients/odbc/driver/SQLSetScrollOptions.c
clients/odbc/driver/SQLSetStmtAttr.c
clients/odbc/driver/SQLSetStmtOption.c
clients/odbc/driver/SQLSpecialColumns.c
clients/odbc/driver/SQLStatistics.c
clients/odbc/driver/SQLTablePrivileges.c
clients/odbc/driver/SQLTables.c
clients/odbc/driver/SQLTransact.c
common/stream/stream.c
common/stream/stream.h
common/utils/msabaoth.c
configure.ag
gdk/ChangeLog.Mar2018
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_atoms.c
gdk/gdk_atoms.h
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_delta.c
gdk/gdk_delta.h
gdk/gdk_heap.c
gdk/gdk_interprocess.c
gdk/gdk_logger.c
gdk/gdk_posix.c
gdk/gdk_private.h
gdk/gdk_storage.c
gdk/gdk_system.c
gdk/gdk_system.h
gdk/gdk_utils.c
gdk/gdk_utils.h
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_client.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_resource.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/mcurl.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/remote

MonetDB: default - Merge with Mar2018 branch.

2018-02-07 Thread Sjoerd Mullender
Changeset: a5bd41737138 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a5bd41737138
Modified Files:
clients/mapiclient/stethoscope.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (21 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -184,7 +184,7 @@ convertOldFormat(char *inputfile)
fprintf(trace,"[\n{");
len = 0;
memset(&event, 0, sizeof(event));
-   while (fgets(buf + len, bufsize - len, fdin) != NULL) {
+   while (fgets(buf + len, (int) (bufsize - len), fdin) != NULL) {
while ((e = strchr(buf + len, '\n')) == NULL) {
/* rediculously long line */
len += strlen(buf + len); /* i.e. len = strlen(buf) */
@@ -197,7 +197,7 @@ convertOldFormat(char *inputfile)
return;
}
buf = e;
-   if (fgets(buf + len, bufsize - len, fdin) == NULL) {
+   if (fgets(buf + len, (int) (bufsize - len), fdin) == 
NULL) {
/* incomplete line */
e = NULL; /* no newline to zap */
break;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-02-07 Thread Sjoerd Mullender
Changeset: a9a3aa894d46 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a9a3aa894d46
Modified Files:
sql/backends/monet5/sql.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (16 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
@@ -2133,10 +2133,8 @@ mvc_row_result_wrap( Client cntxt, MalBl
if ((msg = checkSQLContext(cntxt)) != NULL)
return msg;
res = *res_id = mvc_result_table(m, mb->tag, pci->argc - (pci->retc + 
5), 1, NULL);
-   if(res < 0) {
-   msg = createException(SQL, "sql.resultset", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
-   goto wrapup_result_set;
-   }
+   if (res < 0)
+   throw(SQL, "sql.resultset", SQLSTATE(HY001) MAL_MALLOC_FAIL);
 
tbl = BATdescriptor(tblId);
atr = BATdescriptor(atrId);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Mar2018 branch.

2018-02-07 Thread Sjoerd Mullender
Changeset: be6b999e0918 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=be6b999e0918
Added Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/eventparser.c
clients/mapiclient/stethoscope.c
clients/odbc/driver/ODBCConvert.c
common/utils/msabaoth.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_system.c
gdk/gdk_utils.c

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_import.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_listing.c
monetdb5/modules/mal/wlc.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_upgrades.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
sql/storage/bat/bat_utils.c
sql/storage/bat/bat_utils.h
sql/storage/store.c
sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err.powerpc64
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Darwin
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.FreeBSD
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Windows
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker-2017/Tests/case.Bug-6386.stable.out
sql/test/BugTracker-2017/Tests/statistics_nils_not_eq_zero.Bug-6331.sql

sql/test/BugTracker-2017/Tests/statistics_nils_not_eq_zero.Bug-6331.stable.out
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.SQL.py
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/remote/Tests/partition_elim.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 27114 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1550,8 +1550,11 @@ dump_functions(Mapi mid, stream *toConso
 
len = 500 + (sname ? strlen(sname) : 0) + (fname ? strlen(fname) : 0);
query = malloc(len);
-   if (!query)
+   if (query == NULL) {
+   if (to_free)
+   free(to_free);
return 1;
+   }
q = query;
end_q = q + len;
 
diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -333,7 +333,6 @@ eventdump(void)
 int
 lineparser(char *row, EventRecord *ev)
 {
-#ifdef HAVE_STRPTIME
char *c, *cc, *v =0;
struct tm stm;
 
@@ -342,7 +341,7 @@ lineparser(char *row, EventRecord *ev)
memset(malvariables, 0, sizeof(malvariables));
/* check basic validaty first */
if (row[0] =='#'){
-   return 0;
+   return 1;   /* ok, but nothing filled in */
}
if (row[0] != '[')
return -1;
@@ -351,34 +350,40 @@ lineparser(char *row, EventRecord *ev)
 
/* scan event record number */
c = row+1;
-   if (c == 0)
-   return -2;
ev->eventnr = atoi(c + 1);
 
/* scan event time" */
c = strchr(c + 1, '"');
-   if (c) {
-   /* convert time to epoch in seconds*/
-   cc =c;
-   memset(&stm, 0, sizeof(struct tm));
-   c = strptime(c + 1, "%H:%M:%S", &stm);
-   ev->clkticks = (((lng) stm.tm_hour * 60 + stm.tm_min) * 60 + 
stm.tm_sec) * 100;
-   if (c == 0)
-

MonetDB: default - Merge with Mar2018 branch.

2018-02-06 Thread Sjoerd Mullender
Changeset: 0d2e5d18335a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d2e5d18335a
Modified Files:
NT/monetdb_config.h.in
clients/mapiclient/mnc.c
clients/mapilib/mapi.c
common/stream/stream.c
configure.ag
monetdb5/mal/mal_parser.c
monetdb5/modules/atoms/json.c
monetdb5/modules/mal/language.c
monetdb5/modules/mal/mal_mapi.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/handlers.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/daemon/proxy.c
tools/merovingian/utils/control.c
tools/merovingian/utils/properties.c
tools/mserver/shutdowntest.c
Branch: default
Log Message:

Merge with Mar2018 branch.


diffs (truncated from 1056 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -892,10 +892,6 @@ c99_snprintf(char *outBuf, size_t size, 
 #define ssize_t int
 #endif
 
-/* normally defined in fcntl.h, but not on Windows */
-#define O_CLOEXEC 0
-
-
 typedef int64_t lng;
 typedef uint64_t ulng;
 #define SIZEOF_LNG 8
diff --git a/clients/mapiclient/mnc.c b/clients/mapiclient/mnc.c
--- a/clients/mapiclient/mnc.c
+++ b/clients/mapiclient/mnc.c
@@ -55,6 +55,9 @@
 #define SOCKLEN int
 #endif
 
+#if !defined(HAVE_ACCEPT4) || !defined(SOCK_CLOEXEC)
+#define accept4(sockfd, addr, addlen, flags)   accept(sockfd, addr, addrlen)
+#endif
 
 static void
 usage(void)
@@ -162,15 +165,19 @@ main(int argc, char **argv)
exit(1);
}
for (rp = res; rp; rp = rp->ai_next) {
-   s = socket(rp->ai_family, rp->ai_socktype, 
rp->ai_protocol);
+   s = socket(rp->ai_family, rp->ai_socktype
+#ifdef SOCK_CLOEXEC
+  | SOCK_CLOEXEC
+#endif
+  , rp->ai_protocol);
if (s == INVALID_SOCKET)
continue;
if (connect(s, rp->ai_addr, (socklen_t) rp->ai_addrlen) 
!= SOCKET_ERROR)
break;  /* success */
closesocket(s);
}
-#ifdef HAVE_FCNTL
-   fcntl(s, F_SETFD, FD_CLOEXEC);
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
+   (void) fcntl(s, F_SETFD, FD_CLOEXEC);
 #endif
freeaddrinfo(res);
if (rp == NULL) {
@@ -191,14 +198,18 @@ main(int argc, char **argv)
memcpy(&server.sin_addr, hp->h_addr_list[0], hp->h_length);
server.sin_family = hp->h_addrtype;
server.sin_port = htons((unsigned short) (port & 0x));
-   s = socket(server.sin_family, SOCK_STREAM, IPPROTO_TCP);
+   s = socket(server.sin_family, SOCK_STREAM
+#ifdef SOCK_CLOEXEC
+  | SOCK_CLOEXEC
+#endif
+  , IPPROTO_TCP);
 
if (s == INVALID_SOCKET) {
fprintf(stderr, "opening socket failed: %s\n", 
strerror(errno));
exit(1);
}
-#ifdef HAVE_FCNTL
-   fcntl(s, F_SETFD, FD_CLOEXEC);
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
+   (void) fcntl(s, F_SETFD, FD_CLOEXEC);
 #endif
 
if (connect(s, serv, sizeof(server)) == SOCKET_ERROR) {
@@ -220,12 +231,16 @@ main(int argc, char **argv)
exit(1);
}
 
-   if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) 
{
+   if ((sock = socket(AF_INET, SOCK_STREAM
+#ifdef SOCK_CLOEXEC
+  | SOCK_CLOEXEC
+#endif
+  , 0)) == INVALID_SOCKET) {
fprintf(stderr, "failed to create socket: %s\n", 
strerror(errno));
exit(1);
}
-#ifdef HAVE_FCNTL
-   fcntl(sock, F_SETFD, FD_CLOEXEC);
+#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
+   (void) fcntl(sock, F_SETFD, FD_CLOEXEC);
 #endif
 
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof 
on);
@@ -244,13 +259,13 @@ main(int argc, char **argv)
}
 
listen(sock, 1);
-   if ((s = accept(sock, (SOCKPTR)0, (socklen_t *)0)) == 
INVALID_SOCKET) {
+   if ((s = accept4(sock, (SOCKPTR)0, (socklen_t *)0, 
SOCK_CLOEXEC)) == INVALID_SOCKET) {
fprintf(stderr, "failed to accept connection: %s\n",
strerror(errno));
exit(1);
}
-#ifdef HAVE_FCNTL
-   fcntl(s, F_SETFD, FD_CLOEXEC);
+#