MonetDB: default - Merge with Nov2019

2020-01-27 Thread Pedro Ferreira
Changeset: f36ca3ff2b95 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f36ca3ff2b95
Modified Files:
sql/storage/store.c
Branch: default
Log Message:

Merge with Nov2019


diffs (12 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3583,7 +3583,7 @@ trans_init(sql_trans *tr, backend_stack 
assert(0);
}
}
-   if (pt->idxs.set)
+   if (pt->idxs.set && t->idxs.set)
for (i = pt->idxs.set->h, j = 
t->idxs.set->h; i && j; i = i->next, j = j->next ) { 
sql_idx *pc = i->data; /* 
parent transactions column */
sql_idx *c = j->data; 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2020-01-21 Thread Pedro Ferreira
Changeset: 56950268be7e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=56950268be7e
Modified Files:
monetdb5/modules/atoms/str.c
tools/merovingian/client/monetdb.c
Branch: default
Log Message:

Merge with Nov2019


diffs (262 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -96,7 +96,7 @@
  * high-performance hash-lookup (all code inlined).
  */
 
-/* These tables were generated from the Unicode 10.0.0 spec. */
+/* These tables were generated from the Unicode 12.1.0 spec. */
 struct UTF8_lower_upper {
unsigned int from, to;
 } UTF8_toUpper[] = { /* code points with non-null uppercase conversion */
@@ -333,6 +333,7 @@ struct UTF8_lower_upper {
{ 0x0275, 0x019F, },
{ 0x027D, 0x2C64, },
{ 0x0280, 0x01A6, },
+   { 0x0282, 0xA7C5, },
{ 0x0283, 0x01A9, },
{ 0x0287, 0xA7B1, },
{ 0x0288, 0x01AE, },
@@ -594,6 +595,52 @@ struct UTF8_lower_upper {
{ 0x0584, 0x0554, },
{ 0x0585, 0x0555, },
{ 0x0586, 0x0556, },
+   { 0x10D0, 0x1C90, },
+   { 0x10D1, 0x1C91, },
+   { 0x10D2, 0x1C92, },
+   { 0x10D3, 0x1C93, },
+   { 0x10D4, 0x1C94, },
+   { 0x10D5, 0x1C95, },
+   { 0x10D6, 0x1C96, },
+   { 0x10D7, 0x1C97, },
+   { 0x10D8, 0x1C98, },
+   { 0x10D9, 0x1C99, },
+   { 0x10DA, 0x1C9A, },
+   { 0x10DB, 0x1C9B, },
+   { 0x10DC, 0x1C9C, },
+   { 0x10DD, 0x1C9D, },
+   { 0x10DE, 0x1C9E, },
+   { 0x10DF, 0x1C9F, },
+   { 0x10E0, 0x1CA0, },
+   { 0x10E1, 0x1CA1, },
+   { 0x10E2, 0x1CA2, },
+   { 0x10E3, 0x1CA3, },
+   { 0x10E4, 0x1CA4, },
+   { 0x10E5, 0x1CA5, },
+   { 0x10E6, 0x1CA6, },
+   { 0x10E7, 0x1CA7, },
+   { 0x10E8, 0x1CA8, },
+   { 0x10E9, 0x1CA9, },
+   { 0x10EA, 0x1CAA, },
+   { 0x10EB, 0x1CAB, },
+   { 0x10EC, 0x1CAC, },
+   { 0x10ED, 0x1CAD, },
+   { 0x10EE, 0x1CAE, },
+   { 0x10EF, 0x1CAF, },
+   { 0x10F0, 0x1CB0, },
+   { 0x10F1, 0x1CB1, },
+   { 0x10F2, 0x1CB2, },
+   { 0x10F3, 0x1CB3, },
+   { 0x10F4, 0x1CB4, },
+   { 0x10F5, 0x1CB5, },
+   { 0x10F6, 0x1CB6, },
+   { 0x10F7, 0x1CB7, },
+   { 0x10F8, 0x1CB8, },
+   { 0x10F9, 0x1CB9, },
+   { 0x10FA, 0x1CBA, },
+   { 0x10FD, 0x1CBD, },
+   { 0x10FE, 0x1CBE, },
+   { 0x10FF, 0x1CBF, },
{ 0x13F8, 0x13F0, },
{ 0x13F9, 0x13F1, },
{ 0x13FA, 0x13F2, },
@@ -611,6 +658,7 @@ struct UTF8_lower_upper {
{ 0x1C88, 0xA64A, },
{ 0x1D79, 0xA77D, },
{ 0x1D7D, 0x2C63, },
+   { 0x1D8E, 0xA7C6, },
{ 0x1E01, 0x1E00, },
{ 0x1E03, 0x1E02, },
{ 0x1E05, 0x1E04, },
@@ -1109,6 +1157,7 @@ struct UTF8_lower_upper {
{ 0xA78C, 0xA78B, },
{ 0xA791, 0xA790, },
{ 0xA793, 0xA792, },
+   { 0xA794, 0xA7C4, },
{ 0xA797, 0xA796, },
{ 0xA799, 0xA798, },
{ 0xA79B, 0xA79A, },
@@ -1121,6 +1170,11 @@ struct UTF8_lower_upper {
{ 0xA7A9, 0xA7A8, },
{ 0xA7B5, 0xA7B4, },
{ 0xA7B7, 0xA7B6, },
+   { 0xA7B9, 0xA7B8, },
+   { 0xA7BB, 0xA7BA, },
+   { 0xA7BD, 0xA7BC, },
+   { 0xA7BF, 0xA7BE, },
+   { 0xA7C3, 0xA7C2, },
{ 0xAB53, 0xA7B3, },
{ 0xAB70, 0x13A0, },
{ 0xAB71, 0x13A1, },
@@ -1387,6 +1441,38 @@ struct UTF8_lower_upper {
{ 0x118DD, 0x118BD, },
{ 0x118DE, 0x118BE, },
{ 0x118DF, 0x118BF, },
+   { 0x16E60, 0x16E40, },
+   { 0x16E61, 0x16E41, },
+   { 0x16E62, 0x16E42, },
+   { 0x16E63, 0x16E43, },
+   { 0x16E64, 0x16E44, },
+   { 0x16E65, 0x16E45, },
+   { 0x16E66, 0x16E46, },
+   { 0x16E67, 0x16E47, },
+   { 0x16E68, 0x16E48, },
+   { 0x16E69, 0x16E49, },
+   { 0x16E6A, 0x16E4A, },
+   { 0x16E6B, 0x16E4B, },
+   { 0x16E6C, 0x16E4C, },
+   { 0x16E6D, 0x16E4D, },
+   { 0x16E6E, 0x16E4E, },
+   { 0x16E6F, 0x16E4F, },
+   { 0x16E70, 0x16E50, },
+   { 0x16E71, 0x16E51, },
+   { 0x16E72, 0x16E52, },
+   { 0x16E73, 0x16E53, },
+   { 0x16E74, 0x16E54, },
+   { 0x16E75, 0x16E55, },
+   { 0x16E76, 0x16E56, },
+   { 0x16E77, 0x16E57, },
+   { 0x16E78, 0x16E58, },
+   { 0x16E79, 0x16E59, },
+   { 0x16E7A, 0x16E5A, },
+   { 0x16E7B, 0x16E5B, },
+   { 0x16E7C, 0x16E5C, },
+   { 0x16E7D, 0x16E5D, },
+   { 0x16E7E, 0x16E5E, },
+   { 0x16E7F, 0x16E5F, },
{ 0x1E922, 0x1E900, },
{ 0x1E923, 0x1E901, },
{ 0x1E924, 0x1E902, },
@@ -2017,6 +2103,52 @@ struct UTF8_lower_upper {
{ 0x13F3, 0x13FB, },
{ 0x13F4, 0x13FC, },
{ 0x13F5, 0x13FD, },
+   { 0x1C90, 0x10D0, },
+   { 0x1C91, 0x10D1, },
+   { 0x1C92, 0x10D2, },
+   { 0x1C93, 0x10D3, },
+   { 0x1C94, 0x10D4, },
+   { 0x1C95, 0x10D5, },
+   { 0x1C96, 0x10D6, },
+ 

MonetDB: default - Merge with Nov2019

2020-01-13 Thread Pedro Ferreira
Changeset: 7b4210cbb88a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b4210cbb88a
Modified Files:
gdk/gdk_atoms.c
monetdb5/mal/mal_factory.c
Branch: default
Log Message:

Merge with Nov2019


diffs (27 lines):

diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -933,7 +933,12 @@ ptrFromStr(const char *src, size_t *len,
return (ssize_t) (p - src);
 }
 
+#ifdef _MSC_VER
+/* Windows doesn't put 0x in front whereas Linux does, so we do it ourselves */
+atomtostr(ptr, "0x%p", )
+#else
 atomtostr(ptr, "%p", )
+#endif
 
 #if SIZEOF_VOID_P == SIZEOF_INT
 atom_io(ptr, Int, int)
diff --git a/monetdb5/mal/mal_factory.c b/monetdb5/mal/mal_factory.c
--- a/monetdb5/mal/mal_factory.c
+++ b/monetdb5/mal/mal_factory.c
@@ -140,6 +140,7 @@ runFactory(Client cntxt, MalBlkPtr mb, M
lhs->len = 0;
}
}
+   pl->stk->stktop = mb->vtop;
pl->stk->stkbot= mb->vtop;  /* stack already initialized */
msg = runMAL(cntxt, mb, 0, pl->stk);
 } else {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2020-01-10 Thread Sjoerd Mullender
Changeset: 7637dc59c7a0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7637dc59c7a0
Modified Files:
common/utils/msabaoth.c
sql/backends/monet5/sql_gencode.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/handlers.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/utils/glob.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (254 lines):

diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -148,7 +148,7 @@ msab_init(const char *dbfarm, const char
if (_sabaoth_internal_dbname != NULL)
free(_sabaoth_internal_dbname);
 
-   /* this UUID is supposed to be unique per-process, we use it lateron
+   /* this UUID is supposed to be unique per-process, we use it later on
 * to determine if a database is (started by) the current process,
 * since locking always succeeds for the same process */
if (_sabaoth_internal_uuid == NULL)
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -445,19 +445,14 @@ static int
 
char *mal_session_uuid, *err = NULL;
if (!GDKinmemory() && (err = msab_getUUID(_session_uuid)) == NULL) {
+   str lsupervisor_session = GDKstrdup(mal_session_uuid);
str rsupervisor_session = GDKstrdup(mal_session_uuid);
-   if (rsupervisor_session == NULL) {
-   free(mal_session_uuid);
-   return -1;
-   }
-
-   str lsupervisor_session = GDKstrdup(mal_session_uuid);
-   if (lsupervisor_session == NULL) {
-   free(mal_session_uuid);
+   free(mal_session_uuid);
+   if (lsupervisor_session == NULL || rsupervisor_session == NULL) 
{
+   GDKfree(lsupervisor_session);
GDKfree(rsupervisor_session);
return -1;
}
-   free(mal_session_uuid);
 
str rworker_plan_uuid = generateUUID();
if (rworker_plan_uuid == NULL) {
diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -506,7 +506,7 @@ globMatchDBS(int argc, char *argv[], sab
/* move out of orig into w, such that 
we can't
 * get double matches in the same 
output list
 * (as side effect also avoids a double 
free
-* lateron) */
+* later on) */
if (w == NULL) {
top = w = stats;
} else {
@@ -737,7 +737,7 @@ command_status(int argc, char *argv[])
}
}
/* make this option no longer available, for easy use
-* lateron */
+* later on */
argv[i] = NULL;
} else {
doall = 0;
@@ -1043,7 +1043,7 @@ command_startstop(int argc, char *argv[]
}
}
/* make this option no longer available, for easy use
-* lateron */
+* later on */
argv[i] = NULL;
}
}
@@ -1148,7 +1148,7 @@ command_set(int argc, char *argv[], mero
}
}
/* make this option no longer available, for easy use
-* lateron */
+* later on */
argv[i] = NULL;
} else if (property[0] == '\0') {
/* first non-option is property, rest is database */
@@ -1282,7 +1282,7 @@ command_get(int argc, char *argv[])
}
}
/* make this option no longer available, for easy use
-* lateron */
+* later on */
argv[i] = NULL;
} else if (property == NULL) {
/* first non-option is property, rest is database */
@@ -1815,7 +1815,7 @@ main(int argc, char *argv[])
fprintf(stderr, "monetdb: cannot find a control socket, 
use -h and/or 

MonetDB: default - Merge with Nov2019 branch.

2020-01-10 Thread Sjoerd Mullender
Changeset: 2b7359ba17a5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b7359ba17a5
Modified Files:
gdk/gdk_aggr.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (47 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2711,17 +2711,16 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
 #define binsearch_oid(indir, offset, vals, lo, hi, v, ordering, last) 
binsearch_lng(indir, offset, (const lng *) vals, lo, hi, (lng) (v), ordering, 
last)
 #endif
 
-#define DO_QUANTILE_AVG(TPE) \
-   do { \
-   TPE low = *(TPE*) BUNtail(bi, r + (BUN) hi); \
-   TPE high = *(TPE*) BUNtail(bi, r + (BUN) lo); \
-   if (is_##TPE##_nil(low) || is_##TPE##_nil(high)) { \
-   v = dnil; \
-   nils++; \
-   } else { \
-   val = (f - lo) * low + (lo + 1 - f) * high; \
-   v =  \
-   } \
+#define DO_QUANTILE_AVG(TPE)   \
+   do {\
+   TPE low = *(TPE*) BUNtail(bi, r + (BUN) hi);\
+   TPE high = *(TPE*) BUNtail(bi, r + (BUN) lo);   \
+   if (is_##TPE##_nil(low) || is_##TPE##_nil(high)) {  \
+   val = dbl_nil;  \
+   nils++; \
+   } else {\
+   val = (f - lo) * low + (lo + 1 - f) * high; \
+   }   \
} while (0)
 
 static BAT *
@@ -2898,6 +2897,7 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
DO_QUANTILE_AVG(dbl);
break;
}
+   v = 
} else {
/* round *down* to nearest integer */
double f = (p - r - 1) * quantile;
@@ -2988,6 +2988,7 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
DO_QUANTILE_AVG(dbl);
break;
}
+   v = 
} else {
double f;
/* round (p-r-1)*quantile *down* to nearest
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch

2020-01-10 Thread Pedro Ferreira
Changeset: fe5e43e765fb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fe5e43e765fb
Added Files:
sql/test/BugTracker-2020/Tests/All
sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.sql
sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.stable.err
sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.stable.out
Modified Files:
gdk/gdk_aggr.c
Branch: default
Log Message:

Merge with Nov2019 branch


diffs (266 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2711,6 +2711,19 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
 #define binsearch_oid(indir, offset, vals, lo, hi, v, ordering, last) 
binsearch_lng(indir, offset, (const lng *) vals, lo, hi, (lng) (v), ordering, 
last)
 #endif
 
+#define DO_QUANTILE_AVG(TPE) \
+   do { \
+   TPE low = *(TPE*) BUNtail(bi, r + (BUN) hi); \
+   TPE high = *(TPE*) BUNtail(bi, r + (BUN) lo); \
+   if (is_##TPE##_nil(low) || is_##TPE##_nil(high)) { \
+   v = dnil; \
+   nils++; \
+   } else { \
+   val = (f - lo) * low + (lo + 1 - f) * high; \
+   v =  \
+   } \
+   } while (0)
+
 static BAT *
 doBATgroupquantile(BAT *b, BAT *g, BAT *e, BAT *s, int tp, double quantile,
   bool skip_nils, bool abort_on_error, bool average)
@@ -2862,30 +2875,29 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
double hi = ceil(f);
switch (ATOMbasetype(tp)) {
case TYPE_bte:
-   val = (f - lo) * *(bte*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(bte*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(bte);
break;
case TYPE_sht:
-   val = (f - lo) * *(sht*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(sht*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(sht);
break;
case TYPE_int:
-   val = (f - lo) * *(int*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(int*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(int);
break;
case TYPE_lng:
-   val = (f - lo) * *(lng*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(lng*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(lng);
break;
 #ifdef HAVE_HGE
case TYPE_hge:
-   val = (f - lo) * *(hge*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(hge*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(hge);
break;
 #endif
case TYPE_flt:
-   val = (f - lo) * *(flt*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(flt*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(flt);
break;
case TYPE_dbl:
-   val = (f - lo) * *(dbl*)BUNtail(bi, r + 
(BUN) hi) + (lo + 1 - f) * *(dbl*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(dbl);
break;
}
-   v = 
} else {
/* round *down* to nearest integer */
double f = (p - r - 1) * quantile;
@@ -2953,30 +2965,29 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
double hi = ceil(f);
switch (ATOMbasetype(tp)) {
case TYPE_bte:
-   val = (f - lo) * *(bte*)BUNtail(bi, r + (BUN) 
hi) + (lo + 1 - f) * *(bte*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(bte);
break;
case TYPE_sht:
-   val = (f - lo) * *(sht*)BUNtail(bi, r + (BUN) 
hi) + (lo + 1 - f) * *(sht*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(sht);
break;
case TYPE_int:
-   val = (f - lo) * *(int*)BUNtail(bi, r + (BUN) 
hi) + (lo + 1 - f) * *(int*)BUNtail(bi, r + (BUN) lo);
+   DO_QUANTILE_AVG(int);
break;
case TYPE_lng:
- 

MonetDB: default - Merge with Nov2019 branch.

2020-01-07 Thread Sjoerd Mullender
Changeset: ea6749b0f655 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea6749b0f655
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/mapiclient/dump.c
clients/mapiclient/mclient.1
clients/mapilib/mapi.c
clients/odbc/driver/SQLPrepare.c
gdk/gdk.h
gdk/gdk_atoms.h
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_calc.c
gdk/gdk_firstn.c
gdk/gdk_heap.c
gdk/gdk_imprints.c
gdk/gdk_join.c
gdk/gdk_logger.c
gdk/gdk_private.h
gdk/gdk_select.c
gdk/gdk_storage.c
gdk/gdk_string.c
gdk/gdk_utils.c
gdk/gdk_value.c
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
monetdb5/extras/rapi/converters.c.h
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/modules/kernel/algebra.mal
sql/backends/monet5/UDF/pyapi/pyheader.h
testing/Mfilter.py
testing/difflib.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/daemon/proxy.c
tools/merovingian/utils/control.c
tools/merovingian/utils/utils.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 1294 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
@@ -589,15 +589,15 @@ stdout of test 'MAL-signatures` in direc
 [ "algebra",   "slice","command algebra.slice(b:bat[:any_1], x:int, 
y:int):bat[:any_1] ",  "ALGslice_int;","Return the slice with the 
BUNs at position x till y."  ]
 [ "algebra",   "slice","command algebra.slice(b:bat[:any_1], x:lng, 
y:lng):bat[:any_1] ",  "ALGslice_lng;","Return the slice with the 
BUNs at position x till y."  ]
 [ "algebra",   "slice","command algebra.slice(b:bat[:any_1], x:oid, 
y:oid):bat[:any_1] ",  "ALGslice_oid;","Return the slice based on 
head oid x till y (exclusive)."  ]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, 
nilslast:bit, stable:bit):bat[:any_1] ",  "ALGsort11;",   "Returns a copy 
of the BAT sorted on tail values.\n The input and output are (must be) 
dense headed.\n The order is descending if the reverse bit is 
set.\n\t\t This is a stable sort if the stable bit is set."]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, 
nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort12;",   
"Returns a copy of the BAT sorted on tail values and a BAT that\n 
specifies how the input was reordered.\n The input and output are (must 
be) dense headed.\n The order is descending if the reverse bit is 
set.\n\t\t This is a stable sort if the stable bit is set." ]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, 
nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ",  
"ALGsort13;",   "Returns a copy of the BAT sorted on tail values, a BAT that 
specifies\n how the input was reordered, and a BAT with group 
information.\n The input and output are (must be) dense headed.\n   
  The order is descending if the reverse bit is set.\n\t\t This is a stable 
sort if the stable bit is set."  ]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], 
reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort21;",   "Returns 
a copy of the BAT sorted on tail values.\n The input and output are 
(must be) dense headed.\n The order is descending if the reverse bit is 
set.\n\t\t This is a stable sort if the stable bit is set."]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], 
reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ",
"ALGsort22;",   "Returns a copy of the BAT sorted on tail values and a BAT 
that\n specifies how the input was reordered.\n The input and 
output are (must be) dense headed.\n The order is descending if the 
reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ]
-[ "algebra",   "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], 
reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], 
X_2:bat[:oid]) ", "ALGsort23;",   "Returns a copy of the BAT sorted on tail 
values, a BAT that specifies\n how the input was reordered, 

MonetDB: default - Merge with Nov2019 branch.

2020-01-03 Thread Sjoerd Mullender
Changeset: 9e01122c07e1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9e01122c07e1
Added Files:
sql/test/BugTracker-2019/Tests/set-schema-mclient-msg.Bug-6754.sql

sql/test/BugTracker-2019/Tests/set-schema-mclient-msg.Bug-6754.stable.err

sql/test/BugTracker-2019/Tests/set-schema-mclient-msg.Bug-6754.stable.out
Modified Files:
clients/mapiclient/mclient.c
monetdb5/modules/kernel/mmath.c
sql/server/sql_privileges.c
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (260 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1933,7 +1933,7 @@ format_result(Mapi mid, MapiHdl hdl, boo
SQLqueryEcho(hdl);
if (formatter == TABLEformatter ||
formatter == ROWCOUNTformatter)
-   mnstr_printf(toConsole, "operation 
successful\n");
+   mnstr_printf(toConsole, "auto commit mode: 
%s\n", mapi_get_autocommit(mid) ? "on" : "off");
timerHuman(sqloptimizer, maloptimizer, querytime, 
singleinstr, false);
continue;
case Q_PREPARE:
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -295,6 +295,7 @@ str
 MATHsqlrandint(int *res, const int *seed)
 {
 #ifdef STATIC_CODE_ANALYSIS
+   (void) seed;
*res = 0;
 #else
MT_lock_set(_rse_lock);
diff --git a/sql/server/sql_privileges.c b/sql/server/sql_privileges.c
--- a/sql/server/sql_privileges.c
+++ b/sql/server/sql_privileges.c
@@ -754,11 +754,11 @@ mvc_set_schema(mvc *m, char *schema)
if (m->session->schema_name)
_DELETE(m->session->schema_name);
m->session->schema_name = new_schema_name;
-   m->type = Q_TRANS;
+   m->type = Q_SCHEMA;
if (m->session->tr->active)
m->session->schema = s;
ret = 1;
-   } else if(new_schema_name) {
+   } else if (new_schema_name) {
_DELETE(new_schema_name);
}
return ret;
diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -32,6 +32,7 @@ sequences-defaults.Bug-6744
 sequences-types.Bug-6745
 alter_table_drop_column.Bug-6749
 KNOWNFAIL_PYMONETDB?remote-table-non-existent-column.Bug-6750
+set-schema-mclient-msg.Bug-6754
 cte-union.Bug-6755
 merge-table-limit.Bug-6756
 double-free.Bug-6757
diff --git a/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql 
b/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
--- a/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
+++ b/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
@@ -1,9 +1,13 @@
 start transaction;
 create table a(a int, b int, id bigserial);
 create ordered index a_pk on a(id);
+create imprints index a_impk on a(id);
 create index a_idx1 on a(a);
+select type, name from sys.idxs where table_id in (select id from sys._tables 
where name = 'a');
+
 insert into a(a) values(1), (2);
 update a set a = 3, b = 3 where a = 1;
+select * from a;
 delete from a where a = 3;
 truncate table a;
 rollback;
diff --git 
a/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out 
b/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out
--- a/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out
+++ b/sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out
@@ -17,45 +17,6 @@ stdout of test 'index-insert-crash.Bug-6
 # Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-320772/.s.monetdb.39858
 # MonetDB/GIS module loaded
 # SQL catalog created, loading sql scripts once
-# loading sql script: 09_like.sql
-# loading sql script: 10_math.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: 18_index.sql
-# loading sql script: 20_vacuum.sql
-# loading sql script: 21_dependency_views.sql
-# loading sql script: 22_clients.sql
-# loading sql script: 23_skyserver.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
-# 

MonetDB: default - Merge with Nov2019 branch.

2020-01-02 Thread Sjoerd Mullender
Changeset: 0c282e7e11e8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c282e7e11e8
Modified Files:
HowToStart.rst
Makefile.ag
NT/Makefile
NT/monetdb_config.h.in
NT/rules.msc
NT/wincompile.py
NT/winconfig.py
README.rst
bootstrap
buildtools/Makefile.ag
buildtools/autogen/autogen.py
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/codegen.py
buildtools/autogen/autogen/filesplit.py
buildtools/autogen/autogen/msc.py
buildtools/autogen/autogen/var.py
buildtools/conf/Maddlog
buildtools/conf/Makefile.ag
buildtools/conf/fixlicense.py
buildtools/conf/rules.mk
buildtools/conf/website.html
buildtools/doc/HowToRelease.rst
buildtools/doc/windowsbuild.rst
clients/Makefile.ag
clients/NT/Makefile.ag
clients/NT/mclient.bat
clients/NT/msqldump.bat
clients/NT/stethoscope.bat
clients/examples/C/Makefile.ag
clients/examples/C/sample0.c
clients/examples/C/sample1.c
clients/examples/C/sample4.c
clients/examples/C/smack00.c
clients/examples/C/smack01.c
clients/examples/Makefile.ag
clients/examples/perl/Makefile.ag
clients/examples/perl/malsample.pl
clients/examples/perl/sqlsample.pl
clients/examples/php/Makefile.ag
clients/examples/php/sqlsample.php
clients/examples/python/basics.py
clients/examples/python/mclient-python2.py
clients/examples/python/mclient-python3.py
clients/examples/python/perf.py
clients/examples/python/sqlsample.py
clients/mapiclient/Makefile.ag
clients/mapiclient/ReadlineTools.c
clients/mapiclient/ReadlineTools.h
clients/mapiclient/dotfile.py
clients/mapiclient/dotmonetdb.c
clients/mapiclient/dotmonetdb.h
clients/mapiclient/dump.c
clients/mapiclient/eventparser.c
clients/mapiclient/eventparser.h
clients/mapiclient/mclient.c
clients/mapiclient/mhelp.c
clients/mapiclient/mhelp.h
clients/mapiclient/msqldump.c
clients/mapiclient/msqldump.h
clients/mapiclient/stethoscope.c
clients/mapiclient/tachograph.c
clients/mapiclient/tomograph.c
clients/mapilib/Makefile.ag
clients/mapilib/mapi.c
clients/mapilib/mapi.h
clients/mapilib/mapi.rc
clients/mapilib/monetdb-mapi.pc.in
clients/odbc/Makefile.ag
clients/odbc/doc/ExcelMonetDB.html
clients/odbc/doc/unixODBC.html
clients/odbc/driver/Makefile.ag
clients/odbc/driver/ODBCConvert.c
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/ODBCDesc.c
clients/odbc/driver/ODBCDesc.h
clients/odbc/driver/ODBCEnv.c
clients/odbc/driver/ODBCEnv.h
clients/odbc/driver/ODBCError.c
clients/odbc/driver/ODBCError.h
clients/odbc/driver/ODBCGlobal.h
clients/odbc/driver/ODBCQueries.h
clients/odbc/driver/ODBCStmt.c
clients/odbc/driver/ODBCStmt.h
clients/odbc/driver/ODBCUtil.c
clients/odbc/driver/ODBCUtil.h
clients/odbc/driver/SQLAllocConnect.c
clients/odbc/driver/SQLAllocEnv.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/SQLDrivers.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

MonetDB: default - Merge with Nov2019 branch.

2019-12-24 Thread Sjoerd Mullender
Changeset: 015bdc204c26 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=015bdc204c26
Modified Files:
monetdb5/modules/mal/wlc.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/argvcmds.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/utils/utils.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (261 lines):

diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -213,6 +213,7 @@ MEROgetStatus(sabdb **ret, char *databas
char *p;
char *buf;
char *e;
+   char *sp;
 
if (database == NULL)
database = "#all";
@@ -224,14 +225,14 @@ MEROgetStatus(sabdb **ret, char *databas
 
sw = malloc(sizeof(sabdb *) * swlen);
orig = NULL;
-   if ((p = strtok(buf, "\n")) != NULL) {
+   if ((p = strtok_r(buf, "\n", )) != NULL) {
if (strcmp(p, "OK") != 0) {
p = strdup(p);
free(buf);
free(sw);
return(p);
}
-   for (swpos = 0; (p = strtok(NULL, "\n")) != NULL; swpos++) {
+   for (swpos = 0; (p = strtok_r(NULL, "\n", )) != NULL; 
swpos++) {
e = msab_deserialise(, p);
if (e != NULL) {
printf("WARNING: failed to parse response from "
@@ -898,6 +899,7 @@ command_discover(int argc, char *argv[])
size_t posloc = 0;
size_t loclen = 0;
char **locations = malloc(sizeof(char*) * numlocs);
+   char *sp;
 
if (argc == 0) {
exit(2);
@@ -921,14 +923,14 @@ command_discover(int argc, char *argv[])
exit(2);
}
 
-   if ((p = strtok(buf, "\n")) != NULL) {
+   if ((p = strtok_r(buf, "\n", )) != NULL) {
if (strcmp(p, "OK") != 0) {
fprintf(stderr, "%s: %s\n", argv[0], p);
exit(1);
}
if (twidth > 0)
location = malloc(twidth + 1);
-   while ((p = strtok(NULL, "\n")) != NULL) {
+   while ((p = strtok_r(NULL, "\n", )) != NULL) {
if ((q = strchr(p, '\t')) == NULL) {
/* doesn't look correct */
printf("%s: WARNING: discarding incorrect line: 
%s\n",
@@ -1376,9 +1378,10 @@ command_get(int argc, char *argv[])
} else {
/* check validity of properties before printing them */
if (stats == orig) {
+   char *sp;
snprintf(vbuf, sizeof(vbuf), "%s", property);
buf = vbuf;
-   while ((p = strtok(buf, ",")) != NULL) {
+   while ((p = strtok_r(buf, ",", )) != NULL) {
buf = NULL;
if (strcmp(p, "name") == 0)
continue;
@@ -1394,7 +1397,8 @@ command_get(int argc, char *argv[])
if (stats == orig)
printf(" name  prop source   
value\n");
 
-   while ((p = strtok(buf, ",")) != NULL) {
+   char *sp;
+   while ((p = strtok_r(buf, ",", )) != NULL) {
buf = NULL;
 
/* filter properties based on object type */
diff --git a/tools/merovingian/daemon/argvcmds.c 
b/tools/merovingian/daemon/argvcmds.c
--- a/tools/merovingian/daemon/argvcmds.c
+++ b/tools/merovingian/daemon/argvcmds.c
@@ -209,7 +209,8 @@ command_get(confkeyval *ckv, int argc, c
}
 
printf("   propertyvalue\n");
-   while ((p = strtok(property, ",")) != NULL) {
+   char *sp;
+   while ((p = strtok_r(property, ",", )) != NULL) {
property = NULL;
if (strcmp(p, "dbfarm") == 0) {
value = dbfarm;
diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -223,7 +223,9 @@ forkMserver(char *database, sabdb** stat
char *argv[MAX_NR_ARGS+1];  /* for the exec arguments */
char property_other[1024];
int c = 0;
+   int freec = 0;  /* from where to free entries 
in argv */
unsigned int mport;
+   char *set = "--set";
 
er = msab_getStatus(stats, database);
if (er != NULL) {
@@ -557,35 +559,34 @@ forkMserver(char *database, sabdb** stat
 _mero_hostname, mport, database);
argv[c++] = _mero_mserver;
 

MonetDB: default - Merge with Nov2019 branch.

2019-12-23 Thread Sjoerd Mullender
Changeset: dc287ccdbcb7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc287ccdbcb7
Added Files:
sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat.in
sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat.in
Removed Files:
sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat
sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat
Modified Files:
NT/rules.msc
sql/backends/monet5/UDF/pyapi/Makefile.ag
sql/backends/monet5/UDF/pyapi3/Makefile.ag
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (127 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -64,18 +64,24 @@ PTHREAD_LIBS =
 ODBCINST_LIBS = odbccp32.lib user32.lib $(LEGACY_STDIO_DEFINITIONS)
 ODBC_LIBS = odbc32.lib
 
+!IFNDEF PY3VER
+PY2VER=7
+!ENDIF
 !IFNDEF PYTHON2BASE
-PYTHON2BASE=C:\Python27
+PYTHON2BASE=C:\Python2$(PY2VER)
 !ENDIF
 !IFNDEF PYTHON2LIB
-PYTHON2LIB=python27.lib
+PYTHON2LIB=python2$(PY2VER).lib
 !ENDIF
 
+!IFNDEF PY3VER
+PY3VER=7
+!ENDIF
 !IFNDEF PYTHON3BASE
-PYTHON3BASE=C:\Python32
+PYTHON3BASE=C:\Python3$(PY3VER)
 !ENDIF
 !IFNDEF PYTHON3LIB
-PYTHON3LIB=python37.lib
+PYTHON3LIB=python3$(PY3VER).lib
 !ENDIF
 
 PYTHON_LIBDIR=share\MonetDB\python
@@ -416,6 +422,8 @@ CONFIGURE="$(PYTHON)" $(CONFIGURE_PY) \
"PACKAGE=$(pkg)" \
"PYTHON=$(PYTHON)" \
"PYTHON_LIBDIR=$(PYTHON_LIBDIR)" \
+   "PY2VER=$(PY2VER)" \
+   "PY3VER=$(PY3VER)" \
"PYTHON2=$(PYTHON2)" \
"PYTHON3=$(PYTHON3)" \
"TOPDIR=$(TOPDIR)" \
diff --git a/sql/backends/monet5/UDF/pyapi/Makefile.ag 
b/sql/backends/monet5/UDF/pyapi/Makefile.ag
--- a/sql/backends/monet5/UDF/pyapi/Makefile.ag
+++ b/sql/backends/monet5/UDF/pyapi/Makefile.ag
@@ -47,7 +47,7 @@ scripts_bat = {
COND = NATIVE_WIN32
EXT = bat
DIR = prefix
-   SOURCES = pyapi_locatepython2.bat
+   SOURCES = pyapi_locatepython2.bat.in
 }
 
 EXTRA_DIST_DIR = Tests
diff --git a/sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat 
b/sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat.in
rename from sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat
rename to sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat.in
--- a/sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat
+++ b/sql/backends/monet5/UDF/pyapi/pyapi_locatepython2.bat.in
@@ -7,7 +7,7 @@
 @echo off
  
 setlocal ENABLEEXTENSIONS
-set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath"
+set 
KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.@PY2VER@\InstallPath"
 set VALUE_NAME=""
  
 FOR /F "usebackq skip=2 tokens=1,2,*" %%A IN (`REG QUERY %KEY_NAME% /v 
%VALUE_NAME% 2^>nul`) DO (
@@ -28,6 +28,6 @@ IF defined LOCALPYTHONHOME (
 set "PATH=%LOCALPYTHONHOME%;%PATH%"
 )
 ) ELSE (
-@echo MonetDB/Python Disabled: Python 2.7 installation not found.
+@echo MonetDB/Python Disabled: Python 2.@PY2VER@ installation not found.
 endlocal
 )
diff --git a/sql/backends/monet5/UDF/pyapi3/Makefile.ag 
b/sql/backends/monet5/UDF/pyapi3/Makefile.ag
--- a/sql/backends/monet5/UDF/pyapi3/Makefile.ag
+++ b/sql/backends/monet5/UDF/pyapi3/Makefile.ag
@@ -50,7 +50,7 @@ scripts_bat = {
COND = NATIVE_WIN32
EXT = bat
DIR = prefix
-   SOURCES = pyapi_locatepython3.bat
+   SOURCES = pyapi_locatepython3.bat.in
 }
 
 EXTRA_DIST_DIR = Tests
diff --git a/sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat 
b/sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat.in
rename from sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat
rename to sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat.in
--- a/sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat
+++ b/sql/backends/monet5/UDF/pyapi3/pyapi_locatepython3.bat.in
@@ -7,7 +7,7 @@
 @echo off
  
 setlocal ENABLEEXTENSIONS
-set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.7\InstallPath"
+set 
KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.@PY3VER@\InstallPath"
 set VALUE_NAME=""
  
 FOR /F "usebackq skip=2 tokens=1,2,*" %%A IN (`REG QUERY %KEY_NAME% /v 
%VALUE_NAME% 2^>nul`) DO (
@@ -28,6 +28,6 @@ IF defined LOCALPYTHONHOME (
 set "PATH=%LOCALPYTHONHOME%;%PATH%"
 )
 ) ELSE (
-@echo MonetDB/Python Disabled: Python 3.7 installation not found.
+@echo MonetDB/Python Disabled: Python 3.@PY3VER@ installation not found.
 endlocal
 )
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3074,11 +3074,11 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
 if winreg is not None:
 if env['TST_BITS'] == '32bit':
 if sys.maxsize > 2**32:
-regkey = 
r'SOFTWARE\Wow6432Node\Python\PythonCore\3.7-32\InstallPath'
+regkey = 
r'SOFTWARE\Wow6432Node\Python\PythonCore\3.@PY3VER@-32\InstallPath'
 else:
- 

MonetDB: default - Merge with Nov2019

2019-12-20 Thread Pedro Ferreira
Changeset: 23c953f8e7ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=23c953f8e7ba
Modified Files:
sql/server/rel_select.c
sql/test/analytics/Tests/analytics09.sql
sql/test/analytics/Tests/analytics09.stable.err
sql/test/analytics/Tests/analytics09.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (295 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4510,7 +4510,7 @@ rel_rankop(sql_query *query, sql_rel **r
return NULL;
} else if (is_sql_aggr(f)) {
char *uaname = GDKmalloc(strlen(aname) + 1);
-   (void) sql_error(sql, 02, SQLSTATE(42000) "%s: window functions 
not allowed inside aggregates",
+   (void) sql_error(sql, 02, SQLSTATE(42000) "%s: window functions 
not allowed inside aggregation functions",
 uaname ? toUpperCopy(uaname, 
aname) : aname);
if (uaname)
GDKfree(uaname);
diff --git a/sql/test/analytics/Tests/analytics09.sql 
b/sql/test/analytics/Tests/analytics09.sql
--- a/sql/test/analytics/Tests/analytics09.sql
+++ b/sql/test/analytics/Tests/analytics09.sql
@@ -3,7 +3,7 @@ insert into analytics values (15, 3), (3
 
 select cast(sum(1) over () as bigint), rank() over (), nth_value(1, 1) over ();
 
-select avg(sum(aa) over ()) from analytics;
+select avg(sum(aa) over ()) from analytics; --error, window functions not 
allowed inside aggregates
 
 select cast(sum(1) * count(*) over () as bigint);
 
@@ -115,6 +115,6 @@ select 1 from analytics order by sum(sum
 
 select 1 from analytics having sum(aa) over (); --error, window function not 
allowed in having clause
 
-select sum(avg(aa) over ()) over () from analytics; --error, window functions 
inside aggregate
+select sum(avg(aa) over ()) from analytics; --error, window functions not 
allowed inside aggregates
 
 drop table analytics;
diff --git a/sql/test/analytics/Tests/analytics09.stable.err 
b/sql/test/analytics/Tests/analytics09.stable.err
--- a/sql/test/analytics/Tests/analytics09.stable.err
+++ b/sql/test/analytics/Tests/analytics09.stable.err
@@ -28,7 +28,11 @@ stderr of test 'analytics09` in director
 # 13:13:17 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1389" "--port=37694"
 # 13:13:17 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-17924/.s.monetdb.36475
+MAPI  = (monetdb) /var/tmp/mtest-155309/.s.monetdb.35365
+QUERY = select avg(sum(aa) over ()) from analytics; --error, window functions 
not allowed inside aggregates
+ERROR = !SUM: window functions not allowed inside aggregation functions
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-155309/.s.monetdb.35365
 QUERY = select cast(sum(aa) * 100 / sum(sum(aa)) over (partition by bb) as 
bigint) from analytics; --error, nesting aggregation functions
 ERROR = !SELECT: cannot use non GROUP BY column 'bb' in query results without 
an aggregate function
 CODE  = 42000
@@ -68,6 +72,10 @@ MAPI  = (monetdb) /var/tmp/mtest-4073/.s
 QUERY = select 1 from analytics having sum(aa) over (); --error, window 
function not allowed in having clause
 ERROR = !SUM: window function 'sum' not allowed in HAVING clause
 CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-155309/.s.monetdb.35365
+QUERY = select sum(avg(aa) over ()) from analytics; --error, window functions 
not allowed inside aggregates
+ERROR = !AVG: window functions not allowed inside aggregation functions
+CODE  = 42000
 
 # 13:13:17 >  
 # 13:13:17 >  "Done."
diff --git a/sql/test/analytics/Tests/analytics09.stable.out 
b/sql/test/analytics/Tests/analytics09.stable.out
--- a/sql/test/analytics/Tests/analytics09.stable.out
+++ b/sql/test/analytics/Tests/analytics09.stable.out
@@ -27,31 +27,25 @@ stdout of test 'analytics09` in director
 #insert into analytics values (15, 3), (3, 1), (2, 1), (5, 3), (NULL, 2), (3, 
2), (4, 1), (6, 3), (8, 2), (NULL, 4);
 [ 10   ]
 #select cast(sum(1) over () as bigint), rank() over (), nth_value(1, 1) over 
();
-% .%1, .%3,.%4 # table_name
-% %1,  %3, %4 # name
+% .,   .,  . # table_name
+% %1,  %2, %3 # name
 % bigint,  int,tinyint # type
 % 1,   1,  1 # length
 [ 1,   1,  1   ]
-#select avg(sum(aa) over ()) from analytics;
-% sys.%1 # table_name
-% %1 # name
-% double # type
-% 24 # length
-[ 46   ]
 #select cast(sum(1) * count(*) over () as bigint);
-% .%3 # table_name
+% . # table_name
 % %3 # name
 % bigint # type
 % 1 # length
 [ 1]
 #select cast(sum(aa) * count(*) over () as bigint) from analytics;
-% sys.%3 # table_name
+% sys. # table_name
 % %3 # name
 % bigint # type
 % 2 # length
 [ 46   ]
 #select cast(aa * count(1) over () as bigint) from analytics;
-% sys.%1 # table_name
+% sys. # table_name
 % %1 # name
 % bigint # type
 % 3 # length
@@ -66,26 +60,26 @@ stdout of test 'analytics09` in director
 [ 80   ]
 [ NULL ]
 

MonetDB: default - Merge with Nov2019

2019-12-19 Thread Pedro Ferreira
Changeset: 84eb63a48b1b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84eb63a48b1b
Added Files:
sql/test/BugTracker-2019/Tests/drop-table-cascade.Bug-6805.sql
sql/test/BugTracker-2019/Tests/drop-table-cascade.Bug-6805.stable.err
sql/test/BugTracker-2019/Tests/drop-table-cascade.Bug-6805.stable.out
Modified Files:
clients/mapiclient/mhelp.c
sql/include/sql_catalog.h
sql/odbc/samples/Tests/odbcsample1.SQL.sh
sql/odbc/samples/Tests/testgetinfo.SQL.sh
sql/storage/sql_catalog.c
sql/storage/store.c
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 579 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
@@ -169,6 +169,11 @@ SQLhelp sqlhelp1[] = {
 "LANGUAGE PYTHON external_code",
 "qname,param,external_code",
 "See also 
https://www.monetdb.org/blog/monetdbpython-loader-functions"},
+   {"CREATE MERGE TABLE",
+"",
+"CREATE MERGE TABLE [ IF NOT EXISTS ] qname table_source [ 
partition_by ]",
+"table_source,partition_by",
+"See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning"},
{"CREATE PROCEDURE",
 "Create a user-defined procedure",
 "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] 
} ')'\n"
@@ -177,11 +182,6 @@ SQLhelp sqlhelp1[] = {
 "EXTERNAL NAME ident ',' ident",
 "qname,param,procedure_statement,ident",
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Procedures"},
-   {"CREATE MERGE TABLE",
-"",
-"CREATE MERGE TABLE [ IF NOT EXISTS ] qname table_source [ 
partition_by ]",
-"table_source,partition_by",
-"See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning"},
{"CREATE REMOTE TABLE",
 "",
 "CREATE REMOTE TABLE [ IF NOT EXISTS ] qname ON string [WITH [USER 
'username'] [[ENCRYPTED] PASSWORD 'password']]",
diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h
--- a/sql/include/sql_catalog.h
+++ b/sql/include/sql_catalog.h
@@ -691,8 +691,12 @@ extern node *list_find_id(list *l, sqlid
 extern node *list_find_base_id(list *l, sqlid id);
 
 extern sql_key *find_sql_key(sql_table *t, const char *kname);
+extern node *find_sql_key_node(sql_schema *s, sqlid id);
+extern sql_key *sql_trans_find_key(sql_trans *tr, sqlid id);
 
 extern sql_idx *find_sql_idx(sql_table *t, const char *kname);
+extern node *find_sql_idx_node(sql_schema *s, sqlid id);
+extern sql_idx *sql_trans_find_idx(sql_trans *tr, sqlid id);
 
 extern sql_column *find_sql_column(sql_table *t, const char *cname);
 
@@ -701,6 +705,7 @@ extern sql_part *find_sql_part(sql_table
 extern sql_table *find_sql_table(sql_schema *s, const char *tname);
 extern sql_table *find_sql_table_id(sql_schema *s, sqlid id);
 extern node *find_sql_table_node(sql_schema *s, sqlid id);
+extern sql_table *sql_trans_find_table(sql_trans *tr, sqlid id);
 
 extern sql_sequence *find_sql_sequence(sql_schema *s, const char *sname);
 
@@ -711,6 +716,7 @@ extern node *find_sql_schema_node(sql_tr
 extern sql_type *find_sql_type(sql_schema * s, const char *tname);
 extern sql_type *sql_trans_bind_type(sql_trans *tr, sql_schema *s, const char 
*name);
 extern node *find_sql_type_node(sql_schema *s, sqlid id);
+extern sql_type *sql_trans_find_type(sql_trans *tr, sqlid id);
 
 extern sql_func *find_sql_func(sql_schema * s, const char *tname);
 extern list *find_all_sql_func(sql_schema * s, const char *tname, sql_ftype 
type);
@@ -718,6 +724,9 @@ extern sql_func *sql_trans_bind_func(sql
 extern sql_func *sql_trans_find_func(sql_trans *tr, sqlid id);
 extern node *find_sql_func_node(sql_schema *s, sqlid id);
 
+extern node *find_sql_trigger_node(sql_schema *s, sqlid id);
+extern sql_trigger *sql_trans_find_trigger(sql_trans *tr, sqlid id);
+
 extern void *sql_values_list_element_validate_and_insert(void *v1, void *v2, 
int* res);
 extern void *sql_range_part_validate_and_insert(void *v1, void *v2);
 extern void *sql_values_part_validate_and_insert(void *v1, void *v2);
diff --git a/sql/odbc/samples/Tests/odbcsample1.SQL.sh 
b/sql/odbc/samples/Tests/odbcsample1.SQL.sh
--- a/sql/odbc/samples/Tests/odbcsample1.SQL.sh
+++ b/sql/odbc/samples/Tests/odbcsample1.SQL.sh
@@ -8,7 +8,7 @@ Description = Test MonetDB Data Source
 Driver = $LIBDIR/libMonetODBC.so
 Setup  = $LIBDIR/libMonetODBCs.so
 Host   = localhost
-Port   = MAPIPORT
+Port   = $MAPIPORT
 Database   = $TSTDB
 User   = monetdb
 Password   = monetdb
diff --git a/sql/odbc/samples/Tests/testgetinfo.SQL.sh 
b/sql/odbc/samples/Tests/testgetinfo.SQL.sh
--- a/sql/odbc/samples/Tests/testgetinfo.SQL.sh
+++ 

MonetDB: default - Merge with Nov2019

2019-12-18 Thread Pedro Ferreira
Changeset: c19cc7019235 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c19cc7019235
Added Files:
sql/benchmarks/tpcds/Tests/load.timeout
sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.sql
sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.stable.err
sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.stable.out
Modified Files:
NT/rules.msc
configure.ag
monetdb5/modules/atoms/uuid.mal
monetdb5/modules/mal/orderidx.mal
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_subquery.mal
sql/server/rel_optimizer.c
sql/server/rel_select.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/server/sql_qc.c
sql/server/sql_qc.h
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
sql/test/BugTracker-2017/Tests/All
sql/test/Tests/session_vars.sql
sql/test/Tests/session_vars.stable.err
sql/test/Tests/session_vars.stable.out
sql/test/Via-m/Tests/event_s03.stable.out
sql/test/Via-m/Tests/event_s05.stable.out
sql/test/Via-m/Tests/event_s07.stable.out
sql/test/Via-m/Tests/event_s09.stable.out
sql/test/Via-m/Tests/event_s11.stable.err
sql/test/Via-m/Tests/event_s11.stable.out
sql/test/Via-m/Tests/file_s04.stable.out
sql/test/Via-m/Tests/file_s05.stable.out
sql/test/Via-m/Tests/file_s06.stable.out
sql/test/Via-m/Tests/file_s08.stable.out
sql/test/Via-m/Tests/file_s10.stable.out
sql/test/Via-m/Tests/file_s12.stable.out
sql/test/Via-m/Tests/file_s15.stable.out
sql/test/Via-m/Tests/media_s04.stable.out
sql/test/Via-m/Tests/media_s06.stable.out
sql/test/Via-m/Tests/media_s08.stable.out
sql/test/Via-m/Tests/media_s10.stable.out
sql/test/Via-m/Tests/media_s12.stable.out
sql/test/Via-m/Tests/media_s14.stable.out
sql/test/Via-m/Tests/media_s16.stable.out
sql/test/Via-m/Tests/media_s18.stable.out
sql/test/Via-m/Tests/media_s19.stable.out
sql/test/Via-m/insert_event1.sql
sql/test/Via-m/insert_event2.sql
sql/test/Via-m/insert_event3.sql
sql/test/Via-m/insert_event4.sql
sql/test/Via-m/insert_file2.sql
sql/test/Via-m/insert_file3.sql
sql/test/Via-m/insert_file4.sql
sql/test/Via-m/insert_file5.sql
sql/test/Via-m/insert_file6.sql
sql/test/Via-m/insert_file7.sql
sql/test/Via-m/insert_file8.sql
sql/test/Via-m/insert_media1.sql
sql/test/Via-m/insert_media2.sql
sql/test/Via-m/insert_media3.sql
sql/test/Via-m/insert_media4.sql
sql/test/Via-m/insert_media5.sql
sql/test/Via-m/insert_media6.sql
sql/test/Via-m/insert_media7.sql
sql/test/pg_regress/Tests/timestamp.sql
sql/test/pg_regress/Tests/timestamptz.sql
sql/test/ssqq/Tests/insert_query.stable.out
sql/test/ssqq/Tests/insert_queue.stable.out
sql/test/ssqq/Tests/insert_quser.stable.out
sql/test/ssqq/insert_query.sql
sql/test/ssqq/insert_queue.sql
sql/test/ssqq/insert_quser.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1254 to 300 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -75,7 +75,7 @@ PYTHON2LIB=python27.lib
 PYTHON3BASE=C:\Python32
 !ENDIF
 !IFNDEF PYTHON3LIB
-PYTHON3LIB=python32.lib
+PYTHON3LIB=python37.lib
 !ENDIF
 
 PYTHON_LIBDIR=share\MonetDB\python
@@ -176,12 +176,12 @@ R.lib: "$(libr_DLL)"
 !ENDIF
 
 !IFDEF HAVE_LIBPY2
-libpy2_LIBS = "$(PYTHON2DIR)\libs\python27.lib"
+libpy2_LIBS = "$(PYTHON2DIR)\libs\$(PYTHON2LIB)"
 libpy2_CFLAGS = -DHAVE_LIBPY2 "-I$(PYTHON2DIR)\include" 
"-I$(PYTHON2DIR)\Lib\site-packages\numpy\core\include"
 !ENDIF
 
 !IFDEF HAVE_LIBPY3
-libpy3_LIBS = "$(PYTHON3DIR)\libs\python37.lib"
+libpy3_LIBS = "$(PYTHON3DIR)\libs\$(PYTHON3LIB)"
 libpy3_CFLAGS = -DHAVE_LIBPY3 "-I$(PYTHON3DIR)\include" 
"-I$(PYTHON3DIR)\Lib\site-packages\numpy\core\include"
 !ENDIF
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1785,7 +1785,7 @@ AS_VAR_IF([enable_py3integration], [no],
 enable_py3integration=no
 why_not_py3integration="(numpy/arrayobject.h 
not found)"])],
[libpy3_CFLAGS=`$PYTHON3 -c "from distutils.sysconfig 
import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + 
numpy.get_include());" 2> /dev/null`
-libpy3_LIBS=`$PY3CONFIG --ldflags`
+libpy3_LIBS=`$PY3CONFIG --embed --ldflags` || 
libpy3_LIBS=`$PY3CONFIG --ldflags`
 HAVEPYTHONHEADER=`$PYTHON3 -c "import 

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

2019-12-18 Thread Sjoerd Mullender
Changeset: 77214e5c56da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=77214e5c56da
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 Nov2019 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 Nov2019 branch.

2019-12-18 Thread Sjoerd Mullender
Changeset: ad9f924629b5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ad9f924629b5
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (38 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -747,3 +747,6 @@ fffd3aabeae5e2c5b535179471e5730742962a76
 e0719bdebf32967ca0a0043f556b3f48f93e0ce0 Nov2019_7
 fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release
 e0719bdebf32967ca0a0043f556b3f48f93e0ce0 Nov2019_SP1_release
+8d4258444e2a0a809468fb85be7999a407d47e04 Nov2019_9
+e0719bdebf32967ca0a0043f556b3f48f93e0ce0 Nov2019_SP1_release
+8d4258444e2a0a809468fb85be7999a407d47e04 Nov2019_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1061,6 +1061,10 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Wed Dec 18 2019 Sjoerd Mullender  - 11.35.9-20191218
+- Rebuilt.
+- BZ#6804: DNS resolution of 0.0.0.0 fails on recent Ubuntus
+
 * Tue Dec 17 2019 Sjoerd Mullender  - 11.35.7-20191217
 - Rebuilt.
 
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+monetdb (11.35.9) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#6804: DNS resolution of 0.0.0.0 fails on recent Ubuntus
+
+ -- Sjoerd Mullender   Wed, 18 Dec 2019 11:02:41 +0100
+
 monetdb (11.35.7) unstable; urgency=low
 
   * Rebuilt.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


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

2019-12-18 Thread Sjoerd Mullender
Changeset: 33d7d629f757 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33d7d629f757
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 Nov2019 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 Nov2019 branch.

2019-12-18 Thread Sjoerd Mullender
Changeset: 8edf0b57f80a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8edf0b57f80a
Modified Files:
tools/merovingian/daemon/connections.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (12 lines):

diff --git a/tools/merovingian/daemon/connections.c 
b/tools/merovingian/daemon/connections.c
--- a/tools/merovingian/daemon/connections.c
+++ b/tools/merovingian/daemon/connections.c
@@ -143,7 +143,7 @@ openConnectionTCP(int *ret, bool bind_ip
return(newErr("failed setting socket to listen: %s", 
strerror(errno)));
}
 
-   Mfprintf(log, "accepting connections on TCP socket %s:%u\n", bindaddr, 
port);
+   Mfprintf(log, "accepting connections on TCP socket %s:%hu\n", bindaddr, 
port);
 
*ret = sock;
return(NO_ERR);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


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

2019-12-17 Thread Sjoerd Mullender
Changeset: 6c0db6d3e397 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c0db6d3e397
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 Nov2019 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 Nov2019 branch.

2019-12-17 Thread Sjoerd Mullender
Changeset: 543be8d19191 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=543be8d19191
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (48 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -744,3 +744,6 @@ 90486f8f87ff0602f3ab143c629ba0aed2153d64
 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_release
 fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_5
 fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release
+e0719bdebf32967ca0a0043f556b3f48f93e0ce0 Nov2019_7
+fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release
+e0719bdebf32967ca0a0043f556b3f48f93e0ce0 Nov2019_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1061,6 +1061,9 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Tue Dec 17 2019 Sjoerd Mullender  - 11.35.7-20191217
+- Rebuilt.
+
 * Thu Dec 12 2019 Sjoerd Mullender  - 11.35.5-20191212
 - Rebuilt.
 - BZ#6723: columns aliases duplicates should not be allowed. automatic
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+monetdb (11.35.7) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Sjoerd Mullender   Tue, 17 Dec 2019 10:03:07 +0100
+
 monetdb (11.35.5) unstable; urgency=low
 
   * Rebuilt.
diff --git a/libversions b/libversions
--- a/libversions
+++ b/libversions
@@ -42,7 +42,7 @@ GDK_VERSION=19:2:0
 MAPI_VERSION=12:2:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
-MONETDB5_VERSION=28:2:0
+MONETDB5_VERSION=28:3:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=13:3:0
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


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

2019-12-17 Thread Sjoerd Mullender
Changeset: cca37d18e02d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cca37d18e02d
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 Nov2019 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 Nov2019 branch.

2019-12-17 Thread Sjoerd Mullender
Changeset: 6de7d2fee8f2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6de7d2fee8f2
Modified Files:
NT/mksqlwxs.py
monetdb5/NT/M5server.bat

sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.sql
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (44 lines):

diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -157,7 +157,8 @@ def main():
r'lib\libmonetdb5.pdb',
r'lib\libstream.pdb'])
 id = comp(geom, id, 14,
-  [r'%s\bin\geos_c.dll' % makedefs['LIBGEOS']])
+  [r'%s\bin\geos_c.dll' % makedefs['LIBGEOS'],
+   r'%s\bin\geos.dll' % makedefs['LIBGEOS']])
 print(r'')
 print(r'')
 id = comp(features, id, 14, [r'etc\.monetdb'])
diff --git a/monetdb5/NT/M5server.bat b/monetdb5/NT/M5server.bat
--- a/monetdb5/NT/M5server.bat
+++ b/monetdb5/NT/M5server.bat
@@ -23,12 +23,14 @@ if "%APPDATA%" == "" goto usevar
 rem if the APPDATA variable does exist, put the database there
 set MONETDBDIR=%APPDATA%\MonetDB5
 set MONETDBFARM="--dbpath=%MONETDBDIR%\dbfarm\demo"
+mkdir "%MONETDBDIR%\dbfarm\demo"
 goto skipusevar
 :usevar
 rem if the APPDATA variable does not exist, put the database in the
 rem installation folder (i.e. default location, so no command line argument)
-set MONETDBDIR=%MONETDB%\var\MonetDB5
+set MONETDBDIR=%MONETDB%\var\monetdb5
 set MONETDBFARM=
+mkdir "%MONETDB%\var\monetdb5\dbfarm"
 :skipusevar
 
 rem the SQL log directory used to be in %MONETDBDIR%, but we now
diff --git 
a/sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.sql 
b/sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.sql
--- 
a/sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.sql
+++ 
b/sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.sql
@@ -1,3 +1,5 @@
-select now() + 1 - now();
-select now() + interval '1' second - now();
-select now() - now();
+declare deterministic timestamp;
+set deterministic = now();
+select deterministic + 1 - deterministic;
+select deterministic + interval '1' second - deterministic;
+select deterministic - deterministic;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-16 Thread Sjoerd Mullender
Changeset: 1c8006d041d0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1c8006d041d0
Modified Files:
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (60 lines):

diff --git a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
@@ -1,5 +1,8 @@
 start transaction;
 
+declare deterministic_insert timestamp;
+set deterministic_insert = current_timestamp;
+
 create table x(
 i integer,
 t timestamp,
@@ -7,10 +10,14 @@ tn timestamp default null,
 td timestamp default now(),
 tc timestamp default current_timestamp);
 
-insert into x(i,t) values(0,now());
+insert into x(i,t,td,tc) 
values(0,deterministic_insert,deterministic_insert,deterministic_insert);
 select i, tn, td - t, tc - t from x;
+insert into x(i,t) values(0,now());
 drop table x;
 
+declare other_deterministic_insert time;
+set other_deterministic_insert = current_time;
+
 create table x(
 i integer,
 t time,
@@ -18,8 +25,9 @@ tn time default null,
 td time default now(),
 tc time default current_time);
 
+insert into x(i,t,td,tc) 
values(0,other_deterministic_insert,other_deterministic_insert,other_deterministic_insert);
+select i, tn, td - t, tc - t from x;
 insert into x(i,t) values(0,now());
-select i, tn, td - t, tc - t from x;
 drop table x;
 
 declare t timestamp;
diff --git 
a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
@@ -68,6 +68,8 @@ stdout of test 'current_timestamp.Bug-34
 % int, timestamp,  sec_interval,   sec_interval # type
 % 1,   26, 5,  5 # length
 [ 0,   NULL,   0.000,  0.000   ]
+#insert into x(i,t) values(0,now());
+[ 1]
 #drop table x;
 #create table x(
 #i integer,
@@ -83,6 +85,8 @@ stdout of test 'current_timestamp.Bug-34
 % int, time,   sec_interval,   sec_interval # type
 % 1,   8,  5,  5 # length
 [ 0,   NULL,   0.000,  0.000   ]
+#insert into x(i,t) values(0,now());
+[ 1]
 #drop table x;
 #declare t timestamp;
 #declare tt time;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2019-12-13 Thread Pedro Ferreira
Changeset: eba15b5140ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eba15b5140ae
Removed Files:

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.sql

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.err

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.out
Modified Files:
geom/monetdb5/geom.c
geom/monetdb5/geomBulk.c
monetdb5/extras/rapi/rapi.c
monetdb5/mal/mal_atom.c
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_exception.c
monetdb5/mal/mal_factory.c
monetdb5/mal/mal_import.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_namespace.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_session.c
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/str.c
monetdb5/modules/atoms/streams.c
monetdb5/modules/atoms/url.c
monetdb5/modules/atoms/uuid.c
monetdb5/modules/atoms/xml.c
monetdb5/modules/kernel/alarm.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/kernel/status.c
monetdb5/modules/mal/batExtensions.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/groupby.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/json_util.c
monetdb5/modules/mal/language.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/manifold.c
monetdb5/modules/mal/manual.c
monetdb5/modules/mal/mat.c
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/mkey.c
monetdb5/modules/mal/oltp.c
monetdb5/modules/mal/orderidx.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/projectionpath.c
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/sysmon.c
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tokenizer.c
monetdb5/modules/mal/txtsim.c
monetdb5/modules/mal/wlc.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_commonTerms.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_deadcode.c
monetdb5/optimizer/opt_emptybind.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_garbageCollector.c
monetdb5/optimizer/opt_generator.c
monetdb5/optimizer/opt_jit.c
monetdb5/optimizer/opt_json.c
monetdb5/optimizer/opt_macro.c
monetdb5/optimizer/opt_matpack.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_oltp.c
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_postfix.c
monetdb5/optimizer/opt_projectionpath.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_querylog.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_remoteQueries.c
monetdb5/optimizer/opt_reorder.c
monetdb5/optimizer/opt_volcano.c
monetdb5/optimizer/opt_wlc.c
monetdb5/optimizer/opt_wrapper.c
monetdb5/scheduler/run_adder.c
monetdb5/scheduler/run_memo.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/conversion.c
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/backends/monet5/UDF/pyapi/formatinput.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/UDF/udf/udf.c
sql/backends/monet5/generator/generator.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_bat2time.c
sql/backends/monet5/sql_cast.c
sql/backends/monet5/sql_cast_impl_down_from_flt.h
sql/backends/monet5/sql_cast_impl_int.h
sql/backends/monet5/sql_cast_impl_up_to_flt.h
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_datetrunc.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_fround_impl.h
sql/backends/monet5/sql_gencode.c

MonetDB: default - Merge with Nov2019

2019-12-12 Thread Pedro Ferreira
Changeset: d318a5973f0c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d318a5973f0c
Added Files:
sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.sql
sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.err
sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.out

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.sql

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.err

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.out
Modified Files:
sql/backends/monet5/sql_scenario.c
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/date_trunc.sql
sql/test/BugTracker-2019/Tests/date_trunc.stable.out
sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql
sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 552 to 300 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -1390,32 +1390,38 @@ SQLCacheRemove(Client c, str nme)
 str
 SQLcallback(Client c, str msg)
 {
-   char *newerr;
+   char *newerr = NULL;
 
-   if (msg &&
-   (newerr = GDKmalloc(strlen(msg) + 1)) != NULL) {
-   /* remove exception decoration */
-   char *m, *n, *p, *s;
-   size_t l;
+   if (msg) {
+   if (!(newerr = GDKmalloc(strlen(msg) + 1))) {
+   msg = createException(SQL, "SQLcallback", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   } else {
+   /* remove exception decoration */
+   char *m, *n, *p, *s;
+   size_t l;
 
-   m = msg;
-   p = newerr;
-   while (m && *m) {
-   n = strchr(m, '\n');
-   s = getExceptionMessageAndState(m);
-   if (n) {
-   n++; /* include newline */
-   l = n - s;
-   } else {
-   l = strlen(s);
+   m = msg;
+   p = newerr;
+   while (m && *m) {
+   n = strchr(m, '\n');
+   s = getExceptionMessageAndState(m);
+   if (n) {
+   n++; /* include newline */
+   l = n - s;
+   } else {
+   l = strlen(s);
+   }
+   memcpy(p, s, l);
+   p += l;
+   m = n;
}
-   memcpy(p, s, l);
-   p += l;
-   m = n;
+   *p = 0;
+   freeException(msg);
+   if (!(msg = GDKrealloc(newerr, strlen(newerr) + 1))) {
+   GDKfree(newerr);
+   msg = createException(SQL, "SQLcallback", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   }
}
-   *p = 0;
-   freeException(msg);
-   msg = GDKrealloc(newerr, strlen(newerr) + 1);
}
return MALcallback(c, msg);
 }
diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -37,11 +37,11 @@ merge-table-limit.Bug-6756
 double-free.Bug-6757
 HAVE_LIBPY3?python-loader-string.Bug-6759
 select-char.Bug-6761
+prepared-select-with-error-causes-hang.Bug-6761
 grant-select-column.Bug-6765
 next-get-value-bulk.Bug-6766
 filter_json_null.Bug-6773
 prod-decimals.Bug-6774
-prepared-select-with-error-causes-hang.Jira-292
 NOT_IN-AND-OR-wrong-results.Bug-6775
 outer-join-varchar.Bug-6776
 msqldump-mapi-cache.Bug-6777
@@ -56,3 +56,4 @@ cast-interval.Bug-6793
 could-not-allocate-space.Bug-6795
 HAVE_LIBPY3?python3-udf-modules.Bug-6797
 json-text-empty-separator.Bug-6798
+orderby-alias-expr.Bug-6799
diff --git a/sql/test/BugTracker-2019/Tests/date_trunc.sql 
b/sql/test/BugTracker-2019/Tests/date_trunc.sql
--- a/sql/test/BugTracker-2019/Tests/date_trunc.sql
+++ b/sql/test/BugTracker-2019/Tests/date_trunc.sql
@@ -14,3 +14,20 @@ select date_trunc('year', timestamp '211
 select date_trunc('decade', timestamp '2119-02-17 02:08:12.345678');
 select date_trunc('century', timestamp '2119-02-17 02:08:12.345678');
 select date_trunc('millennium', timestamp '2119-02-17 02:08:12.345678');
+
+select timestamp '1999-12-31 23:59:59.987654';
+
+select 

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

2019-12-12 Thread Sjoerd Mullender
Changeset: 24704d193728 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24704d193728
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 Nov2019 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 Nov2019 branch.

2019-12-12 Thread Sjoerd Mullender
Changeset: 8b7962acdd4e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b7962acdd4e
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (99 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -742,3 +742,5 @@ 90486f8f87ff0602f3ab143c629ba0aed2153d64
 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_3
 90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release
 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_release
+fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_5
+fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -114,7 +114,7 @@ Group: Applications/Databases
 License: MPLv2.0
 URL: https://www.monetdb.org/
 BugURL: https://bugs.monetdb.org/
-Source: 
https://www.monetdb.org/downloads/sources/Nov2019/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Nov2019-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
@@ -1061,6 +1061,27 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Thu Dec 12 2019 Sjoerd Mullender  - 11.35.5-20191212
+- Rebuilt.
+- BZ#6723: columns aliases duplicates should not be allowed. automatic
+  aliasing required.
+- BZ#6724: Prepare confuses types when more than one argument is used
+- BZ#6726: Python aggregation does not create aggr_group when aggregating
+  over all rows
+- BZ#6765: GRANT SELECT privilege on a subset of table columns results
+  in access denied error when selecting the same columns from the table
+- BZ#6790: Count distinct giving wrong results
+- BZ#6791: str_to_time('11:40', '%H:%M') creates wrong time value
+- BZ#6792: JSON path compiler accepts invalid input
+- BZ#6793: cast(interval second value to int or decimal) is wrong (by
+  a factor of 1000), cast(interval month value to decimal or floating
+  point) fails
+- BZ#6794: external name fits.listdir not bound (sys.listdir) Fatal
+  error during initialization:
+- BZ#6796: Incorrect crash time reported by monetdb tool after crash
+  of mserver5
+- BZ#6798: json.text off by one error
+
 * Mon Nov 25 2019 Sjoerd Mullender  - 11.35.3-20191125
 - Rebuilt.
 - BZ#3533: SQL aggregate functions avg(), sum() and median() return an
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+monetdb (11.35.5) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#6723: columns aliases duplicates should not be allowed. automatic
+aliasing required.
+  * BZ#6724: Prepare confuses types when more than one argument is used
+  * BZ#6726: Python aggregation does not create aggr_group when aggregating
+over all rows
+  * BZ#6765: GRANT SELECT privilege on a subset of table columns results
+in access denied error when selecting the same columns from the table
+  * BZ#6790: Count distinct giving wrong results
+  * BZ#6791: str_to_time('11:40', '%H:%M') creates wrong time value
+  * BZ#6792: JSON path compiler accepts invalid input
+  * BZ#6793: cast(interval second value to int or decimal) is wrong (by
+a factor of 1000), cast(interval month value to decimal or floating
+point) fails
+  * BZ#6794: external name fits.listdir not bound (sys.listdir) Fatal
+error during initialization:
+  * BZ#6796: Incorrect crash time reported by monetdb tool after crash
+of mserver5
+  * BZ#6798: json.text off by one error
+
+ -- Sjoerd Mullender   Thu, 12 Dec 2019 09:24:08 +0100
+
 monetdb (11.35.3) 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=19:1:0
+GDK_VERSION=19:2:0
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=12:2:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
-MONETDB5_VERSION=28:1:0
+MONETDB5_VERSION=28:2:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=13:3:0
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


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

2019-12-12 Thread Sjoerd Mullender
Changeset: c4b77f736040 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4b77f736040
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 Nov2019 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 Nov2019

2019-12-11 Thread Pedro Ferreira
Changeset: 679259da51cf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=679259da51cf
Modified Files:
buildtools/doc/windowsbuild.rst

sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
Branch: default
Log Message:

Merge with Nov2019


diffs (130 lines):

diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -340,7 +340,7 @@ optional prerequisites iconv_ and zlib_,
 Run the following commands in the ``win32`` subfolder, substituting
 the correct locations for the iconv and zlib libraries::
 
- cscript configure.js compiler=msvc prefix=C:\Libraries\libxml2-2.9.8.win64 ^
+ cscript configure.js compiler=msvc prefix=C:\Libraries\libxml2-2.9.9.win64 ^
   
include=C:\Libraries\iconv-1.15.win64\include;C:\Libraries\zlib-1.2.11.win64\include
 ^
   lib=C:\Libraries\iconv-1.15.win64\lib;C:\Libraries\zlib-1.2.11.win64\lib ^
   iconv=yes zlib=yes vcmanifest=yes
@@ -476,8 +476,6 @@ the following extra Cygwin packages in o
prefix=/cygdrive/c/Libraries/iconv-1.16.win64-vs2019
export INCLUDE LIB PATH
win32_target=_WIN32_WINNT_WIN7
-   prefix=/cygdrive/c/Libraries/iconv-1.15.win32-vs2015
-   PATH="$prefix/bin:$PATH"
./configure --host=i686-w64-mingw32 --prefix="$prefix" \
   CC="$PWD/build-aux/compile cl -nologo" \
   CXX="$PWD/build-aux/compile cl -nologo" \
diff --git 
a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py 
b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
--- 
a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
+++ 
b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
@@ -23,54 +23,57 @@ farm_dir = tempfile.mkdtemp()
 
 prt1 = freeport()
 os.makedirs(os.path.join(farm_dir, 'node1'))
-prc1 = process.server(mapiport=prt1, dbname='node1', 
dbfarm=os.path.join(farm_dir, 'node1'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
-conn1 = pymonetdb.connect(database='node1', port=prt1, autocommit=True)
-cur1 = conn1.cursor()
-cur1.execute("start transaction;")
-cur1.execute("create table tab1 (col1 clob);")
-cur1.execute("insert into tab1 values ('a');")
-cur1.execute("create table tab2 (col1 tinyint);")
-cur1.execute("insert into tab2 values (1);")
-cur1.execute("commit;")
+try:
+prc1 = process.server(mapiport=prt1, dbname='node1', 
dbfarm=os.path.join(farm_dir, 'node1'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
+try:
+conn1 = pymonetdb.connect(database='node1', port=prt1, autocommit=True)
+cur1 = conn1.cursor()
+cur1.execute("start transaction;")
+cur1.execute("create table tab1 (col1 clob);")
+cur1.execute("insert into tab1 values ('a');")
+cur1.execute("create table tab2 (col1 tinyint);")
+cur1.execute("insert into tab2 values (1);")
+cur1.execute("commit;")
 
-prt2 = freeport()
-os.makedirs(os.path.join(farm_dir, 'node2'))
-prc2 = process.server(mapiport=prt2, dbname='node2', 
dbfarm=os.path.join(farm_dir, 'node2'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
-conn2 = pymonetdb.connect(database='node2', port=prt2, autocommit=True)
-cur2 = conn2.cursor()
-cur2.execute("create remote table tab1 (col1 clob, col2 int) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
-cur2.execute("create remote table tab2 (col1 double) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
-try:
-cur2.execute("select col2 from tab1;")  # col2 doesn't exist
-except pymonetdb.OperationalError as e:
-print(e)
-try:
-cur2.execute("select col1 from tab2;")  # col1 is not a floating point 
column
-except pymonetdb.OperationalError as e:
-print(e)
-cur2.execute("drop table tab1;")
-cur2.execute("drop table tab2;")
+prt2 = freeport()
+os.makedirs(os.path.join(farm_dir, 'node2'))
+prc2 = process.server(mapiport=prt2, dbname='node2', 
dbfarm=os.path.join(farm_dir, 'node2'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
+try:
+conn2 = pymonetdb.connect(database='node2', port=prt2, 
autocommit=True)
+cur2 = conn2.cursor()
+cur2.execute("create remote table tab1 (col1 clob, col2 int) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
+cur2.execute("create remote table tab2 (col1 double) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
+try:
+cur2.execute("select col2 from tab1;")  # col2 doesn't exist
+except pymonetdb.OperationalError as e:
+print(e)
+try:
+cur2.execute("select col1 from tab2;")  # col1 is not a 
floating point column
+except pymonetdb.OperationalError as e:
+print(e)
+cur2.execute("drop table tab1;")
+cur2.execute("drop table tab2;")
 

MonetDB: default - Merge with Nov2019

2019-12-11 Thread Pedro Ferreira
Changeset: b4673eacf027 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4673eacf027
Added Files:
sql/test/mergetables/Tests/transaction-conflict.stable.err
sql/test/mergetables/Tests/transaction-conflict.stable.out
Modified Files:
sql/common/sql_list.c
sql/include/sql_catalog.h
sql/storage/store.c
sql/test/analytics/Tests/analytics01.sql
sql/test/analytics/Tests/analytics01.stable.out
sql/test/mergetables/Tests/transaction-conflict.py
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 329 to 300 lines):

diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- a/sql/common/sql_list.c
+++ b/sql/common/sql_list.c
@@ -318,6 +318,7 @@ list_remove_node(list *l, node *n)
MT_lock_unset(>ht_lock);
node_destroy(l, n);
l->cnt--;
+   assert(l->cnt >= 0);
return p;
 }
 
diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h
--- a/sql/include/sql_catalog.h
+++ b/sql/include/sql_catalog.h
@@ -364,13 +364,13 @@ typedef enum sql_ftype {
F_LOADER = 7
 } sql_ftype;
 
-#define IS_FUNC(f) (f->type == F_FUNC)
-#define IS_PROC(f) (f->type == F_PROC)
-#define IS_AGGR(f) (f->type == F_AGGR)
-#define IS_FILT(f) (f->type == F_FILT)
-#define IS_UNION(f) (f->type == F_UNION)
-#define IS_ANALYTIC(f) (f->type == F_ANALYTIC)
-#define IS_LOADER(f) (f->type == F_LOADER)
+#define IS_FUNC(f) ((f)->type == F_FUNC)
+#define IS_PROC(f) ((f)->type == F_PROC)
+#define IS_AGGR(f) ((f)->type == F_AGGR)
+#define IS_FILT(f) ((f)->type == F_FILT)
+#define IS_UNION(f)((f)->type == F_UNION)
+#define IS_ANALYTIC(f) ((f)->type == F_ANALYTIC)
+#define IS_LOADER(f)   ((f)->type == F_LOADER)
 
 typedef enum sql_flang {
FUNC_LANG_INT = 0, /* internal */
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1155,7 +1155,7 @@ load_schema(sql_trans *tr, sqlid id, oid
type_id = find_sql_column(types, "id");
rs = table_funcs.rids_select(tr, type_schema, >base.id, >base.id, 
type_id, , NULL, NULL);
for (rid = table_funcs.rids_next(rs); !is_oid_nil(rid); rid = 
table_funcs.rids_next(rs)) 
-   cs_add(>types, load_type(tr, s, rid), 0);
+   cs_add(>types, load_type(tr, s, rid), 0);
table_funcs.rids_destroy(rs);
 
/* second tables */
@@ -1703,7 +1703,6 @@ bootstrap_create_table(sql_trans *tr, sq
return t;
 }
 
-
 static sql_schema *
 bootstrap_create_schema(sql_trans *tr, char *name, sqlid auth_id, int owner)
 {
@@ -2201,7 +2200,6 @@ store_exit(void)
store_initialized=0;
 }
 
-
 /* call locked! */
 int
 store_apply_deltas(bool not_locked)
@@ -2340,7 +2338,6 @@ idle_manager(void)
}
 }
 
-
 void
 store_lock(void)
 {
@@ -3032,7 +3029,6 @@ sql_trans_copy_part( sql_trans *tr, sql_
 {
sql_schema *syss = find_sql_schema(tr, isGlobal(t)?"sys":"tmp");
sql_table *sysic = find_sql_table(syss, "objects");
-   node *n;
sql_part *npt = SA_ZNEW(tr->sa, sql_part);
 
base_init(tr->sa, >base, pt->base.id, TR_NEW, npt->base.name);
@@ -3041,7 +3037,7 @@ sql_trans_copy_part( sql_trans *tr, sql_
npt->with_nills = pt->with_nills;
npt->t = t;
 
-   assert(!npt->t || isMergeTable(npt->t) || isReplicaTable(npt->t));
+   assert(isMergeTable(npt->t) || isReplicaTable(npt->t));
if (isRangePartitionTable(t)) {
npt->part.range.minvalue = sa_alloc(tr->sa, 
pt->part.range.minlength);
npt->part.range.maxvalue = sa_alloc(tr->sa, 
pt->part.range.maxlength);
@@ -3051,7 +3047,7 @@ sql_trans_copy_part( sql_trans *tr, sql_
npt->part.range.maxlength = pt->part.range.maxlength;
} else if (isListPartitionTable(t)) {
npt->part.values = list_new(tr->sa, (fdestroy) NULL);
-   for (n = pt->part.values->h ; n ; n = n->next) {
+   for (node *n = pt->part.values->h ; n ; n = n->next) {
sql_part_value *prev = (sql_part_value*) n->data, 
*nextv = SA_ZNEW(tr->sa, sql_part_value);
nextv->tpe = prev->tpe;
nextv->value = sa_alloc(tr->sa, prev->length);
@@ -3077,7 +3073,6 @@ trigger_dup(sql_trans *tr, int flags, sq
 {
sql_allocator *sa = (newFlagSet(flags))?tr->parent->sa:tr->sa;
sql_trigger *nt = SA_ZNEW(sa, sql_trigger);
-   node *n;
 
base_init(sa, >base, i->base.id, tr_flag(>base, flags), 
i->base.name);
 
@@ -3095,7 +3090,7 @@ trigger_dup(sql_trans *tr, int flags, sq
nt->condition = sa_strdup(sa, i->condition);
nt->statement = sa_strdup(sa, i->statement);
 
-   for (n = i->columns->h; n; n = n->next) {
+   for (node *n = i->columns->h; n; n = n->next) {
sql_kc *okc = n->data;
 
list_append(nt->columns, kc_dup(tr, flags, okc, t));
@@ -5915,6 +5910,7 @@ 

MonetDB: default - Merge with Nov2019 branch.

2019-12-11 Thread Sjoerd Mullender
Changeset: 8436d13becf4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8436d13becf4
Added Files:
sql/test/BugTracker-2019/Tests/json-text-empty-separator.Bug-6798.sql

sql/test/BugTracker-2019/Tests/json-text-empty-separator.Bug-6798.stable.err

sql/test/BugTracker-2019/Tests/json-text-empty-separator.Bug-6798.stable.out
sql/test/mergetables/Tests/transaction-conflict.py
Modified Files:
common/utils/msabaoth.c
monetdb5/modules/atoms/json.c
sql/backends/monet5/sql_cat.c
sql/include/sql_catalog.h
sql/server/sql_partition.c
sql/storage/store.c
sql/test/BugTracker-2019/Tests/All
sql/test/mergetables/Tests/All
tools/merovingian/client/monetdb.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 2360 to 300 lines):

diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -848,8 +848,7 @@ msab_getUplogInfo(sabuplog *ret, const s
start = stop = up = 0;
p = data;
while ((c = getc(f)) != EOF) {
-   *p = (char)c;
-   switch (*p) {
+   switch (c) {
case '\t':
/* start attempt */
ret->startcntr++;
@@ -879,7 +878,7 @@ msab_getUplogInfo(sabuplog *ret, const s
break;
default:
/* timestamp */
-   p++;
+   *p++ = c;
break;
}
}
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -1183,7 +1183,7 @@ JSONjson2textSeparator(str *ret, json *j
}
JSONplaintext(s, , jt, 0, **sep);
l = strlen(s);
-   if (l)
+   if (l && **sep)
s[l - 1] = 0;
*ret = s;
JSONfree(jt);
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -38,21 +38,21 @@
 #include "orderidx.h"
 
 #define initcontext() \
-if ((msg = getSQLContext(cntxt, mb, , NULL)) != NULL)\
-return msg;\
-if ((msg = checkSQLContext(cntxt)) != NULL)\
-return msg;\
-if (STORE_READONLY)\
-throw(SQL,"sql.cat",SQLSTATE(25006) "Schema statements cannot be 
executed on a readonly database.");
+   if ((msg = getSQLContext(cntxt, mb, , NULL)) != NULL)\
+   return msg;\
+   if ((msg = checkSQLContext(cntxt)) != NULL)\
+   return msg;\
+   if (STORE_READONLY)\
+   throw(SQL,"sql.cat",SQLSTATE(25006) "Schema statements cannot 
be executed on a readonly database.");
 
 static char *
 SaveArgReference(MalStkPtr stk, InstrPtr pci, int arg)
-{   
-char *val = *getArgReference_str(stk, pci, arg);
-
-if (val && strcmp(val, str_nil) == 0)
-val = NULL;
-return val;
+{
+   char *val = *getArgReference_str(stk, pci, arg);
+
+   if (val && strcmp(val, str_nil) == 0)
+   val = NULL;
+   return val;
 }
 
 static int
@@ -88,14 +88,14 @@ rel_check_tables(sql_table *nt, sql_tabl
 
if (subtype_cmp(>type, >type) != 0)
throw(SQL,"sql.rel_check_tables",SQLSTATE(3F000) "ALTER 
%s: to be added table column type doesn't match %s definition", errtable, 
errtable);
-   if(isRangePartitionTable(nt) || isListPartitionTable(nt)) {
+   if (isRangePartitionTable(nt) || isListPartitionTable(nt)) {
if (nc->null != mc->null)

throw(SQL,"sql.rel_check_tables",SQLSTATE(3F000) "ALTER %s: to be added table 
column NULL check doesn't match %s definition", errtable, errtable);
if ((!nc->def && mc->def) || (nc->def && !mc->def) || 
(nc->def && mc->def && strcmp(nc->def, mc->def) != 0))

throw(SQL,"sql.rel_check_tables",SQLSTATE(3F000) "ALTER %s: to be added table 
column DEFAULT value doesn't match %s definition", errtable, errtable);
}
}
-   if(isNonPartitionedTable(nt)) {
+   if (isNonPartitionedTable(nt)) {
if (cs_size(>idxs) != cs_size(>idxs))
throw(SQL,"sql.rel_check_tables",SQLSTATE(3F000) "ALTER 
%s: to be added table index doesn't match %s definition", errtable, errtable);
if (cs_size(>idxs))
@@ -128,8 +128,8 @@ rel_check_tables(sql_table *nt, sql_tabl
}
}
 
-   for(sql_table *up = nt->p ; up ; up = up->p) {
-   if(!strcmp(up->s->base.name, 

MonetDB: default - Merge with Nov2019

2019-12-09 Thread Pedro Ferreira
Changeset: 3b1b98bdb692 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b1b98bdb692
Modified Files:
sql/storage/store.c

sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
sql/test/pg_regress/Tests/interval.stable.out
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Nov2019


diffs (127 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1044,25 +1044,25 @@ set_members(changeset *ts)
 {
node *n, *m;
 
-   if (ts && ts->set)
-   for (n = ts->set->h; n; n = n->next) {
-   sql_table *t = n->data;
-
-   if (isMergeTable(t) || isReplicaTable(t)) {
-   if (t->members.set)
-   for (m = t->members.set->h; m; m = m->next) {
-   sql_part *p = m->data;
-   sql_table *pt = find_sql_table(t->s, 
p->base.name);
-
-   p->t = pt;
-   pt->p = t;
+   if (ts && ts->set) {
+   for (n = ts->set->h; n; n = n->next) {
+   sql_table *t = n->data;
+   t->p = NULL;
+   }
+   for (n = ts->set->h; n; n = n->next) {
+   sql_table *t = n->data;
+
+   if (isMergeTable(t) || isReplicaTable(t)) {
+   if (t->members.set)
+   for (m = t->members.set->h; m; m = m->next) {
+   sql_part *p = m->data;
+   sql_table *pt = find_sql_table(t->s, 
p->base.name);
+   
+   p->t = pt;
+   pt->p = t;
+   }
}
}
-   if(t->p) {
-   sql_part *pt = find_sql_part(t->p, t->base.name);
-   if(!pt)
-   t->p = NULL;
-   }
}
 }
 
diff --git 
a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py 
b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
--- 
a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
+++ 
b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
@@ -22,6 +22,7 @@ def freeport():
 farm_dir = tempfile.mkdtemp()
 
 prt1 = freeport()
+os.makedirs(os.path.join(farm_dir, 'node1'))
 prc1 = process.server(mapiport=prt1, dbname='node1', 
dbfarm=os.path.join(farm_dir, 'node1'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
 conn1 = pymonetdb.connect(database='node1', port=prt1, autocommit=True)
 cur1 = conn1.cursor()
@@ -33,13 +34,20 @@ cur1.execute("insert into tab2 values (1
 cur1.execute("commit;")
 
 prt2 = freeport()
+os.makedirs(os.path.join(farm_dir, 'node2'))
 prc2 = process.server(mapiport=prt2, dbname='node2', 
dbfarm=os.path.join(farm_dir, 'node2'), stdin=process.PIPE, 
stdout=process.PIPE, stderr=process.PIPE)
 conn2 = pymonetdb.connect(database='node2', port=prt2, autocommit=True)
 cur2 = conn2.cursor()
 cur2.execute("create remote table tab1 (col1 clob, col2 int) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
 cur2.execute("create remote table tab2 (col1 double) on 
'mapi:monetdb://localhost:"+str(prt1)+"/node1';")
-cur2.execute("select col2 from tab1;")  # col2 doesn't exist
-cur2.execute("select col1 from tab2;")  # col1 is not a floating point column
+try:
+cur2.execute("select col2 from tab1;")  # col2 doesn't exist
+except pymonetdb.OperationalError as e:
+print(e)
+try:
+cur2.execute("select col1 from tab2;")  # col1 is not a floating point 
column
+except pymonetdb.OperationalError as e:
+print(e)
 cur2.execute("drop table tab1;")
 cur2.execute("drop table tab2;")
 
diff --git a/sql/test/pg_regress/Tests/interval.stable.out 
b/sql/test/pg_regress/Tests/interval.stable.out
--- a/sql/test/pg_regress/Tests/interval.stable.out
+++ b/sql/test/pg_regress/Tests/interval.stable.out
@@ -75,7 +75,7 @@ stdout of test 'interval` in directory '
 % %2 # name
 % double # type
 % 24 # length
-[ 3.1756752e+13]
+[ 3.1756752e+10]
 #select min(f1) from interval_tbl;
 % sys.%1 # table_name
 % %1 # name
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -4220,6 +4220,7 @@ def main(argv) :
 ErrXit("%s: not a valid test name" % args[0])
 args = [head]
 if tail != 'All':
+CONDITIONALS['KNOWNFAIL'] = 'execute'
 for ext in ('_s00.malC', '_p00.malC', '_s00.sql',
 '_p00.sql', '.MAL.py', '.SQL.py', '.malC',
 '.sql', '.py', '.R', ''):
@@ -4236,6 +4237,7 @@ def main(argv) :
   

MonetDB: default - Merge with Nov2019 branch.

2019-12-09 Thread Sjoerd Mullender
Changeset: 7bbf87248806 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7bbf87248806
Modified Files:
sql/common/sql_types.c
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (33 lines):

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
@@ -110,7 +110,7 @@ static int convert_matrix[EC_MAX][EC_MAX
 /* EC_BLOB */  { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 /* EC_POS */   { 0, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
 /* EC_NUM */   { 0, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
-/* EC_MONTH*/   { 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
+/* EC_MONTH*/   { 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0 },
 /* EC_SEC*/ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0 },
 /* EC_DEC */   { 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
 /* EC_FLT */   { 0, 0, 0, 1, 1, 0, 1, 1, 0, 3, 1, 1, 0, 0, 0, 0, 0 },
diff --git a/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out 
b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
--- a/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
+++ b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
@@ -69,7 +69,7 @@ stdout of test 'cast-interval.Bug-6793` 
 % sys.interval_tbl,sys.L1 # table_name
 % f1,  L1 # name
 % month_interval,  decimal # type
-% 1,   5 # length
+% 1,   4 # length
 [ 1,   1   ]
 [ 2,   2   ]
 [ 3,   3   ]
@@ -88,7 +88,7 @@ stdout of test 'cast-interval.Bug-6793` 
 % L2,  L3, L5, L7, L11 # name
 % bigint,  month_interval, int,decimal,real # type
 % 1,   2,  2,  10, 15 # length
-[ 4,   10, 10, 10.000, 10.000  ]
+[ 4,   10, 10, 10.000, 10  ]
 #DROP TABLE INTERVAL_TBL;
 
 # 13:25:36 >  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2019-12-09 Thread Pedro Ferreira
Changeset: c927e17b6982 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c927e17b6982
Added Files:
sql/test/BugTracker-2019/Tests/python3-udf-modules.Bug-6797.sql
sql/test/BugTracker-2019/Tests/python3-udf-modules.Bug-6797.stable.err
sql/test/BugTracker-2019/Tests/python3-udf-modules.Bug-6797.stable.out
sql/test/mergetables/Tests/sqlsmith.Bug-6480.reqtests
Modified Files:
MonetDB.spec
debian/monetdb5-server.install
debian/monetdb5-sql.install
sql/backends/monet5/Tests/pyapi08.sql
sql/backends/monet5/sql_statement.c
sql/test/BugTracker-2015/Tests/timestamp_convert.Bug-3815.stable.out
sql/test/BugTracker-2016/Tests/epoch.Bug-3979.sql
sql/test/BugTracker-2019/Tests/All
sql/test/pg_regress/Tests/interval.stable.out.int128
sql/test/snodgrass/Tests/cast_select.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (295 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -635,7 +635,6 @@ exit 0
 %if %{with fits}
 %exclude %{_libdir}/monetdb5/fits.mal
 %exclude %{_libdir}/monetdb5/autoload/*_fits.mal
-%exclude %{_libdir}/monetdb5/createdb/*_fits.sql
 %endif
 %if %{with geos}
 %exclude %{_libdir}/monetdb5/geom.mal
@@ -774,6 +773,9 @@ use SQL with MonetDB, you will need to i
 %{_libdir}/monetdb5/autoload/??_sql.mal
 %{_libdir}/monetdb5/lib_sql.so
 %dir %{_libdir}/monetdb5/createdb
+%if %{with fits}
+%exclude %{_libdir}/monetdb5/createdb/*_fits.sql
+%endif
 %if %{with geos}
 %exclude %{_libdir}/monetdb5/createdb/*_geom.sql
 %endif
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -21,7 +21,7 @@ debian/tmp/usr/lib/x86_64-linux-gnu/mone
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/udf.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/u[!d]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 
-# usr/lib/x86_64-linux-gnu/monetdb5/autoload/*.mal EXCEPT: 
*_{bam,geom,gsl,hge,lidar,pyapi,rapi,sql}.mal
+# usr/lib/x86_64-linux-gnu/monetdb5/autoload/*.mal EXCEPT: 
*_{bam,fits,geom,gsl,hge,lidar,pyapi,rapi,sql}.mal
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/autoload/??_batcalc.mal 
usr/lib/x86_64-linux-gnu/monetdb5/autoload
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/autoload/??_calc.mal 
usr/lib/x86_64-linux-gnu/monetdb5/autoload
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/autoload/??_generator.mal 
usr/lib/x86_64-linux-gnu/monetdb5/autoload
diff --git a/debian/monetdb5-sql.install b/debian/monetdb5-sql.install
--- a/debian/monetdb5-sql.install
+++ b/debian/monetdb5-sql.install
@@ -14,8 +14,8 @@ debian/tmp/usr/lib/x86_64-linux-gnu/mone
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_sql.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/var/monetdb5/dbfarm/.merovingian_properties var/monetdb5/dbfarm
 
-# usr/lib/x86_64-linux-gnu/monetdb5/createdb/*.sql EXCEPT: *_bam.sql, 
*_geom.sql, *_gsl.sql, *_hge.sql *_lidar.sql
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/createdb/??_[!abgjlu]*.sql 
usr/lib/x86_64-linux-gnu/monetdb5/createdb
+# usr/lib/x86_64-linux-gnu/monetdb5/createdb/*.sql EXCEPT: *_bam.sql, 
*_fits.sql, *_geom.sql, *_gsl.sql, *_hge.sql, *_lidar.sql
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/createdb/??_[!abfgjlu]*.sql 
usr/lib/x86_64-linux-gnu/monetdb5/createdb
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/createdb/??_analytics.sql 
usr/lib/x86_64-linux-gnu/monetdb5/createdb
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/createdb/??_json.sql 
usr/lib/x86_64-linux-gnu/monetdb5/createdb
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/createdb/??_generator.sql 
usr/lib/x86_64-linux-gnu/monetdb5/createdb
diff --git a/sql/backends/monet5/Tests/pyapi08.sql 
b/sql/backends/monet5/Tests/pyapi08.sql
--- a/sql/backends/monet5/Tests/pyapi08.sql
+++ b/sql/backends/monet5/Tests/pyapi08.sql
@@ -1125,7 +1125,8 @@ CREATE FUNCTION numpy_distance_fast(stt_
 # just for testing purposes, we have an encoded version of numpy_distance_fast 
here
 CREATE FUNCTION numpy_distance_encoded(stt_in string, tss_in bigint, lat_in 
double, lon_in double, alt_in double) returns table (s1 string, s2 string, 
timestamp int, mindist int) language P 

MonetDB: default - Merge with Nov2019

2019-12-08 Thread Pedro Ferreira
Changeset: aeac9df35cf8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aeac9df35cf8
Modified Files:
sql/backends/monet5/UDF/pyapi/conversion.c
sql/backends/monet5/UDF/pyapi/convert_loops.h
Branch: default
Log Message:

Merge with Nov2019


diffs (84 lines):

diff --git a/sql/backends/monet5/UDF/pyapi/conversion.c 
b/sql/backends/monet5/UDF/pyapi/conversion.c
--- a/sql/backends/monet5/UDF/pyapi/conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/conversion.c
@@ -50,13 +50,11 @@ PyObject *PyArrayObject_FromScalar(PyInp
 
switch (inp->bat_type) {
case TYPE_void:
-   vararray = PyArray_Arange(0, 1, 1, 
 #if SIZEOF_OID == SIZEOF_INT
- 
NPY_UINT
+   vararray = PyArray_Arange(0, 1, 1, NPY_UINT);
 #else
- 
NPY_ULONGLONG
+   vararray = PyArray_Arange(0, 1, 1, NPY_ULONGLONG);
 #endif
-   );
break;
case TYPE_oid:
vararray = PyInt_FromLong((long)(*(oid *)inp->dataptr));
@@ -223,22 +221,18 @@ PyObject *PyArrayObject_FromBAT(PyInput 
} else {
switch (inp->bat_type) {
case TYPE_void:
-   BAT_TO_NP_CREATE_ALWAYS(b, 
 #if SIZEOF_OID == SIZEOF_INT
-   NPY_UINT
+   BAT_TO_NP_CREATE_ALWAYS(b, NPY_UINT);
 #else
-   NPY_ULONGLONG
+   BAT_TO_NP_CREATE_ALWAYS(b, NPY_ULONGLONG);
 #endif
-   );
break;
case TYPE_oid:
-   BAT_TO_NP(b, oid, 
 #if SIZEOF_OID == SIZEOF_INT
-   NPY_UINT32
+   BAT_TO_NP(b, oid, NPY_UINT32);
 #else
-   NPY_UINT64
+   BAT_TO_NP(b, oid, NPY_UINT64);
 #endif
-   );
break;
case TYPE_bit:
BAT_TO_NP(b, bit, NPY_INT8);
diff --git a/sql/backends/monet5/UDF/pyapi/convert_loops.h 
b/sql/backends/monet5/UDF/pyapi/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi/convert_loops.h
@@ -13,19 +13,23 @@
  */
 
 #define BAT_TO_NP_CREATE_ALWAYS(bat, nptpe)
\
-   vararray = PyArray_Arange(0, (double)bat->batCount, 1, nptpe);
+   do {
   \
+   vararray = PyArray_Arange(0, (double)bat->batCount, 1, nptpe);  
   \
+   } while(0)  
   \
 
 #define BAT_TO_NP(bat, mtpe, nptpe)
\
-   if (copy) { 
   \
-   vararray = PyArray_EMPTY(1, elements, nptpe, 0);
   \
-   memcpy(PyArray_DATA((PyArrayObject *)vararray), Tloc(bat, 0),   
   \
-  sizeof(mtpe) * (t_end - t_start));   
   \
-   } else {
   \
-   vararray =  
   \
-   PyArray_New(_Type, 1, elements, nptpe, NULL,
   \
-   &((mtpe *)Tloc(bat, 
0))[t_start], 0,   \
-   NPY_ARRAY_CARRAY || 
!NPY_ARRAY_WRITEABLE, NULL);   \
-   }
+   do {
   \
+   if (copy) { 
   \
+   vararray = PyArray_EMPTY(1, elements, nptpe, 0);
   \
+   memcpy(PyArray_DATA((PyArrayObject *)vararray), 
Tloc(bat, 0),  \
+   sizeof(mtpe) * (t_end - t_start));  
   \
+   } else {
   \
+   vararray =  
   \
+   PyArray_New(_Type, 1, elements, nptpe, 
NULL,   \
+   &((mtpe *)Tloc(bat, 
0))[t_start], 0,   \
+   NPY_ARRAY_CARRAY || 
!NPY_ARRAY_WRITEABLE, NULL);   \
+   }   
   \
+   } 

MonetDB: default - Merge with Nov2019

2019-12-07 Thread Pedro Ferreira
Changeset: cbbe10a4b78d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cbbe10a4b78d
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/msqldump.c
sql/backends/monet5/UDF/pyapi/conversion.c
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 586 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
@@ -128,7 +128,17 @@ squoted_print(stream *f, const char *s, 
if (mnstr_printf(f, "%c", quote) < 0)
return -1;
while (*s) {
+   size_t n = strcspn(s, "\\'\"\177"
+  "\001\002\003\004\005\006\007"
+  "\010\011\012\013\014\015\016\017"
+  "\020\021\022\023\024\025\026\027"
+  "\030\031\032\033\034\035\036\037");
+   if (n > 0 && mnstr_write(f, s, 1, n) < 0)
+   return -1;
+   s += n;
switch (*s) {
+   case '\0':
+   continue;
case '\\':
if (mnstr_write(f, "", 1, 2) < 0)
return -1;
@@ -148,13 +158,8 @@ squoted_print(stream *f, const char *s, 
return -1;
break;
default:
-   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;
-   }
+   if (mnstr_printf(f, "\\%03o", (uint8_t) *s) < 0)
+   return -1;
break;
}
s++;
@@ -1783,14 +1788,13 @@ dump_table_data(Mapi mid, const char *sc
 strcmp(tp, "url") == 0 ||
 strcmp(tp, "uuid") == 0 ||
 string[i])
-   squoted_print(toConsole, s, useInserts 
? '\'' : '"');
+   squoted_print(toConsole, s, '\'');
else
mnstr_printf(toConsole, "%s", s);
} else if (string[i]) {
-   /* write double or single-quoted
-  string with certain characters
-  escaped */
-   squoted_print(toConsole, s, useInserts ? '\'' : 
'"');
+   /* write double-quoted string with
+  certain characters escaped */
+   squoted_print(toConsole, s, '"');
} else
mnstr_printf(toConsole, "%s", s);
 
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -190,7 +190,7 @@ main(int argc, char **argv)
fprintf(stderr, "%s", motd);
}
mapi_trace(mid, trace);
-   mapi_cache_limit(mid, 1);
+   mapi_cache_limit(mid, -1);
 
out = file_wastream(stdout, "stdout");
if (out == NULL) {
diff --git a/sql/backends/monet5/UDF/pyapi/conversion.c 
b/sql/backends/monet5/UDF/pyapi/conversion.c
--- a/sql/backends/monet5/UDF/pyapi/conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/conversion.c
@@ -37,6 +37,11 @@ static bool IsBlobType(int type)
return type == TYPE_blob;
 }
 
+static bool IsVoidType(int type)
+{
+   return type == TYPE_void;
+}
+
 PyObject *PyArrayObject_FromScalar(PyInput *inp, char **return_message)
 {
PyObject *vararray = NULL;
@@ -44,6 +49,18 @@ PyObject *PyArrayObject_FromScalar(PyInp
assert(inp->scalar); // input has to be a scalar
 
switch (inp->bat_type) {
+   case TYPE_void:
+   vararray = PyArray_Arange(0, 1, 1, 
+#if SIZEOF_OID == SIZEOF_INT
+ 
NPY_UINT
+#else
+ 
NPY_ULONGLONG
+#endif
+   );
+   break;
+   case TYPE_oid:
+  

MonetDB: default - Merge with Nov2019

2019-12-06 Thread Pedro Ferreira
Changeset: 9500918e8d18 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9500918e8d18
Added Files:
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.sql
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.err
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
sql/test/BugTracker-2019/Tests/could-not-allocate-space.Bug-6795.sql

sql/test/BugTracker-2019/Tests/could-not-allocate-space.Bug-6795.stable.err

sql/test/BugTracker-2019/Tests/could-not-allocate-space.Bug-6795.stable.out
sql/test/BugTracker-2019/Tests/python-aggregate-no-groups.Bug-6726.sql

sql/test/BugTracker-2019/Tests/python-aggregate-no-groups.Bug-6726.stable.err

sql/test/BugTracker-2019/Tests/python-aggregate-no-groups.Bug-6726.stable.out
Modified Files:
sql/test/BugTracker-2019/Tests/All
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
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 969 to 300 lines):

diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -21,6 +21,7 @@ select_window_function_and_asterisk.Bug-
 disallow_duplicate_column_aliases.Bug-6723
 prepare-types.Bug-6724
 prepare-non-existing-function.Bug-6725
+HAVE_LIBPY3?python-aggregate-no-groups.Bug-6726
 select-distinct.Bug-6728
 table-duplicate-column.Bug-6729
 view-too-few-rows.Bug-6736
@@ -51,3 +52,5 @@ isaUUID.Bug-6784
 count-distinct.Bug-6790
 str_to_time.Bug-6791
 jsonpath-validity.Bug-6792
+cast-interval.Bug-6793
+could-not-allocate-space.Bug-6795
diff --git a/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.sql 
b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.sql
@@ -0,0 +1,20 @@
+CREATE TABLE INTERVAL_TBL (f1 interval second);
+INSERT INTO INTERVAL_TBL (f1) VALUES (1.123);
+INSERT INTO INTERVAL_TBL (f1) VALUES (2.123);
+INSERT INTO INTERVAL_TBL (f1) VALUES (3.123);
+INSERT INTO INTERVAL_TBL (f1) VALUES (4.123);
+SELECT f1, cast(f1 as int), cast(f1 as dec(8,3)), cast(f1 as real) FROM 
INTERVAL_TBL;
+SELECT count(f1), sum(f1), cast(sum(f1) as int), cast(sum(f1) as dec(8,3)), 
cast(sum(f1) as real) FROM INTERVAL_TBL;
+DROP TABLE INTERVAL_TBL;
+
+CREATE TABLE INTERVAL_TBL (f1 interval month);
+INSERT INTO INTERVAL_TBL (f1) VALUES (1);
+INSERT INTO INTERVAL_TBL (f1) VALUES (2);
+INSERT INTO INTERVAL_TBL (f1) VALUES (3);
+INSERT INTO INTERVAL_TBL (f1) VALUES (4);
+SELECT f1, cast(f1 as int) FROM INTERVAL_TBL;
+SELECT f1, cast(f1 as dec(3,0)) FROM INTERVAL_TBL;  -- returns error: types 
month_interval(3,0) and decimal(3,0) are not equal for column 'f1'
+SELECT f1, cast(f1 as real) FROM INTERVAL_TBL;  --  returns error: types 
month_interval(3,0) and real(24,0) are not equal for column 'f1'
+SELECT count(f1), sum(f1), cast(sum(f1) as int), cast(sum(f1) as dec(8,3)), 
cast(sum(f1) as real) FROM INTERVAL_TBL;
+DROP TABLE INTERVAL_TBL;
+
diff --git a/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.err 
b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'cast-interval.Bug-6793` in directory 
'sql/test/BugTracker-2019` itself:
+
+
+# 13:25:35 >  
+# 13:25:35 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=33951" "--set" 
"mapi_usock=/var/tmp/mtest-5984/.s.monetdb.33951" "--forcemito" 
"--dbpath=/home/dinther/dev/dev/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2019"
 "--set" "embedded_c=true"
+# 13:25:35 >  
+
+# builtin opt  gdk_dbpath = 
/home/dinther/dev/dev/INSTALL/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = 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 = 33951
+# cmdline opt  mapi_usock = /var/tmp/mtest-5984/.s.monetdb.33951
+# cmdline opt  gdk_dbpath = 
/home/dinther/dev/dev/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2019
+# cmdline opt  embedded_c = true
+
+# 13:25:36 >  
+# 13:25:36 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-5984" "--port=33951"
+# 13:25:36 >  
+
+
+# 13:25:36 >  
+# 13:25:36 >  "Done."
+# 13:25:36 >  
+
diff --git a/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out 
b/sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
new file mode 100644
--- /dev/null
+++ 

MonetDB: default - Merge with Nov2019 branch.

2019-12-04 Thread Sjoerd Mullender
Changeset: 58f647162da8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58f647162da8
Modified Files:
NT/monetdb_config.h.in
configure.ag
gdk/gdk_batop.c
gdk/gdk_posix.c
monetdb5/extras/rapi/rapi.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (197 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
@@ -394,9 +394,6 @@
 /* Define if semtimedop exists */
 /* #undef HAVE_SEMTIMEDOP */
 
-/* Define to 1 if you have the `setenv' function. */
-/* #undef HAVE_SETENV */
-
 /* Define to 1 if you have the `setsid' function. */
 /* #undef HAVE_SETSID */
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2427,7 +2427,6 @@ AC_CHECK_FUNCS([\
posix_fallocate \
posix_madvise \
putenv \
-   setenv \
setsid \
shutdown \
sigaction \
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -839,6 +839,10 @@ BATdel(BAT *b, BAT *d)
 gdk_return
 BATreplace(BAT *b, BAT *p, BAT *n, bool force)
 {
+   lng t0 = 0;
+
+   ALGODEBUG t0 = GDKusec();
+
if (b == NULL || b->ttype == TYPE_void || p == NULL || n == NULL) {
return GDK_SUCCEED;
}
@@ -987,6 +991,87 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool 
 #endif
}
}
+   } else if (BATtdense(p)) {
+   oid updid = BUNtoid(p, 0);
+
+   if (updid < b->hseqbase || updid + BATcount(p) > hseqend) {
+   GDKerror("BATreplace: id out of range\n");
+   return GDK_FAIL;
+   }
+   updid -= b->hseqbase;
+   if (!force && updid < b->batInserted) {
+   GDKerror("BATreplace: updating committed value\n");
+   return GDK_FAIL;
+   }
+
+   /* we copy all of n, so if there are nils in n we get
+* nils in b (and else we don't know) */
+   b->tnil = n->tnil;
+   /* we may not copy over all of b, so we only know that
+* there are no nils in b afterward if there weren't
+* any in either b or n to begin with */
+   b->tnonil &= n->tnonil;
+   if (n->ttype == TYPE_void) {
+   assert(b->ttype == TYPE_oid);
+   oid *o = Tloc(b, updid);
+   if (is_oid_nil(n->tseqbase)) {
+   /* we may or may not overwrite the old
+* min/max values */
+   BATrmprop(b, GDK_MAX_VALUE);
+   BATrmprop(b, GDK_MIN_VALUE);
+   for (BUN i = 0, j = BATcount(p); i < j; i++)
+   o[i] = oid_nil;
+   b->tnil = true;
+   } else {
+   oid v = n->tseqbase;
+   /* we know min/max of n, so we know
+* the new min/max of b if those of n
+* are smaller/larger than the old */
+   if (minprop && v <= minprop->v.val.oval)
+   BATsetprop(b, GDK_MIN_VALUE, TYPE_oid, 
);
+   else
+   BATrmprop(b, GDK_MIN_VALUE);
+   for (BUN i = 0, j = BATcount(p); i < j; i++)
+   o[i] = v++;
+   if (maxprop && --v >= maxprop->v.val.oval)
+   BATsetprop(b, GDK_MAX_VALUE, TYPE_oid, 
);
+   else
+   BATrmprop(b, GDK_MAX_VALUE);
+   }
+   } else {
+   /* if the extremes of n are at least as
+* extreme as those of b, we can replace b's
+* min/max, else we don't know what b's new
+* min/max are*/
+   PROPrec *prop;
+   if (maxprop != NULL &&
+   (prop = BATgetprop(n, GDK_MAX_VALUE)) != NULL &&
+   atomcmp(VALptr(>v), VALptr(>v)) <= 0)
+   BATsetprop(b, GDK_MAX_VALUE, b->ttype, 
VALptr(>v));
+   else
+   BATrmprop(b, GDK_MAX_VALUE);
+   if (minprop != NULL &&
+   (prop = BATgetprop(n, GDK_MIN_VALUE)) != NULL &&
+   atomcmp(VALptr(>v), VALptr(>v)) >= 0)
+   BATsetprop(b, GDK_MIN_VALUE, b->ttype, 
VALptr(>v));
+   else
+   BATrmprop(b, 

MonetDB: default - Merge with Nov2019

2019-12-04 Thread Pedro Ferreira
Changeset: ba3a72cd7bd3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ba3a72cd7bd3
Modified Files:
sql/backends/monet5/sql_rank.c
sql/server/rel_optimizer.c
sql/test/analytics/Tests/analytics01.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 367 to 300 lines):

diff --git a/sql/backends/monet5/sql_rank.c b/sql/backends/monet5/sql_rank.c
--- a/sql/backends/monet5/sql_rank.c
+++ b/sql/backends/monet5/sql_rank.c
@@ -558,57 +558,90 @@ SQLcume_dist(Client cntxt, MalBlkPtr mb,
(void)cntxt;
if (isaBatType(getArgType(mb, pci, 1))) {
bat *res = getArgReference_bat(stk, pci, 0);
-   BAT *b = BATdescriptor(*getArgReference_bat(stk, pci, 1)), *p, 
*r;
-   BUN cnt;
-   int j;
-   dbl *rb, *rp, *end, cnt_cast;
-   bit *np;
+   BAT *b = BATdescriptor(*getArgReference_bat(stk, pci, 1)), *p, 
*o, *r;
+   BUN ncnt, j = 0;
+   bit *np, *no, *bo1, *bo2, *end;
+   dbl *rb, *rp, cnt_cast, nres;
 
if (!b)
throw(SQL, "sql.cume_dist", SQLSTATE(HY005) "Cannot 
access column descriptor");
-   cnt = BATcount(b);
-   cnt_cast = (dbl) cnt;
-   voidresultBAT(r, TYPE_dbl, cnt, b, "sql.cume_dist");
+   voidresultBAT(r, TYPE_dbl, BATcount(b), b, "sql.cume_dist");
rb = rp = (dbl*)Tloc(r, 0);
-   end = rp + cnt;
if (isaBatType(getArgType(mb, pci, 2))) {
if (isaBatType(getArgType(mb, pci, 3))) {
p = BATdescriptor(*getArgReference_bat(stk, 
pci, 2));
-   if (!p) {
+   o = BATdescriptor(*getArgReference_bat(stk, 
pci, 3));
+   if (!p || !o) {
BBPunfix(b->batCacheid);
+   if (p) BBPunfix(p->batCacheid);
+   if (o) BBPunfix(o->batCacheid);
throw(SQL, "sql.cume_dist", 
SQLSTATE(HY005) "Cannot access column descriptor");
}
np = (bit*)Tloc(p, 0);
-   for(j=0; rpbatCacheid);
throw(SQL, "sql.cume_dist", 
SQLSTATE(HY005) "Cannot access column descriptor");
}
-   np = (bit*)Tloc(p, 0);
-   for(j=0; rpbatCacheid);
+   BBPunfix(o->batCacheid);
+   } else { /* single value, ie no ordering */
+   rp = rb + BATcount(b);
+   for (; rbbatCacheid);
BBPkeepref(*res = r->batCacheid);
} else {
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -940,7 +940,6 @@ order_joins(mvc *sql, list *rels, list *
fnd = 1; // not really, but this bails 
out
continue;
}
-
list_remove_data(rels, r);
append(n_rels, r);
 
diff --git a/sql/test/analytics/Tests/analytics01.stable.out 
b/sql/test/analytics/Tests/analytics01.stable.out
--- a/sql/test/analytics/Tests/analytics01.stable.out
+++ b/sql/test/analytics/Tests/analytics01.stable.out
@@ -182,21 +182,51 @@ stdout of test 'analytics01` in director
 % %4 # name
 % double # type
 % 24 # length
-[ 0.2  ]
-[ 0.2  ]
-[ 0.3  ]
-[ 0.5  ]
-[ 0.5  ]
-[ 0.6  ]
-[ 0.7  ]
-[ 0.8  ]
-[ 0.9  ]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
 [ 1]
 #select cume_dist() over (partition by aa order by aa asc) from analytics;
 % sys.%4 # table_name
 % %4 # name
 % double # type
 % 24 # length
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+#select cume_dist() over (partition by aa order by aa desc) from analytics;
+% sys.%4 # table_name
+% %4 # name
+% double # type
+% 24 # length
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+[ 1]
+#select cume_dist() over (order by aa) from analytics;
+% sys.%4 # table_name
+% %4 # name
+% double # type
+% 24 # length
 [ 0.2  ]
 [ 0.2  ]
 [ 0.3  ]
@@ -207,49 +237,19 @@ stdout of test 'analytics01` in director
 [ 0.8  ]
 [ 0.9  ]
 [ 1]
-#select cume_dist() over (partition by aa order by aa desc) from analytics;
-% sys.%4 # table_name
-% %4 # name
-% double # type
-% 24 # length
-[ 0.2  ]
-[ 0.2  ]
-[ 0.3  ]
-[ 0.4  ]
-[ 0.5  ]
-[ 0.6  ]
-[ 0.7  ]
-[ 0.9  ]
-[ 0.9  ]
-[ 1]
-#select cume_dist() over (order by aa) from 

MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: bc3e06a3a647 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc3e06a3a647
Modified Files:
gdk/gdk_batop.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (11 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -865,6 +865,7 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool 
 
b->tsorted = b->trevsorted = false;
b->tnosorted = b->tnorevsorted = 0;
+   b->tseqbase = oid_nil;
b->tkey = false;
b->tnokey[0] = b->tnokey[1] = 0;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: 3c2bf1acbc06 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c2bf1acbc06
Modified Files:
gdk/gdk_batop.c
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (266 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -839,27 +839,247 @@ BATdel(BAT *b, BAT *d)
 gdk_return
 BATreplace(BAT *b, BAT *p, BAT *n, bool force)
 {
-   BUN r, s;
-   BATiter nvi = bat_iterator(n);
-   oid hseqend;
-
-   if (b == NULL || b->ttype == TYPE_void ||
-   p == NULL || n == NULL || BATcount(n) == 0) {
+   if (b == NULL || b->ttype == TYPE_void || p == NULL || n == NULL) {
+   return GDK_SUCCEED;
+   }
+   if (BATcount(p) != BATcount(n)) {
+   GDKerror("BATreplace: update BATs not the same size\n");
+   return GDK_FAIL;
+   }
+   if (ATOMtype(p->ttype) != TYPE_oid) {
+   GDKerror("BATreplace: positions BAT not type OID\n");
+   return GDK_FAIL;
+   }
+   if (BATcount(n) == 0) {
return GDK_SUCCEED;
}
-   hseqend = b->hseqbase + BATcount(b);
-   BATloop(n, r, s) {
-   oid updid = BUNtoid(p, r);
-   const void *val = BUNtail(nvi, r);
+   if (!force && (b->batRestricted != BAT_WRITE || b->batSharecnt > 0)) {
+   GDKerror("BATreplace: access denied to %s, aborting.\n",
+BATgetId(b));
+   return GDK_FAIL;
+   }
+
+   HASHdestroy(b);
+   OIDXdestroy(b);
+   IMPSdestroy(b);
+
+   b->tsorted = b->trevsorted = false;
+   b->tnosorted = b->tnorevsorted = 0;
+   b->tkey = false;
+   b->tnokey[0] = b->tnokey[1] = 0;
+
+   const PROPrec *maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   const PROPrec *minprop = BATgetprop(b, GDK_MIN_VALUE);
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(b->ttype);
+   const void *nil = ATOMnilptr(b->ttype);
+   oid hseqend = b->hseqbase + BATcount(b);
+   BATiter bi = bat_iterator(b);
+   BATiter ni = bat_iterator(n);
+   bool anynil = false;
+
+   b->theap.dirty = true;
+   if (b->tvarsized) {
+   b->tvheap->dirty = true;
+   for (BUN i = 0, j = BATcount(p); i < j; i++) {
+   oid updid = BUNtoid(p, i);
+
+   if (updid < b->hseqbase || updid >= hseqend) {
+   GDKerror("BATreplace: id out of range\n");
+   return GDK_FAIL;
+   }
+   updid -= b->hseqbase;
+   if (!force && updid < b->batInserted) {
+   GDKerror("BATreplace: updating committed 
value\n");
+   return GDK_FAIL;
+   }
+
+   const void *old = BUNtvar(bi, updid);
+   const void *new = BUNtvar(ni, i);
+   bool isnil = atomcmp(new, nil) == 0;
+   anynil |= isnil;
+   if (b->tnil &&
+   !anynil &&
+   atomcmp(old, nil) == 0) {
+   /* if old value is nil and no new
+* value is, we're not sure anymore
+* about the nil property, so we must
+* clear it */
+   b->tnil = false;
+   }
+   b->tnonil &= !isnil;
+   b->tnil |= isnil;
+   if (maxprop) {
+   if (!isnil &&
+   atomcmp(VALptr(>v), new) < 0) {
+   /* new value is larger than
+* previous largest */
+   BATsetprop(b, GDK_MAX_VALUE, b->ttype, 
new);
+   maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   } else if (atomcmp(VALptr(>v), old) == 
0 &&
+  atomcmp(new, old) != 0) {
+   /* old value is equal to
+* largest and new value is
+* smaller, so we don't know
+* anymore which is the
+* largest */
+   BATrmprop(b, GDK_MAX_VALUE);
+   maxprop = NULL;
+   }
+   }
+   if (minprop) {
+   if (!isnil &&
+   atomcmp(VALptr(>v), new) > 0) {
+   /* new value is 

MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: afe779b2cab8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afe779b2cab8
Modified Files:
debian/monetdb5-server.install
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 307 to 300 lines):

diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,16 +1,17 @@
 debian/tmp/usr/bin/mserver5 usr/bin
 debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
 
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,geom,gsl,lidar,pyapi,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,fits,geom,gsl,lidar,pyapi*,rapi,sql}.so
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_opt_sql_append.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so 
usr/lib/x86_64-linux-gnu/monetdb5
 
-# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,fits,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/ba[!m]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/b[!a]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/f[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/generator.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/g[!es]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/l[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
diff --git a/monetdb5/modules/mal/Tests/inspect05.malC 
b/monetdb5/modules/mal/Tests/inspect05.malC
--- a/monetdb5/modules/mal/Tests/inspect05.malC
+++ b/monetdb5/modules/mal/Tests/inspect05.malC
@@ -1,17 +1,17 @@
 #Illustrate the modules loaded after start
 m:= inspect.getModule();
 m0:= algebra.select(m,nil:bat[:oid],"bat", "bat", true,true,false);# limit 
the list
-m1:= algebra.projection(m0,m);
 k:= inspect.getKind();
-k0:= algebra.projection(m0,k);
 f:= inspect.getFunction();
+s:= inspect.getSignatures();
+a:= inspect.getAddresses();
+
 f0:= algebra.projection(m0,f);
-s:= inspect.getSignatures();
-s0:= algebra.projection(m0,s);
-a:= inspect.getAddresses();
-a0:= algebra.projection(m0,a);
-
 (fv,forder):= algebra.sort(f0,false,false,true);
 
+m1:= algebra.projectionpath(forder,m0,m);
+k0:= algebra.projectionpath(forder,m0,k);
+s0:= algebra.projectionpath(forder,m0,s);
+a0:= algebra.projectionpath(forder,m0,a);
+
 io.print(fv,k0,m1,s0,a0);
-
diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out 
b/monetdb5/modules/mal/Tests/inspect05.stable.out
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out
@@ -29,46 +29,46 @@ stdout of test 'inspect05` in directory 
 # str  str str str str  # type
 #--#
 [ 0@0, "append",   "command",  "bat",  "(i:bat[:any_1], 
u:any_1):bat[:any_1] ","BKCappend_val_wrap;"   ]
-[ 1@0, "append",   "command",  "bat",  "(tt:int, 
heapfile:str):bat[:any_1] ",  "BKCattach;"]
-[ 2@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:any_1, 
force:bit):bat[:any_1] ", "BKCappend_val_force_wrap;" ]
-[ 3@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid], force:bit):bat[:any_1] ",  "BKCappend_cand_force_wrap;"]
-[ 4@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid]):bat[:any_1] ", "BKCappend_cand_wrap;"  ]
-[ 5@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
force:bit):bat[:any_1] ",   "BKCappend_force_wrap;" ]
-[ 6@0, "attach",   "command",  "bat",  "(i:bat[:any_1], 
u:bat[:any_1]):bat[:any_1] ",  "BKCappend_wrap;"   ]
-[ 7@0, "delete",   "command",  "bat",  "(a:bat[:oid], 
b:bat[:oid]):bat[:oid] ","BKCdiffcand;"  ]
-[ 8@0, "delete",   "command",  "bat",  "(sz:lng):bat[:oid] ",  
"BKCdensebat;"  ]
-[ 9@0, "delete",   "command",  "bat",  "(b:bat[:any_1]):bat[:any_1] ", 
"BKCdelete_all;"]
-[ 10@0,"densebat", "command",  "bat",  "(b:bat[:any_1], 
d:bat[:oid]):bat[:any_1] ","BKCdelete_multi;"  ]
-[ 11@0,"diffcand", "command", 

MonetDB: default - Merge with Nov2019

2019-12-02 Thread Pedro Ferreira
Changeset: 1de3c5784ae4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1de3c5784ae4
Modified Files:
sql/server/rel_select.c
sql/test/subquery/Tests/subquery.sql
sql/test/subquery/Tests/subquery.stable.err
sql/test/subquery/Tests/subquery.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (65 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4206,7 +4206,7 @@ rel_order_by(sql_query *query, sql_rel *
 
e = exps_get_exp(rel->exps, nr);
if (!e)
-   return NULL;
+   return sql_error(sql, 
02, SQLSTATE(42000) "SELECT: the order by column number (%d) is not in the 
number of projections range (%d)", nr, list_length(rel->exps));
e = exp_ref(sql->sa, e);
/* do not cache this query */
if (e)
diff --git a/sql/test/subquery/Tests/subquery.sql 
b/sql/test/subquery/Tests/subquery.sql
--- a/sql/test/subquery/Tests/subquery.sql
+++ b/sql/test/subquery/Tests/subquery.sql
@@ -95,6 +95,12 @@ SELECT (VALUES(1),(2)); --error, cardina
 
 SELECT (VALUES(1,2,3)); --error, subquery must return only one column
 
+SELECT i FROM integers ORDER BY (SELECT 1);
+
+SELECT i FROM integers ORDER BY (SELECT 2); --error, the query outputs 1 
column, so not possible to order by the second projection
+
+SELECT i FROM integers ORDER BY (SELECT -1); --error, no in the order by range
+
 drop TABLE integers;
 
 -- varchar tests
diff --git a/sql/test/subquery/Tests/subquery.stable.err 
b/sql/test/subquery/Tests/subquery.stable.err
--- a/sql/test/subquery/Tests/subquery.stable.err
+++ b/sql/test/subquery/Tests/subquery.stable.err
@@ -82,6 +82,14 @@ MAPI  = (monetdb) /var/tmp/mtest-269215/
 QUERY = SELECT (VALUES(1,2,3)); --error, subquery must return only one column
 ERROR = !SELECT: subquery must return only one column
 CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-650620/.s.monetdb.34611
+QUERY = SELECT i FROM integers ORDER BY (SELECT 2);  --error, the query 
outputs 1 column, so not possible to order by the second projection
+ERROR = !SELECT: the order by column number (2) is not in the number of 
projections range (1)
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-659896/.s.monetdb.34655
+QUERY = SELECT i FROM integers ORDER BY (SELECT -1); --error, no in the order 
by range
+ERROR = !SELECT: the order by column number (-1) is not in the number of 
projections range (1)
+CODE  = 42000
 
 # 17:27:37 >  
 # 17:27:37 >  "Done."
diff --git a/sql/test/subquery/Tests/subquery.stable.out 
b/sql/test/subquery/Tests/subquery.stable.out
--- a/sql/test/subquery/Tests/subquery.stable.out
+++ b/sql/test/subquery/Tests/subquery.stable.out
@@ -307,6 +307,15 @@ stdout of test 'subquery` in directory '
 % tinyint # type
 % 1 # length
 [ 1]
+#SELECT i FROM integers ORDER BY (SELECT 1);
+% sys.integers # table_name
+% i # name
+% int # type
+% 1 # length
+[ NULL ]
+[ 1]
+[ 2]
+[ 3]
 #drop TABLE integers;
 #CREATE TABLE strings(v VARCHAR(128));
 #INSERT INTO strings VALUES ('hello'), ('world'), (NULL);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-02 Thread Sjoerd Mullender
Changeset: c4cbe38769c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4cbe38769c4
Modified Files:
NT/rules.msc
buildtools/doc/windowsbuild.rst
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (209 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -139,14 +139,19 @@ bzip2_CFLAGS = -DHAVE_LIBBZ2 "-I$(LIBBZI
 !IFNDEF LIBXML2
 LIBXML2 = C:\libxml2-2.6.30.win$(bits)
 !ENDIF
-libxml2_CFLAGS = -DHAVE_LIBXML "-I$(LIBXML2)\include" $(zlib_CFLAGS) 
$(ICONV_CFLAGS)
+# by default libxml2 include files get installed in ...\include\libxml2\libxml
+# but this has sometimes been moved to ...\include\libxml
+libxml2_CFLAGS = -DHAVE_LIBXML "-I$(LIBXML2)\include\libxml2" 
"-I$(LIBXML2)\include" $(zlib_CFLAGS) $(ICONV_CFLAGS)
 libxml2_LIBS = "$(LIBXML2)\lib\libxml2.lib" $(zlib_LIBS) $(ICONV_LIBS)
 !ENDIF
 
 !IFNDEF LIBGEOS
 LIBGEOS = C:\geos-3.0.win$(bits)
 !ENDIF
-GEOS_LIBS = $(LIBGEOS)\lib\geos_c_i.lib
+!IFNDEF GEOSFILE
+GEOSFILE = geos_c
+!ENDIF
+GEOS_LIBS = $(LIBGEOS)\lib\$(GEOSFILE).lib
 GEOS_INCS = -I$(LIBGEOS)\include
 
 !IFDEF HAVE_LIBR
diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -243,6 +243,8 @@ PCRE (Perl Compatible Regular Expression
 The PCRE__ library is used to extend the string matching capabilities
 of MonetDB.  The PCRE library is required for the monetdb5 component.
 
+.. _pcre_cmake:
+
 Download the source from http://www.pcre.org/.  In order to build the
 library, you will need a program called ``cmake`` which you can
 download from http://www.cmake.org/ or by using Chocolatey_.  Follow
@@ -255,14 +257,14 @@ Configure button.  This pops up a dialog
 chose Visual Studio 14 2015.
 
 You need to configure some PCRE build options.  I chose to do build
-shared libs, to match newlines with the ``ANYCRLF`` option, and to do
-have UTF-8 support and support for Unicode properties.  When you're
-satisfied with the options, click on Generate.  Then in the build
-folder you've chosen, open the PCRE.sln file with Visual Studio, and
-build and install.  Make sure you set the Solution Configuration to
-Release if you want to build a releasable version of the MonetDB
-suite.  By default the library will be installed in ``C:\Program
-Files\PCRE``.
+shared libs, to match newlines with the ``ANYCRLF`` and
+``PCRE_SUPPORT_JIT`` options, and to do have UTF-8 support and support
+for Unicode properties.  When you're satisfied with the options, click
+on Generate.  Then in the build folder you've chosen, open the
+PCRE.sln file with Visual Studio, and build and install.  Make sure
+you set the Solution Configuration to Release if you want to build a
+releasable version of the MonetDB suite.  By default the library will
+be installed in ``C:\Program Files\PCRE``.
 
 For Windows64, select the correct compiler (``Visual Studio 14 2015
 Win64``) and proceed normally.  When building the 32 bit version on
@@ -304,15 +306,15 @@ required for the clients component when 
 server.
 
 Download the source from http://www.openssl.org/.  We used the latest
-stable version (1.1.0g).  Follow the instructions in the file
+stable version (1.1.1d).  Follow the instructions in the file
 ``NOTES.WIN``.
 
 .. The actual commands used were::
-   perl Configure VC-WIN32 no-asm --prefix=C:\Libraries\openssl-1.1.0g.win32
+   perl Configure VC-WIN32 no-asm --prefix=C:\Libraries\openssl-1.1.1d.win32 
--openssldir=SSL
nmake
nmake install
and::
-   perl Configure VC-WIN64A no-asm --prefix=C:\Libraries\openssl-1.1.0g.win64
+   perl Configure VC-WIN64A no-asm --prefix=C:\Libraries\openssl-1.1.1d.win64 
--openssldir=SSL
nmake
nmake install
 
@@ -346,7 +348,7 @@ the correct locations for the iconv and 
  nmake /f Makefile.msvc install
 
 We needed to edit the file ``win32\Makefile.msvc`` and change
-``iconv.lib`` to ``iconv.dll.lib``.
+``iconv.lib`` to ``iconv.dll.lib`` and ``zlib.lib`` to ``zdll.lib``.
 
 __ http://xmlsoft.org/
 
@@ -361,39 +363,22 @@ so to get the software, you will have to
 yourself.
 
 Get the source tar ball from http://trac.osgeo.org/geos/#Download and
-extract somewhere.  You can follow the instructions in e.g. `Building
-on Windows with NMake`__.
-
-We needed to make a few changes to the file ``nmake.opt``.  We needed
-to add a blurb for the version of ``nmake`` that we were using.  Look
-at the version number of ``nmake /P`` and adapt the closest match.
-
-For newer versions of Visual Studio, we also needed to add a line::
-
-   #include 
+extract somewhere.
 
-to the files::
-
-   src\algorithm\LineIntersector.cpp
-   src\geom\LineSegment.cpp
-   src\io\WKTWriter.cpp
-   src\operation\buffer\OffsetCurveSetBuilder.cpp
-
-.. The actual commands were::
-   autogen.bat
-   nmake /f makefile.vc
-
-.. On Windows64, add ``WIN64=YES`` to the nmake command line.
+We are now using the 3.8.0 version which uses CMake 

MonetDB: default - Merge with Nov2019

2019-12-02 Thread Pedro Ferreira
Changeset: 01b4043119e6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01b4043119e6
Modified Files:
sql/server/rel_select.c
sql/test/subquery/Tests/subquery.sql
sql/test/subquery/Tests/subquery.stable.err
sql/test/subquery/Tests/subquery.stable.out
sql/test/subquery/Tests/subquery3.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (167 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -776,6 +776,7 @@ rel_values(sql_query *query, symbol *tab
}
r = rel_project(sql->sa, NULL, exps);
r->nrcols = list_length(exps);
+   r->card = dlist_length(rowlist) == 1 ? CARD_ATOM : CARD_MULTI;
return rel_table_optname(sql, r, optname);
 }
 
@@ -3809,18 +3810,20 @@ static sql_exp *
 rel_selection_ref(sql_query *query, sql_rel **rel, symbol *grp, dlist 
*selection )
 {
sql_allocator *sa = query->sql->sa;
-   dnode *n;
-   dlist *gl = grp->data.lval;
+   dlist *gl;
char *name = NULL;
exp_kind ek = {type_value, card_column, FALSE};
 
+   if (grp->token != SQL_COLUMN && grp->token != SQL_IDENT)
+   return NULL;
+   gl = grp->data.lval;
if (dlist_length(gl) > 1)
return NULL;
if (!selection)
return NULL;
 
name = gl->h->data.sval;
-   for (n = selection->h; n; n = n->next) {
+   for (dnode *n = selection->h; n; n = n->next) {
/* we only look for columns */
tokens to = n->data.sym->token;
if (to == SQL_COLUMN || to == SQL_IDENT) {
@@ -4058,8 +4061,8 @@ rel_partition_groupings(sql_query *query
return NULL;
}
}
-   if(e->type != e_column) { //store group by expressions in the 
stack
-   if(!stack_push_groupby_expression(sql, grp, e))
+   if (e->type != e_column) { //store group by expressions in the 
stack
+   if (!stack_push_groupby_expression(sql, grp, e))
return NULL;
}
if (e->card > CARD_AGGR)
@@ -4878,21 +4881,25 @@ rel_value_exp2(sql_query *query, sql_rel
return rel_column_ref(query, rel, se, f );
case SQL_NAME:
return rel_var_ref(sql, se->data.sval, 1);
+   case SQL_VALUES:
case SQL_WITH: 
case SQL_SELECT: {
sql_rel *r;
 
if (se->token == SQL_WITH) {
r = rel_with_query(query, se);
+   } else if (se->token == SQL_VALUES) {
+   r = rel_values(query, se);
} else {
+   assert(se->token == SQL_SELECT);
if (rel && *rel)
query_push_outer(query, *rel, f);
r = rel_subquery(query, NULL, se, ek);
if (rel && *rel)
*rel = query_pop_outer(query);
-   if (!r)
-   return NULL;
}
+   if (!r)
+   return NULL;
if (ek.card <= card_set && is_project(r->op) && 
list_length(r->exps) > 1) 
return sql_error(sql, 02, SQLSTATE(42000) "SELECT: 
subquery must return only one column");
if (list_length(r->exps) == 1) { /* for now don't rename multi 
attribute results */
diff --git a/sql/test/subquery/Tests/subquery.sql 
b/sql/test/subquery/Tests/subquery.sql
--- a/sql/test/subquery/Tests/subquery.sql
+++ b/sql/test/subquery/Tests/subquery.sql
@@ -81,6 +81,20 @@ SELECT SUM(SUM(i)) FROM integers; -- agg
 
 SELECT i1.i FROM integers i1 WHERE i1.i >= (SELECT i1.i, i2.i FROM integers i2 
WHERE i2.i > 1); --error, subquery must return a single column
 
+SELECT i1.i FROM integers i1 GROUP BY (SELECT SUM(i1.i) + i2.i FROM integers 
i2); --error, cannot use non GROUP BY column 'i2.i' in query results without an 
aggregate function
+
+SELECT i1.i FROM integers i1 GROUP BY (SELECT i2.i FROM integers i2); --error, 
column "i1.i" must appear in the GROUP BY clause or be used in an aggregate 
function
+
+SELECT 1 FROM integers i1 GROUP BY (VALUES(1), (2)); --error, more than one 
row returned by a subquery used as an expression
+
+SELECT 1 FROM integers i1 GROUP BY (VALUES(1,2,3)); --error, subquery must 
return only one column
+
+SELECT (VALUES(1));
+
+SELECT (VALUES(1),(2)); --error, cardinality violation, scalar value expected
+
+SELECT (VALUES(1,2,3)); --error, subquery must return only one column
+
 drop TABLE integers;
 
 -- varchar tests
diff --git a/sql/test/subquery/Tests/subquery.stable.err 
b/sql/test/subquery/Tests/subquery.stable.err
--- a/sql/test/subquery/Tests/subquery.stable.err
+++ b/sql/test/subquery/Tests/subquery.stable.err

MonetDB: default - Merge with Nov2019

2019-11-29 Thread Pedro Ferreira
Changeset: b651bb70f709 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b651bb70f709
Added Files:
sql/test/mapi/Tests/utf8test.stable.out.Windows
Modified Files:
clients/mapiclient/eventparser.c
clients/odbc/driver/ODBCConvert.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/wlc.c
sql/backends/monet5/wlr.c

sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
sql/test/mapi/Tests/utf8test.SQL.py
Branch: default
Log Message:

Merge with Nov2019


diffs (257 lines):

diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -212,7 +212,7 @@ keyvalueparser(char *txt, EventRecord *e
if( strstr(key,"clk")){
time_t sec;
uint64_t microsec;
-   struct tm curr_time;
+   struct tm curr_time = (struct tm) {0};
 
c = strchr(val,'.');
if (c != NULL) {
diff --git a/clients/odbc/driver/ODBCConvert.c 
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -2473,6 +2473,7 @@ ODBCFetch(ODBCStmt *stmt,
 
case SQL_TYPE_TIME:
(void) time();
+   tm = (struct tm) {0};
 #ifdef HAVE_LOCALTIME_R
(void) localtime_r(, );
 #else
@@ -3499,6 +3500,7 @@ ODBCStore(ODBCStmt *stmt,
 
case SQL_C_TYPE_TIME:
(void) time();
+   tm = (struct tm) {0};
 #ifdef HAVE_LOCALTIME_R
(void) localtime_r(, );
 #else
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -285,6 +285,7 @@ ALGselect2nil(bat *result, const bat *bi
 {
BAT *b, *s = NULL, *bn;
const void *nilptr;
+   bit nanti = *anti;
 
if (!*unknown)
return ALGselect2(result, bid, sid, low, high, li, hi, anti);
@@ -309,7 +310,9 @@ ALGselect2nil(bat *result, const bat *bi
low = high; 
else if (*hi == 1 && ATOMcmp(b->ttype, high, nilptr) == 0)
high = low;
-   bn = BATselect(b, s, low, high, *li, *hi, *anti);
+   if (low == high && ATOMcmp(b->ttype, high, nilptr) == 0) /* ugh sql nil 
!= nil */
+   nanti = !nanti;
+   bn = BATselect(b, s, low, high, *li, *hi, nanti);
BBPunfix(b->batCacheid);
if (s)
BBPunfix(s->batCacheid);
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -90,7 +90,7 @@ CLTsetScenario(Client cntxt, MalBlkPtr m
 static void
 CLTtimeConvert(time_t l, char *s)
 {
-   struct tm localt;
+   struct tm localt = (struct tm) {0};
 
 #ifdef HAVE_LOCALTIME_R
(void) localtime_r(, );
diff --git a/monetdb5/modules/mal/wlc.c b/monetdb5/modules/mal/wlc.c
--- a/monetdb5/modules/mal/wlc.c
+++ b/monetdb5/modules/mal/wlc.c
@@ -524,7 +524,7 @@ WLCsettime(Client cntxt, InstrPtr pci, I
 {
struct timeval clock;
time_t clk ;
-   struct tm ctm;
+   struct tm ctm = (struct tm) {0};
char wlc_time[26];
 
(void) pci;
diff --git a/sql/backends/monet5/wlr.c b/sql/backends/monet5/wlr.c
--- a/sql/backends/monet5/wlr.c
+++ b/sql/backends/monet5/wlr.c
@@ -475,6 +475,7 @@ WLRprocessScheduler(void *arg)
if( wlr_timelimit[0]){
gettimeofday(, NULL);
clk = clock.tv_sec;
+   ctm = (struct tm) {0};
 #ifdef HAVE_LOCALTIME_R
(void) localtime_r(, );
 #else
@@ -589,6 +590,7 @@ WLRreplicate(Client cntxt, MalBlkPtr mb,
// the client thread should wait for the replicator to its job
gettimeofday(, NULL);
clk = clock.tv_sec;
+   ctm = (struct tm) {0};
 #ifdef HAVE_LOCALTIME_R
(void) localtime_r(, );
 #else
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
@@ -63,6 +63,23 @@ stdout of test 'sqlitelogictest-having-n
 % bigint # type
 % 1 # length
 [ 0]
+#SELECT ALL * FROM tab0 AS cor0 WHERE col2 BETWEEN NULL AND NULL; --empty
+% sys.cor0,sys.cor0,   sys.cor0 # table_name
+% col0,col1,   col2 # name
+% int, int,int # type
+% 1,   1,  

MonetDB: default - Merge with Nov2019

2019-11-29 Thread Pedro Ferreira
Changeset: a29c98d5069d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a29c98d5069d
Added Files:
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.sql
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.stable.err
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.stable.out
Modified Files:
monetdb5/modules/atoms/mtime.c
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (260 lines):

diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -342,7 +342,7 @@ static MT_Lock timelock = MT_LOCK_INITIA
 timestamp
 timestamp_fromtime(time_t timeval)
 {
-   struct tm tm, *tmp;
+   struct tm tm = (struct tm) {0}, *tmp;
date d;
daytime t;
 
@@ -1705,7 +1705,7 @@ MTIMElocal_timezone_msec(lng *ret)
 #else
time_t t;
timestamp lt, gt;
-   struct tm tm, *tmp;
+   struct tm tm = (struct tm) {0}, *tmp;
 
t = time(NULL);
 #ifdef HAVE_GMTIME_R
@@ -1755,6 +1755,7 @@ MTIMEstr_to_date(date *ret, const char *
*ret = date_nil;
return MAL_SUCCEED;
}
+   tm = (struct tm) {0};
if (strptime(*s, *format, ) == NULL)
throw(MAL, "mtime.str_to_date", "format '%s', doesn't match 
date '%s'",
  *format, *s);
@@ -1801,6 +1802,7 @@ MTIMEstr_to_time(daytime *ret, const cha
*ret = daytime_nil;
return MAL_SUCCEED;
}
+   tm = (struct tm) {0};
if (strptime(*s, *format, ) == NULL)
throw(MAL, "mtime.str_to_time", "format '%s', doesn't match 
time '%s'",
  *format, *s);
@@ -1824,6 +1826,7 @@ MTIMEtime_to_str(str *ret, const daytime
return MAL_SUCCEED;
}
time_t now = time(NULL);
+   tm = (struct tm) {0};
/* fill in current date in struct tm */
 #ifdef HAVE_LOCALTIME_R
localtime_r(, );
@@ -1852,12 +1855,13 @@ MTIMEtime_to_str(str *ret, const daytime
 str
 MTIMEstr_to_timestamp(timestamp *ret, const char *const *s, const char *const 
*format)
 {
-   struct tm tm = (struct tm) {0};
+   struct tm tm;
 
if (GDK_STRNIL(*s) || GDK_STRNIL(*format)) {
*ret = timestamp_nil;
return MAL_SUCCEED;
}
+   tm = (struct tm) {0};
if (strptime(*s, *format, ) == NULL)
throw(MAL, "mtime.str_to_timestamp",
  "format '%s', doesn't match timestamp '%s'", *format, 
*s);
diff --git 
a/sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out 
b/sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
--- a/sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
+++ b/sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
@@ -17,45 +17,6 @@ stdout of test 'aggregates-intervals.Bug
 # Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-284678/.s.monetdb.34676
 # MonetDB/GIS module loaded
 # SQL catalog created, loading sql scripts once
-# loading sql script: 09_like.sql
-# loading sql script: 10_math.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: 18_index.sql
-# loading sql script: 20_vacuum.sql
-# loading sql script: 21_dependency_views.sql
-# loading sql script: 22_clients.sql
-# loading sql script: 23_skyserver.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_profiler.sql
-# loading sql script: 51_sys_schema_extension.sql
-# loading sql script: 60_wlcr.sql
-# loading sql script: 61_wlcr.sql
-# loading sql script: 72_fits.sql
-# loading sql script: 74_netcdf.sql
-# loading sql script: 75_lidar.sql
-# loading sql script: 75_shp.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
 # MonetDB/SQL module loaded
 
 # 16:49:00 >  
@@ -70,8 +31,8 @@ stdout of test 'aggregates-intervals.Bug
 % sys.%1,  sys.%3, sys.%4, sys.%5, sys.%6, sys.%7 # table_name
 % %1,  %3, %4, %5, %6, %7 # name
 % bigint,

MonetDB: default - Merge with Nov2019

2019-11-28 Thread Panagiotis Koutsourakis
Changeset: e5aac4ddb3c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5aac4ddb3c4
Added Files:
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.sql
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.err
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.out
Modified Files:
monetdb5/modules/atoms/json.c
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (163 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -472,6 +472,7 @@ JSONcompile(char *expr, pattern terms[])
}
if (*s == '[') {
// array step
+   bool closed = false;
s++;
skipblancs(s);
if (*s != '*') {
@@ -482,9 +483,14 @@ JSONcompile(char *expr, pattern terms[])
throw(MAL, "json.path", "'*' or digit 
expected");
}
for (; *s; s++)
-   if (*s == ']')
+   if (*s == ']') {
+   closed = true;
break;
+   }
if (*s == 0) {
+   if (!closed) {
+   throw(MAL, "json.path", "] expected");
+   }
t++;
break;
}
diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -49,3 +49,4 @@ index-insert-crash.Bug-6781
 avg-changes-value-scale.Bug-6783
 isaUUID.Bug-6784
 count-distinct.Bug-6790
+jsonpath-validity.Bug-6792
diff --git a/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.sql 
b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.sql
@@ -0,0 +1,7 @@
+CREATE TABLE jstest (
+   j json
+);
+
+INSERT INTO jstest VALUES ('{"track":{"segments":[{"location":[ 47.763,13.4034 
],"start time":"2018-10-14 10:05:14","HR":73},{"location":[ 47.706,13.2635 
],"start time":"2018-10-14 10:39:21","HR":135}]}}');
+
+select json.filter(j, '$.track.segments[*][*') from jstest;
diff --git 
a/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.err 
b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'jsonpath-validity.Bug-6792` in directory 
'sql/test/BugTracker-2019` itself:
+
+
+# 17:11:07 >  
+# 17:11:07 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38745" "--set" 
"mapi_usock=/var/tmp/mtest-32023/.s.monetdb.38745" "--forcemito" 
"--dbpath=/home/kutsurak/work/src/monet/worktrees/Nov2019/build/install/var/MonetDB/mTests_sql_test_BugTracker-2019"
 "--set" "embedded_c=true"
+# 17:11:07 >  
+
+# builtin opt  gdk_dbpath = 
/home/kutsurak/work/src/monet/worktrees/Nov2019/build/install/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = 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 = 38745
+# cmdline opt  mapi_usock = /var/tmp/mtest-32023/.s.monetdb.38745
+# cmdline opt  gdk_dbpath = 
/home/kutsurak/work/src/monet/worktrees/Nov2019/build/install/var/MonetDB/mTests_sql_test_BugTracker-2019
+# cmdline opt  embedded_c = true
+#client2:!ERROR:MALException:json.path:] expected
+
+# 17:11:08 >  
+# 17:11:08 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-32023" "--port=38745"
+# 17:11:08 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-32023/.s.monetdb.38745
+QUERY = select json.filter(j, '$.track.segments[*][*') from jstest;
+ERROR = !] expected
+
+
+# 17:11:08 >  
+# 17:11:08 >  "Done."
+# 17:11:08 >  
+
diff --git 
a/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.out 
b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.out
@@ -0,0 +1,71 @@
+stdout of test 'jsonpath-validity.Bug-6792` in directory 
'sql/test/BugTracker-2019` itself:
+
+
+# 17:11:07 >  
+# 17:11:07 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38745" "--set" 

MonetDB: default - Merge with Nov2019

2019-11-28 Thread Pedro Ferreira
Changeset: 73aaa298ce5e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=73aaa298ce5e
Modified Files:
clients/mapiclient/mhelp.c
sql/backends/monet5/sql_upgrades.c
sql/test/Users/Tests/columnRights.stable.err
sql/test/Users/Tests/columnRights.stable.out
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/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019


diffs (283 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -295,7 +295,7 @@ SQLhelp sqlhelp1[] = {
 NULL},
{"EXTRACT",
 "Built-in function",
-"EXTRACT '(' { YEAR | MONTH | DAY | HOUR | MINUTE | SECOND } FROM 
scalar_expression ')'",
+"EXTRACT '(' { YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | CENTURY | 
DECADE | QUARTER | WEEK | DOW | DOY } FROM scalar_expression ')'",
 NULL,
 NULL},
{"DECLARE",
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
@@ -216,25 +216,31 @@ sql_update_hugeint(Client c, mvc *sql, c
/* 39_analytics_hge.sql */
pos += snprintf(buf + pos, bufsize - pos,
"create aggregate stddev_samp(val HUGEINT) returns 
DOUBLE\n"
-   "\texternal name \"aggr\".\"stdev\";\n"
+   " external name \"aggr\".\"stdev\";\n"
"GRANT EXECUTE ON AGGREGATE stddev_samp(HUGEINT) TO 
PUBLIC;\n"
"create aggregate stddev_pop(val HUGEINT) returns 
DOUBLE\n"
-   "\texternal name \"aggr\".\"stdevp\";\n"
+   " external name \"aggr\".\"stdevp\";\n"
"GRANT EXECUTE ON AGGREGATE stddev_pop(HUGEINT) TO 
PUBLIC;\n"
"create aggregate var_samp(val HUGEINT) returns 
DOUBLE\n"
-   "\texternal name \"aggr\".\"variance\";\n"
+   " external name \"aggr\".\"variance\";\n"
"GRANT EXECUTE ON AGGREGATE var_samp(HUGEINT) TO 
PUBLIC;\n"
"create aggregate var_pop(val HUGEINT) returns DOUBLE\n"
-   "\texternal name \"aggr\".\"variancep\";\n"
+   " external name \"aggr\".\"variancep\";\n"
"GRANT EXECUTE ON AGGREGATE var_pop(HUGEINT) TO 
PUBLIC;\n"
"create aggregate median(val HUGEINT) returns HUGEINT\n"
-   "\texternal name \"aggr\".\"median\";\n"
+   " external name \"aggr\".\"median\";\n"
"GRANT EXECUTE ON AGGREGATE median(HUGEINT) TO 
PUBLIC;\n"
"create aggregate quantile(val HUGEINT, q DOUBLE) 
returns HUGEINT\n"
-   "\texternal name \"aggr\".\"quantile\";\n"
+   " external name \"aggr\".\"quantile\";\n"
"GRANT EXECUTE ON AGGREGATE quantile(HUGEINT, DOUBLE) 
TO PUBLIC;\n"
+   "create aggregate median_avg(val HUGEINT) returns 
DOUBLE\n"
+   " external name \"aggr\".\"median_avg\";\n"
+   "GRANT EXECUTE ON AGGREGATE median_avg(HUGEINT) TO 
PUBLIC;\n"
+   "create aggregate quantile_avg(val HUGEINT, q DOUBLE) 
returns DOUBLE\n"
+   " external name \"aggr\".\"quantile_avg\";\n"
+   "GRANT EXECUTE ON AGGREGATE quantile_avg(HUGEINT, 
DOUBLE) TO PUBLIC;\n"
"create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns 
DOUBLE\n"
-   "\texternal name \"aggr\".\"corr\";\n"
+   " external name \"aggr\".\"corr\";\n"
"GRANT EXECUTE ON AGGREGATE corr(HUGEINT, HUGEINT) TO 
PUBLIC;\n");
 
/* 40_json_hge.sql */
@@ -244,7 +250,7 @@ sql_update_hugeint(Client c, mvc *sql, c
"GRANT EXECUTE ON FUNCTION json.filter(json, hugeint) 
TO PUBLIC;\n");
 
pos += snprintf(buf + pos, bufsize - pos,
-   "update sys.functions set system = true where name in 
('fuse', 'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop', 
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where 
name = 'sys');\n"
+   "update sys.functions set system = true where name in 
('fuse', 'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop', 
'median', 'median_avg', 'quantile', 'quantile_avg', 'corr') and schema_id = 
(select id from sys.schemas where name = 

MonetDB: default - Merge with Nov2019 branch.

2019-11-28 Thread Sjoerd Mullender
Changeset: daf21d970320 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=daf21d970320
Modified Files:
clients/mapiclient/mhelp.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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 Nov2019 branch.


diffs (truncated from 133619 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
@@ -72,9 +72,9 @@ SQLhelp sqlhelp1[] = {
 "See also https://www.monetdb.org/Documentation/SQLreference/Alter"},
{"ALTER SEQUENCE",
 "",
-"ALTER SEQUENCE ident [ AS data_type] [ RESTART [WITH start]] 
[INCREMENT BY increment]\n"
-"[MINVALUE minvalue | NO MINVALUE] [MAXVALUE maxvalue | NO MAXVALUE] 
[CACHE cachevalue] [[NO] CYCLE]",
-"ident,data_type",
+"ALTER SEQUENCE qname [ AS int_datatype] [ RESTART [WITH intval]] 
[INCREMENT BY intval]\n"
+"[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] 
[CACHE intval] [[NO] CYCLE]",
+"int_datatype,intval",
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"},
{"ALTER USER",
 "Change a user's login name or password or default schema",
@@ -209,9 +209,9 @@ SQLhelp sqlhelp1[] = {
 "See also https://www.monetdb.org/Documentation/SQLreference/Schema"},
{"CREATE SEQUENCE",
 "Define a new integer number sequence generator",
-"CREATE SEQUENCE ident [ AS data_type] [ START [WITH start]] 
[INCREMENT BY increment]\n"
-"[MINVALUE minvalue | NO MINVALUE] [MAXVALUE maxvalue | NO MAXVALUE] 
[CACHE cachevalue] [[NO] CYCLE]",
-"ident,data_type",
+"CREATE SEQUENCE qname [ AS int_datatype] [ START [WITH intval]] 
[INCREMENT BY intval]\n"
+"[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] 
[CACHE intval] [[NO] CYCLE]",
+"int_datatype,intval",
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"},
{"CREATE STREAM TABLE",
 "Temporary table, locked during updates/ continues query processing",
@@ -548,8 +548,8 @@ SQLhelp sqlhelp2[] = {
 NULL},
{"column_def",
 NULL,
-"COLUMN { data_type [ column_option ... ] | SERIAL | BIGSERIAL }",
-"data_type,column_option",
+"ident { data_type [ column_option ... ] | SERIAL | BIGSERIAL }",
+"ident,data_type,column_option",
 NULL},
{"column_list",
 NULL,
@@ -652,6 +652,11 @@ SQLhelp sqlhelp2[] = {
 "ident [',' ...]",
 "ident",
 NULL},
+   {"int_datatype",
+NULL,
+"BIGINT | INTEGER | INT | SMALLINT | TINYINT",
+NULL,
+NULL},
{"interval",
 NULL,
 "INTERVAL [ '+' | '-' ] string start_field TO end_field",
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
@@ -18,6044 +18,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/GIS module loaded
 Running database upgrade commands:
 set schema "sys";
-delete from sys.dependencies where id < 2000;
-delete from sys.types where id < 2000;
-insert into sys.types values (0, 'void', 'any', 0, 0, 0, 0, 2000);
-insert into sys.types values (1, 'bat', 'table', 0, 0, 0, 1, 2000);
-insert into sys.types values (2, 'ptr', 'ptr', 0, 0, 0, 1, 2000);
-insert into sys.types values (3, 'bit', 'boolean', 1, 0, 2, 2, 2000);
-insert into sys.types values (4, 'str', 'char', 0, 0, 0, 

MonetDB: default - Merge with Nov2019 branch.

2019-11-27 Thread Sjoerd Mullender
Changeset: 9d0623ae89aa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9d0623ae89aa
Modified Files:
MonetDB.spec
debian/changelog
gdk/gdk_utils.c

sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (80 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1063,8 +1063,6 @@ fi
 - Rebuilt.
 - BZ#3533: SQL aggregate functions avg(), sum() and median() return an
   error when used on a column with datatype interval second
-- BZ#6723: columns aliases duplicates should not be allowed. automatic
-  aliasing required.
 
 * Mon Nov 18 2019 Sjoerd Mullender  - 11.35.1-20191118
 - Rebuilt.
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,6 @@ monetdb (11.35.3) unstable; urgency=low
   * Rebuilt.
   * BZ#3533: SQL aggregate functions avg(), sum() and median() return an
 error when used on a column with datatype interval second
-  * BZ#6723: columns aliases duplicates should not be allowed. automatic
-aliasing required.
 
  -- Sjoerd Mullender   Mon, 25 Nov 2019 12:34:22 +0100
 
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -679,6 +679,11 @@ GDKinit(opt *set, int setlen)
}
 
/* Mserver by default takes 80% of all memory as a default */
+#if SIZEOF_SIZE_T == 4
+   if ((double) MT_npages() * (double) MT_pagesize() * 0.815 >= (double) 
GDK_VM_MAXSIZE)
+   GDK_mem_maxsize = GDK_VM_MAXSIZE;
+   else
+#endif
GDK_mem_maxsize = (size_t) ((double) MT_npages() * (double) 
MT_pagesize() * 0.815);
if (BBPinit() != GDK_SUCCEED)
return GDK_FAIL;
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql
@@ -10,4 +10,8 @@ SELECT CAST(SUM(col0) AS BIGINT) FROM ta
 SELECT CAST(SUM(col0) AS BIGINT) FROM tab0 WHERE + + col0 NOT BETWEEN NULL AND 
+ col2;
 SELECT DISTINCT COUNT(*) FROM tab0 WHERE NOT col2 NOT BETWEEN ( 35 ) AND ( 
NULL );
 SELECT CAST(- COUNT(*) * - - 61 + + + ( + COUNT(*) ) AS BIGINT) FROM tab0 
WHERE NOT col0 + + 10 BETWEEN NULL AND NULL;
+
+SELECT ALL * FROM tab0 AS cor0 WHERE col2 BETWEEN NULL AND NULL; --empty
+SELECT COUNT ( * ) FROM tab0 WHERE NOT col1 NOT BETWEEN NULL AND NULL; --0
+SELECT - 78 * + MAX ( DISTINCT col2 ) + - 52 AS col1 FROM tab0 AS cor0 WHERE 
NOT - col0 + col2 NOT BETWEEN ( NULL ) AND NULL; --NULL
 DROP TABLE tab0;
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -121,7 +121,7 @@ usage(char *prog, int xit)
 static void
 monet_hello(void)
 {
-   dbl sz_mem_h;
+   double sz_mem_h;
char  *qc = " kMGTPE";
int qi = 0;
 
@@ -149,14 +149,14 @@ monet_hello(void)
""
 #endif
);
-   sz_mem_h = (dbl) (MT_npages() * MT_pagesize());
+   sz_mem_h = (double) MT_npages() * MT_pagesize();
while (sz_mem_h >= 1000.0 && qi < 6) {
sz_mem_h /= 1024.0;
qi++;
}
printf("# Found %.3f %ciB available main-memory",
sz_mem_h, qc[qi]);
-   sz_mem_h = (dbl) GDK_mem_maxsize;
+   sz_mem_h = (double) GDK_mem_maxsize;
qi = 0;
while (sz_mem_h >= 1000.0 && qi < 6) {
sz_mem_h /= 1024.0;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2019-11-27 Thread Pedro Ferreira
Changeset: b8a00fcd2d1b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8a00fcd2d1b
Added Files:
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.sql
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.err
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.out
Modified Files:
sql/server/rel_optimizer.c
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (243 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -2493,9 +2493,7 @@ rel_distinct_aggregate_on_unique_values(
for (node *m = ((list*)exp->l)->h; m && 
all_unique; m = m->next) {
sql_exp *arg = (sql_exp*) m->data;
 
-   if (arg->card == CARD_ATOM) /* 
constants are always unique */
-   continue;
-   else if (arg->type == e_column) {
+   if (arg->type == e_column) {
fcmp cmp = (fcmp)_column_cmp;
sql_column *c = 
exp_find_column(rel, arg, -2);
 
@@ -7463,7 +7461,7 @@ rel_simplify_predicates(int *changes, mv
if ((is_select(rel->op) || is_join(rel->op) || is_semi(rel->op)) && 
rel->exps && rel->card > CARD_ATOM) {
node *n;
list *exps = sa_list(sql->sa);
-   
+
for (n = rel->exps->h; n; n = n->next) {
sql_exp *e = n->data;
 
@@ -7491,7 +7489,7 @@ rel_simplify_predicates(int *changes, mv
 
if (l->type == e_func) {
sql_subfunc *f = l->f;
-   
+
/* rewrite isnull(x) = TRUE/FALSE => x 
=/<> NULL */
if (is_select(rel->op) && !f->func->s 
&& !strcmp(f->func->base.name, "isnull") && 
 is_atom(r->type) && r->l) { /* 
direct literal */
diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -48,3 +48,4 @@ rank-nan.Bug-6780
 index-insert-crash.Bug-6781
 avg-changes-value-scale.Bug-6783
 isaUUID.Bug-6784
+count-distinct.Bug-6790
diff --git a/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.sql 
b/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.sql
@@ -0,0 +1,19 @@
+START TRANSACTION;
+CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER);
+CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER);
+CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER);
+INSERT INTO tab0 VALUES (97,1,99), (15,81,47),(87,21,10);
+INSERT INTO tab1 VALUES (51,14,96), (85,5,59), (91,47,68);
+INSERT INTO tab2 VALUES (64,77,40), (75,67,58),(46,51,23);
+
+SELECT COUNT ( DISTINCT + 45 ) AS col2 FROM tab0;
+SELECT DISTINCT CAST( - SUM ( DISTINCT 10 ) AS BIGINT) AS col1 FROM tab2;
+SELECT DISTINCT CAST(49 * + 78 + + COUNT ( DISTINCT + 5 ) AS BIGINT) AS col0 
FROM tab1 AS cor0;
+SELECT CAST(72 + - + COUNT ( * ) - - - COUNT ( DISTINCT + ( - 2 ) ) * + + 57 
AS BIGINT) FROM tab2;
+SELECT DISTINCT - 37, - COUNT ( DISTINCT - + 96 ) col1 FROM tab2;
+
+SELECT DISTINCT + ( CAST ( NULL AS INTEGER ) ) AS col0, col0 FROM tab0;
+SELECT DISTINCT CAST ( NULL AS INTEGER ) - - 95 AS col1, CAST(col2 * + + col1 
AS BIGINT) AS col1 FROM tab2 AS cor0;
+SELECT DISTINCT + 14 AS col2, + col0 - - CAST ( NULL AS INTEGER ) AS col2 FROM 
tab2 AS cor0;
+SELECT DISTINCT col1, + col0 col1 FROM tab1;
+ROLLBACK;
diff --git a/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.err 
b/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'count-distinct.Bug-6790` in directory 
'sql/test/BugTracker-2019` itself:
+
+
+# 10:33:38 >  
+# 10:33:38 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=30367" "--set" 
"mapi_usock=/var/tmp/mtest-125811/.s.monetdb.30367" "--forcemito" 
"--dbpath=/home/ferreira/repositories/MonetDB-Nov2019/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2019"
 "--set" "embedded_c=true"
+# 10:33:38 >  
+
+# builtin opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Nov2019/BUILD/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  

MonetDB: default - Merge with Nov2019

2019-11-26 Thread Pedro Ferreira
Changeset: 98154b275995 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98154b275995
Added Files:
sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.stable.err
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (230 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -796,6 +796,27 @@ check_is_lateral(symbol *tableref)
}
 }
 
+static sql_rel *
+rel_reduce_on_column_privileges(mvc *sql, sql_rel *rel, sql_table *t)
+{
+   list *exps = sa_list(sql->sa);
+
+   for (node *n = rel->exps->h, *m = t->columns.set->h; n && m; n = 
n->next, m = m->next) {
+   sql_exp *e = n->data;
+   sql_column *c = m->data;
+
+   if (column_privs(sql, c, PRIV_SELECT)) {
+   append(exps, e);
+   }
+   }
+   if (!list_empty(exps)) {
+   rel->exps = exps;
+   return rel;
+   }
+   return NULL;
+}
+
+
 sql_rel *
 table_ref(sql_query *query, sql_rel *rel, symbol *tableref, int lateral)
 {
@@ -809,6 +830,7 @@ table_ref(sql_query *query, sql_rel *rel
sql_rel *temp_table = NULL;
char *sname = qname_schema(name);
sql_schema *s = NULL;
+   int allowed = 1;
 
tname = qname_table(name);
 
@@ -834,7 +856,7 @@ table_ref(sql_query *query, sql_rel *rel
if (!t && !temp_table) {
return sql_error(sql, 02, SQLSTATE(42S02) "SELECT: no 
such table '%s'", tname);
} else if (!temp_table && !table_privs(sql, t, PRIV_SELECT)) {
-   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: 
access denied for %s to table '%s.%s'", stack_get_string(sql, "current_user"), 
s->base.name, tname);
+   allowed = 0;
}
if (tableref->data.lval->h->next->data.sym) {   /* AS */
tname = 
tableref->data.lval->h->next->data.sym->data.lval->h->data.sval;
@@ -861,7 +883,9 @@ table_ref(sql_query *query, sql_rel *rel
set_basecol(e);
}
}
-   return temp_table;
+   if (allowed)
+   return temp_table;
+   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: 
access denied for %s to table '%s.%s'", stack_get_string(sql, "current_user"), 
s->base.name, tname);
} else if (isView(t)) {
/* instantiate base view */
node *n,*m;
@@ -874,7 +898,6 @@ table_ref(sql_query *query, sql_rel *rel
 
if (!rel)
return NULL;
-
/* Rename columns of the rel_parse relation */
if (sql->emode != m_deps) {
assert(is_project(rel->op));
@@ -889,12 +912,20 @@ table_ref(sql_query *query, sql_rel *rel
set_basecol(e);
}
}
-   return rel;
+   if (!allowed) 
+   rel = rel_reduce_on_column_privileges(sql, rel, 
t);
+   if (allowed && rel)
+   return rel;
+   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: 
access denied for %s to table '%s.%s'", stack_get_string(sql, "current_user"), 
s->base.name, tname);
}
if ((isMergeTable(t) || isReplicaTable(t)) && 
list_empty(t->members.set))
return sql_error(sql, 02, SQLSTATE(42000) "MERGE or 
REPLICA TABLE should have at least one table associated");
-
res = rel_basetable(sql, t, tname);
+   if (!allowed) {
+   res = rel_reduce_on_column_privileges(sql, res, t);
+   if (!res)
+   return sql_error(sql, 02, SQLSTATE(42000) 
"SELECT: access denied for %s to table '%s.%s'", stack_get_string(sql, 
"current_user"), s->base.name, tname);
+   }
if (tableref->data.lval->h->next->data.sym && 
tableref->data.lval->h->next->data.sym->data.lval->h->next->data.lval) /* AS 
with column aliases */
res = rel_table_optname(sql, res, 
tableref->data.lval->h->next->data.sym);
return res;
diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -36,7 +36,7 @@ merge-table-limit.Bug-6756
 double-free.Bug-6757
 

MonetDB: default - Merge with Nov2019 branch.

2019-11-26 Thread Sjoerd Mullender
Changeset: ccde0a14df0f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ccde0a14df0f
Modified Files:
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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 Nov2019 branch.


diffs (truncated from 86931 to 300 lines):

diff --git 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
--- 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
+++ 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
@@ -240,5639 +240,5647 @@ insert into sys.args values (25336, 80, 
 insert into sys.args values (25337, 80, 'arg_1', 'boolean', 1, 0, 1, 1);
 insert into sys.args values (25338, 80, 'arg_2', 'boolean', 1, 0, 1, 2);
 insert into sys.args values (25339, 80, 'arg_3', 'boolean', 1, 0, 1, 3);
-insert into sys.functions values (85, 'sql_exists', 'exist', 'aggr', 0, 1, 
false, false, false, 2000, true);
-insert into sys.args values (25340, 85, 'res_0', 'boolean', 1, 0, 0, 0);
-insert into sys.args values (25341, 85, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.functions values (86, 'sql_not_exists', 'not_exist', 'aggr', 
0, 1, false, false, false, 2000, true);
-insert into sys.args values (25342, 86, 'res_0', 'boolean', 1, 0, 0, 0);
-insert into sys.args values (25343, 86, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.functions values (87, 'in', 'in', 'calc', 0, 1, false, false, 
false, 2000, true);
-insert into sys.args values (25344, 87, 'res_0', 'boolean', 1, 0, 0, 0);
-insert into sys.args values (25345, 87, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.args values (25346, 87, 'arg_2', 'any', 0, 0, 1, 2);
-insert into sys.functions values (88, 'identity', 'identity', 'calc', 0, 1, 
false, false, false, 2000, true);
-insert into sys.args values (25347, 88, 'res_0', 'oid', 63, 0, 0, 0);
-insert into sys.args values (25348, 88, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.functions values (89, 'rowid', 'identity', 'calc', 0, 1, 
false, false, false, 2000, true);
-insert into sys.args values (25349, 89, 'res_0', 'int', 32, 0, 0, 0);
-insert into sys.args values (25350, 89, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.functions values (90, 'rowid', 'rowid', 'calc', 0, 1, false, 
false, false, 2000, true);
-insert into sys.args values (25351, 90, 'res_0', 'oid', 63, 0, 0, 0);
-insert into sys.args values (25352, 90, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.args values (25353, 90, 'arg_2', 'varchar', 0, 0, 1, 2);
-insert into sys.args values (25354, 90, 'arg_3', 'varchar', 0, 0, 1, 3);
-insert into sys.functions values (93, 'sql_min', 'min', 'calc', 0, 1, false, 
false, false, 2000, true);
-insert into sys.args values (25355, 93, 'res_0', 'any', 0, 0, 0, 0);
-insert into sys.args values (25356, 93, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.args values (25357, 93, 'arg_2', 'any', 0, 0, 1, 2);
-insert into sys.functions values (94, 'sql_max', 'max', 'calc', 0, 1, false, 
false, false, 2000, true);
-insert into sys.args values (25358, 94, 'res_0', 'any', 0, 0, 0, 0);
-insert into sys.args values (25359, 94, 'arg_1', 'any', 0, 0, 1, 1);
-insert into sys.args values (25360, 94, 'arg_2', 'any', 0, 0, 1, 2);
-insert into sys.functions values (95, 'least', 'min_no_nil', 'calc', 0, 1, 
false, false, false, 2000, true);
+insert into sys.functions values (83, 'sql_anyequal', 'anyequal', 'aggr', 0, 
1, false, false, false, 2000, true);
+insert into sys.args values (25340, 83, 'res_0', 'boolean', 1, 0, 0, 0);
+insert into sys.args values (25341, 83, 'arg_1', 'any', 0, 0, 1, 1);
+insert into sys.args values (25342, 83, 'arg_2', 'any', 0, 0, 1, 2);
+insert into sys.functions values 

MonetDB: default - Merge with Nov2019

2019-11-25 Thread Pedro Ferreira
Changeset: 01b915119119 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01b915119119
Modified Files:
gdk/gdk_heap.c
gdk/gdk_storage.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
Branch: default
Log Message:

Merge with Nov2019


diffs (137 lines):

diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -61,7 +61,7 @@ HEAPcreatefile(int farmid, size_t *maxsz
fn = path;
}
/* round up to mulitple of GDK_mmap_pagesize */
-   fd = GDKfdlocate(NOFARM, fn, "wxb", NULL);
+   fd = GDKfdlocate(NOFARM, fn, "wb", NULL);
if (fd >= 0) {
close(fd);
base = GDKload(NOFARM, fn, NULL, *maxsz, maxsz, STORE_MMAP);
@@ -417,7 +417,7 @@ GDKupgradevarheap(BAT *b, var_t v, bool 
const char *base = b->theap.base;
 
/* first save heap in file with extra .tmp extension */
-   if ((fd = GDKfdlocate(b->theap.farmid, b->theap.filename, 
"wxb", "tmp")) < 0)
+   if ((fd = GDKfdlocate(b->theap.farmid, b->theap.filename, "wb", 
"tmp")) < 0)
return GDK_FAIL;
while (size > 0) {
ret = write(fd, base, (unsigned) MIN(1 << 30, size));
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -212,8 +212,6 @@ GDKfdlocate(int farmid, const char *nme,
 
if (strchr(mode, 'w')) {
flags |= O_WRONLY | O_CREAT;
-   if (strchr(mode, 'x'))
-   flags |= O_EXCL;
} else if (!strchr(mode, '+')) {
flags |= O_RDONLY;
} else {
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -42,7 +42,6 @@ timestamp_dbat( sql_dbat *d, int ts)
return d;
 }
 
-
 static BAT *
 delta_bind_del(sql_dbat *bat, int access) 
 {
@@ -1539,7 +1538,6 @@ log_create_col(sql_trans *tr, sql_column
return log_create_delta( c->data, c->t->bootstrap?0:LOG_COL, 
c->base.id);
 }
 
-
 static int
 snapshot_create_col(sql_trans *tr, sql_column *c)
 {
@@ -1656,7 +1654,6 @@ load_dbat(sql_dbat *bat, int bid)
}
 }
 
-
 static int
 create_del(sql_trans *tr, sql_table *t)
 {
@@ -2246,7 +2243,6 @@ gtr_update_dbat(sql_trans *tr, sql_dbat 
return ok;
 }
 
-
 static int
 gtr_update_table(sql_trans *tr, sql_table *t, int *tchanges)
 {
@@ -2795,17 +2791,17 @@ update_table(sql_trans *tr, sql_table *f
oc->null = cc->null;
oc->unique = cc->unique;
if (cc->storage_type && (!oc->storage_type || 
strcmp(cc->storage_type, oc->storage_type) != 0))
-   oc->storage_type = sa_strdup(tr->sa, cc->storage_type);
+   oc->storage_type = sa_strdup(tr->parent->sa, 
cc->storage_type);
if (!cc->storage_type)
oc->storage_type = NULL;
if (cc->def && (!oc->def || strcmp(cc->def, oc->def) != 0))
-   oc->def = sa_strdup(tr->sa, cc->def);
+   oc->def = sa_strdup(tr->parent->sa, cc->def);
if (!cc->def)
oc->def = NULL;
 
if (isRenamed(cc)) { /* apply possible renaming */
list_hash_delete(oc->t->columns.set, oc, NULL);
-   oc->base.name = sa_strdup(tr->sa, cc->base.name);
+   oc->base.name = sa_strdup(tr->parent->sa, 
cc->base.name);
if (!list_hash_add(oc->t->columns.set, oc, NULL))
ok = LOG_ERR;
setRenamedFlag(oc); /* propagate the change to the 
upper transaction */
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4176,7 +4176,7 @@ rollforward_update_table(sql_trans *tr, 
 
if (ok == LOG_OK && isRenamed(ft)) { /* apply possible 
renaming */
list_hash_delete(tt->s->tables.set, tt, NULL);
-   tt->base.name = sa_strdup(tr->sa, 
ft->base.name);
+   tt->base.name = sa_strdup(tr->parent->sa, 
ft->base.name);
if (!list_hash_add(tt->s->tables.set, tt, NULL))
ok = LOG_ERR;
setRenamedFlag(tt); /* propagate the change to 
the upper transaction */
@@ -4266,7 +4266,7 @@ rollforward_update_schema(sql_trans *tr,
 
if (apply && ok == LOG_OK && isRenamed(fs)) { /* apply possible 
renaming */
list_hash_delete(tr->schemas.set, ts, NULL);
-   ts->base.name = sa_strdup(tr->sa, fs->base.name);
+   ts->base.name = sa_strdup(tr->parent->sa, fs->base.name);
if (!list_hash_add(tr->schemas.set, ts, NULL))
  

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

2019-11-25 Thread Sjoerd Mullender
Changeset: 612c2df01aa9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=612c2df01aa9
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 Nov2019 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 Nov2019 branch.

2019-11-25 Thread Sjoerd Mullender
Changeset: ffc8249cfae2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffc8249cfae2
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (63 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -739,3 +739,6 @@ 6566d90185b83ed95129db9ea68baf52f2de5cc7
 d4c1a8c3cbcd965169f1836eaa635101436db81c Nov2019_root
 90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_1
 90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release
+13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_3
+90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release
+13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1059,6 +1059,13 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Mon Nov 25 2019 Sjoerd Mullender  - 11.35.3-20191125
+- Rebuilt.
+- BZ#3533: SQL aggregate functions avg(), sum() and median() return an
+  error when used on a column with datatype interval second
+- BZ#6723: columns aliases duplicates should not be allowed. automatic
+  aliasing required.
+
 * Mon Nov 18 2019 Sjoerd Mullender  - 11.35.1-20191118
 - Rebuilt.
 - BZ#6134: Query produces error: HEAPalloc: Insufficient space for HEAP
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+monetdb (11.35.3) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#3533: SQL aggregate functions avg(), sum() and median() return an
+error when used on a column with datatype interval second
+  * BZ#6723: columns aliases duplicates should not be allowed. automatic
+aliasing required.
+
+ -- Sjoerd Mullender   Mon, 25 Nov 2019 12:34:22 +0100
+
 monetdb (11.35.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=19:0:0
+GDK_VERSION=19:1:0
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=12:2:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
-MONETDB5_VERSION=28:0:0
+MONETDB5_VERSION=28:1:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=13:3:0
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


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

2019-11-25 Thread Sjoerd Mullender
Changeset: a1bc8e97ef3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1bc8e97ef3a
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 Nov2019 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 Nov2019 branch.

2019-11-25 Thread Sjoerd Mullender
Changeset: eb22fdb14289 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb22fdb14289
Modified Files:
gdk/gdk_utils.c
tools/merovingian/daemon/client.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (56 lines):

diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -2056,6 +2056,7 @@ GDKmmap(const char *path, int mode, size
void *ret;
 
if (GDKvm_cursize() + len >= GDK_vm_maxsize) {
+   GDKmemfail("GDKmmap", len);
GDKerror("allocating too much virtual address space\n");
return NULL;
}
@@ -2089,6 +2090,7 @@ GDKmremap(const char *path, int mode, vo
 
if (*new_size > old_size &&
GDKvm_cursize() + *new_size - old_size >= GDK_vm_maxsize) {
+   GDKmemfail("GDKmmap", *new_size);
GDKerror("allocating too much virtual address space\n");
return NULL;
}
diff --git a/tools/merovingian/daemon/client.c 
b/tools/merovingian/daemon/client.c
--- a/tools/merovingian/daemon/client.c
+++ b/tools/merovingian/daemon/client.c
@@ -50,6 +50,7 @@ struct clientdata {
int sock;
bool isusock;
struct threads *self;
+   char challenge[32];
 };
 
 static void *
@@ -80,6 +81,7 @@ handleClient(void *data)
sock = ((struct clientdata *) data)->sock;
isusock = ((struct clientdata *) data)->isusock;
self = ((struct clientdata *) data)->self;
+   memcpy(chal, ((struct clientdata *) data)->challenge, sizeof(chal));
free(data);
fdin = socket_rstream(sock, "merovingian<-client (read)");
if (fdin == 0) {
@@ -112,8 +114,6 @@ handleClient(void *data)
}
 
/* note: since Jan2012 we speak proto 9 for control connections */
-   chal[31] = '\0';
-   generateSalt(chal, 31);
mnstr_printf(fout, "%s:merovingian:9:%s:%s:%s:",
chal,
mcrypt_getHashAlgorithms(),
@@ -624,6 +624,8 @@ acceptConnections(int sock, int usock)
data->isusock = isusock;
p->dead = 0;
data->self = p;
+   data->challenge[31] = '\0';
+   generateSalt(data->challenge, 31);
if (pthread_create(>tid, NULL, handleClient, data) == 0) {
p->next = threads;
threads = p;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-11-25 Thread Sjoerd Mullender
Changeset: 10083c4cf7c0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=10083c4cf7c0
Added Files:
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.SQL.bat
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.SQL.sh
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.stable.err
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.stable.out

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.sql

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.err

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.out
Modified Files:
buildtools/selinux/monetdb.te
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/jdbc/tests/Tests/All
sql/server/rel_optimizer.c
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 441 to 300 lines):

diff --git a/buildtools/selinux/monetdb.te b/buildtools/selinux/monetdb.te
--- a/buildtools/selinux/monetdb.te
+++ b/buildtools/selinux/monetdb.te
@@ -1,4 +1,4 @@
-policy_module(monetdb, 0.6)
+policy_module(monetdb, 0.7)
 # 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
 
@@ -8,8 +8,10 @@ require {
type tmp_t;
type var_t;
type user_home_t;
+   type user_home_dir_t;
type unconfined_service_t;  # for EPEL 7
type proc_t;# for EPEL 7
+   type cgroup_t;
class dir { read };
class fd { use };
class fifo_file { getattr read write };
@@ -125,6 +127,7 @@ allow mserver5_t self:unix_stream_socket
 allow mserver5_t self:netlink_selinux_socket create_socket_perms;
 manage_dirs_pattern(mserver5_t, tmp_t, tmp_t)
 manage_sock_files_pattern(mserver5_t, tmp_t, tmp_t)
+allow mserver5_t tmp_t:file create;
 manage_sock_files_pattern(mserver5_t, mserver5_db_t, mserver5_db_t)
 allow mserver5_t monetdbd_t:fifo_file { read write getattr };
 allow mserver5_t monetdbd_t:unix_stream_socket { read write getopt shutdown };
@@ -132,10 +135,13 @@ allow mserver5_t var_t:dir { read };
 # we want to be able to read some cgroup files
 fs_search_cgroup_dirs(mserver5_t);
 fs_read_cgroup_files(mserver5_t);
+allow mserver5_t cgroup_t:dir search;
+allow mserver5_t self:process execmem;
 allow monetdbd_t var_t:dir { read };
 gen_tunable(mserver5_can_read_home, false)
 tunable_policy(`mserver5_can_read_home', `
 userdom_search_user_home_dirs(mserver5_t)
 allow mserver5_t user_home_t:file read_file_perms;
+allow mserver5_t user_home_dir_t:dir search;
 ')
 allow monetdbd_t mserver5_t:unix_stream_socket { connectto };
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
@@ -1973,7 +1973,7 @@ rel2bin_join(backend *be, sql_rel *rel, 
 
/* only handle simple joins here */
if ((exp_has_func(e) && get_cmp(e) != cmp_filter) ||
-   get_cmp(e) == cmp_or || e->f) {
+   get_cmp(e) == cmp_or || (e->f && e->anti)) {
if (!join && !list_length(lje)) {
stmt *l = bin_first_column(be, left);
stmt *r = bin_first_column(be, right);
@@ -2248,65 +2248,6 @@ rel2bin_semijoin(backend *be, sql_rel *r
 *  first cheap join(s) (equality or idx) 
 *  second selects/filters 
 */
-
-#if 0
-   if (rel->exps && rel->op == op_anti && need_no_nil(rel)) {
-   sql_subtype *lng = sql_bind_localtype("lng");
-   stmt *nilcnt = NULL;
-
-   for( en = rel->exps->h; en; en = en->next ) {
-   sql_exp *e = en->data, *r, *l;
-   stmt *s;
-
-   if (e->type != e_cmp || e->flag != cmp_equal)
-   break;
-   l = e->l;
-   r = e->r;
-
-   /* for each equality join add a rel_select(r is NULL) */
-   s = exp_bin(be, r, right, NULL, NULL, NULL, NULL, NULL);
-   if (!s) {
-   s = exp_bin(be, l, right, NULL, NULL, NULL, 
NULL, NULL);
-   if(!s)
-   return NULL;
-   }
-   if (s && !exp_is_atom(r)) {
-   sql_subaggr *cnt = sql_bind_aggr(sql->sa, 
sql->session->schema, "count", NULL);
-   sql_subfunc *add = 
sql_bind_func_result(sql->sa, sql->session->schema, "sql_add", lng, lng, lng);
-
-   s = stmt_selectnil(be, s);
-  

MonetDB: default - Merge with Nov2019

2019-11-21 Thread Pedro Ferreira
Changeset: bfceeb0cef79 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bfceeb0cef79
Modified Files:
sql/backends/monet5/sql_gencode.c
sql/common/sql_list.c
sql/test/Tests/bogus-auto-generated-keys.stable.out
sql/test/Tests/copy-from-compressed.sql.in
sql/test/Tests/copy-into-fwf.sql.in
sql/test/Tests/copy-into-lz4.sql.in
sql/test/Tests/copy_into.sql.in
sql/test/Tests/zones.sql
sql/test/bogus-auto-generated-keys.sql
sql/test/like_tests.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (273 lines):

diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -64,7 +64,7 @@ constantAtom(backend *sql, MalBlkPtr mb,
 
(void) sql;
cst.vtype = 0;
-   if(VALcopy(, vr) == NULL)
+   if (VALcopy(, vr) == NULL)
return -1;
idx = defConstant(mb, vr->vtype, );
return idx;
@@ -280,7 +280,7 @@ static int
Symbol backup = NULL;
const char *local_tbl = prp->value;
node *n;
-   int i, q, v;
+   int i, q, v, res = 0;
int *lret, *rret;
char *lname;
sql_rel *r = rel;
@@ -558,9 +558,9 @@ static int
 
/* catch exceptions */
p = newCatchStmt(curBlk,"MALexception");
-p = newExitStmt(curBlk,"MALexception");
-p = newCatchStmt(curBlk,"SQLexception");
-p = newExitStmt(curBlk,"SQLexception");
+   p = newExitStmt(curBlk,"MALexception");
+   p = newCatchStmt(curBlk,"SQLexception");
+   p = newExitStmt(curBlk,"SQLexception");
/* remote.disconnect(q); */
p = newStmt(curBlk, remoteRef, disconnectRef);
p = pushArgument(curBlk, p, q);
@@ -573,12 +573,14 @@ static int
 
SQLaddQueryToCache(c);
//chkProgram(c->usermodule, c->curprg->def);
-   if(!c->curprg->def->errors)
+   if (!c->curprg->def->errors)
c->curprg->def->errors = SQLoptimizeFunction(c, c->curprg->def);
+   if (c->curprg->def->errors)
+   res = -1;
if (backup)
c->curprg = backup;
GDKfree(lname); /* make sure stub is called */
-   return 0;
+   return res;
 }
 
 int
@@ -805,12 +807,14 @@ backend_dumpproc(backend *be, Client c, 
if (backend_dumpstmt(be, mb, r, 1, 1, be->q?be->q->codestring:NULL) < 
0) 
goto cleanup;
 
-   if (cq){
+   if (cq) {
SQLaddQueryToCache(c);
// optimize this code the 'old' way
-   if ( (m->emode == m_prepare || 
!qc_isaquerytemplate(getFunctionId(getInstrPtr(c->curprg->def,0 && 
!c->curprg->def->errors )
+   if ((m->emode == m_prepare || 
!qc_isaquerytemplate(getFunctionId(getInstrPtr(c->curprg->def,0 && 
!c->curprg->def->errors)
c->curprg->def->errors = 
SQLoptimizeFunction(c,c->curprg->def);
}
+   if (c->curprg->def->errors)
+   goto cleanup;
 
// restore the context for the wrapper code
curPrg = c->curprg;
@@ -1165,6 +1169,7 @@ backend_create_sql_func(backend *be, sql
Symbol backup = NULL, curPrg = NULL;
int i, retseen = 0, sideeffects = 0, vararg = (f->varres || f->vararg), 
no_inline = 0;
sql_rel *r;
+   str msg = MAL_SUCCEED;
 
/* nothing to do for internal and ready (not recompiling) functions, 
besides finding respective MAL implementation */
if (!f->sql && (f->lang == FUNC_LANG_INT || f->lang == FUNC_LANG_MAL)) {
@@ -1280,13 +1285,21 @@ backend_create_sql_func(backend *be, sql
curBlk->unsafeProp = 1;
/* optimize the code */
SQLaddQueryToCache(c);
-   if( curBlk->inlineProp == 0 && !c->curprg->def->errors) {
-   c->curprg->def->errors = SQLoptimizeFunction(c, c->curprg->def);
-   } else if(curBlk->inlineProp != 0){
+   if (curBlk->inlineProp == 0 && !c->curprg->def->errors) {
+   msg = SQLoptimizeFunction(c, c->curprg->def);
+   } else if (curBlk->inlineProp != 0) {
chkProgram(c->usermodule, c->curprg->def);
-   if(!c->curprg->def->errors)
-   c->curprg->def->errors = 
SQLoptimizeFunction(c,c->curprg->def);
+   if (!c->curprg->def->errors)
+   msg = SQLoptimizeFunction(c,c->curprg->def);
}
+   if (msg) {
+   if (c->curprg->def->errors)
+   GDKfree(msg);
+   else
+   c->curprg->def->errors = msg;
+   }
+   if (c->curprg->def->errors)
+   goto cleanup;
if (backup)
c->curprg = backup;
return 0;
@@ -1409,4 +1422,3 @@ rel_print(mvc *sql, sql_rel *rel, int de
close_stream(s);
buffer_destroy(b);
 }
-
diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- 

MonetDB: default - Merge with Nov2019

2019-11-21 Thread Pedro Ferreira
Changeset: 93de6de1fc63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=93de6de1fc63
Modified Files:
monetdb5/modules/mal/manifold.c
monetdb5/optimizer/opt_support.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_optimizer.c
sql/backends/monet5/sql_scenario.c
sql/server/rel_optimizer.c
Branch: default
Log Message:

Merge with Nov2019


diffs (138 lines):

diff --git a/monetdb5/modules/mal/manifold.c b/monetdb5/modules/mal/manifold.c
--- a/monetdb5/modules/mal/manifold.c
+++ b/monetdb5/modules/mal/manifold.c
@@ -370,7 +370,7 @@ MANIFOLDremapMultiplex(Client cntxt, Mal
 {
 (void) mb;
 (void) cntxt;
-throw(MAL, "opt.remap", "Function '%s.%s' not defined",
+throw(MAL, "mal.multiplex", "Function '%s.%s' not defined",
  *getArgReference_str(stk, p, p->retc),
  *getArgReference_str(stk, p, p->retc + 1));
 }
diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -96,7 +96,7 @@ optimizeMALBlock(Client cntxt, MalBlkPtr
/* assume the type and flow have been checked already */
/* SQL functions intended to be inlined should not be optimized */
if ( mb->inlineProp)
-   return 0;
+   return 0;
 
mb->optimize = 0;
if (mb->errors)
@@ -105,9 +105,9 @@ optimizeMALBlock(Client cntxt, MalBlkPtr
// strong defense line, assure that MAL plan is initially correct
if( mb->errors == 0 && mb->stop > 1){
resetMalBlk(mb, mb->stop);
-chkTypes(cntxt->usermodule, mb, FALSE);
-chkFlow(mb);
-chkDeclarations(mb);
+   chkTypes(cntxt->usermodule, mb, FALSE);
+   chkFlow(mb);
+   chkDeclarations(mb);
if( msg) 
return msg;
if( mb->errors != MAL_SUCCEED){
@@ -132,7 +132,7 @@ optimizeMALBlock(Client cntxt, MalBlkPtr
if (msg) {
str place = getExceptionPlace(msg);
str nmsg = NULL;
-   if(place){
+   if (place){
nmsg = 
createException(getExceptionType(msg), place, "%s", 
getExceptionMessageAndState(msg));
GDKfree(place);
}
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -140,7 +140,8 @@ static int
MalBlkPtr curBlk = 0;
InstrPtr curInstr = 0;
Symbol backup = NULL, curPrg = NULL;
-   int old_argc = be->mvc->argc;
+   int old_argc = be->mvc->argc, res = 0;
+   str msg = MAL_SUCCEED;
 
backup = c->curprg;
curPrg = c->curprg = newFunction(putName(mod), putName(name), 
FUNCTIONsymbol);
@@ -208,21 +209,31 @@ static int
return -1;
}
be->mvc->argc = old_argc;
-   /* SQL function definitions meant for inlineing should not be optimized 
before */
+   /* SQL function definitions meant for inlining should not be optimized 
before */
if (inline_func)
curBlk->inlineProp = 1;
/* optimize the code */
SQLaddQueryToCache(c);
if (curBlk->inlineProp == 0 && !c->curprg->def->errors) {
-   c->curprg->def->errors = SQLoptimizeQuery(c, c->curprg->def);
-   } else if(curBlk->inlineProp != 0) {
+   msg = SQLoptimizeQuery(c, c->curprg->def);
+   } else if (curBlk->inlineProp != 0) {
chkProgram(c->usermodule, c->curprg->def);
-   if(!c->curprg->def->errors)
-   c->curprg->def->errors = 
SQLoptimizeFunction(c,c->curprg->def);
+   if (!c->curprg->def->errors)
+   msg = SQLoptimizeFunction(c,c->curprg->def);
+   }
+   if (msg) {
+   if (c->curprg->def->errors)
+   GDKfree(msg);
+   else
+   c->curprg->def->errors = msg;
+   }
+   if (c->curprg->def->errors) {
+   freeSymbol(curPrg);
+   res = -1;
}
if (backup)
c->curprg = backup;
-   return 0;
+   return res;
 }
 
 static str
diff --git a/sql/backends/monet5/sql_optimizer.c 
b/sql/backends/monet5/sql_optimizer.c
--- a/sql/backends/monet5/sql_optimizer.c
+++ b/sql/backends/monet5/sql_optimizer.c
@@ -258,7 +258,7 @@ SQLoptimizeQuery(Client c, MalBlkPtr mb)
if (msg != MAL_SUCCEED)
freeException(msg); /* ignore error */
}
-   return NULL;
+   return createException(MAL, 

MonetDB: default - Merge with Nov2019 branch.

2019-11-20 Thread Sjoerd Mullender
Changeset: a08187b00dfc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a08187b00dfc
Modified Files:
clients/NT/mclient.bat
clients/NT/msqldump.bat
clients/NT/stethoscope.bat
clients/odbc/driver/README
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_utils.c
monetdb5/NT/M5server.bat
monetdb5/mal/mal.c
monetdb5/mal/mal.h
monetdb5/optimizer/opt_mitosis.c
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (254 lines):

diff --git a/clients/NT/mclient.bat b/clients/NT/mclient.bat
--- a/clients/NT/mclient.bat
+++ b/clients/NT/mclient.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 if not "%1"=="/STARTED-FROM-MENU" goto skip
 shift
diff --git a/clients/NT/msqldump.bat b/clients/NT/msqldump.bat
--- a/clients/NT/msqldump.bat
+++ b/clients/NT/msqldump.bat
@@ -11,8 +11,7 @@
 @set MONETDB=%MONETDB:~0,-1%
 
 @rem extend the search path with our EXE and DLL folders
-@rem we depend on pthreadVCE.dll having been copied to the lib folder
-@set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+@set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 @rem start the real client
 @"%MONETDB%\bin\msqldump.exe" %*
diff --git a/clients/NT/stethoscope.bat b/clients/NT/stethoscope.bat
--- a/clients/NT/stethoscope.bat
+++ b/clients/NT/stethoscope.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 rem start the real client
 "%MONETDB%\bin\stethoscope.exe" %1 %2 %3 %4 %5 %6 %7 %8
diff --git a/clients/odbc/driver/README b/clients/odbc/driver/README
--- a/clients/odbc/driver/README
+++ b/clients/odbc/driver/README
@@ -25,7 +25,7 @@ ODBC is chosen to be implemented first b
   ourselves to get this functionality now.
 Update 2016: the JDBC-ODBC bridge driver is no longer needed nor supported in 
JRE.
 We provide a 100% pure (type 4) JDBC driver implementation for MonetDB.
-See: https://www.monetdb.org/downloads/Java/Latest/
+See: https://www.monetdb.org/downloads/Java/
 
 Tip:
 ===
@@ -33,7 +33,6 @@ To do ODBC driver development/maintenanc
  specification to learn what the ODBC API functions and behavior has to be.
 This specification is available as MS Windows help file (ODBC.HLP and 
ODBC.CNT).
 It is part of the MS ODBC SDK which has become part of the MS MDAC SDK.
-For convenience it is also available in /ufs/dinther/ODBC/
 
 For compilation you need the ODBC API include header files:
sqltypes.h  /* ODBC type defines */
@@ -51,7 +50,7 @@ All ODBC driver implementation files are
 Every ODBC API function which needs to be implemented by the driver
  has its own file with the same name as the function and suffix ".c".
 The ODBC API functions all start with SQL, so its easy to locate them.
-There are 73 SQL*.c files and thus 73 ODBC API functions implemented.
+There are 76 SQL*.c files and thus 76 ODBC API functions implemented.
 
 The ODBC API function prototypes and defines are defined in sqltypes.h,
  sql.h, sqlext.h and sqlucode.h so there are NO SQL*.h files.
@@ -61,7 +60,7 @@ the sql*.h files and other standard exte
 Every SQL*.c must include this ODBCGlobal.h file as first include.
 
 Besides the SQL*.c files there are the ODBC*.[ch] files.
-The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCHostVar.[ch]
+The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCDesc.[ch]
  and ODBCError.[ch] implement the structures needed to represent the
  handles (pointers to an object) and the internal state of the ODBC objects.
 In the implementation section below it is explained why these are necessary.
@@ -100,7 +99,7 @@ In ODBC multiple environments (each appl
  multiple input parameters per statement, multiple output columns per result
  set.
 The management and validity of these handles is all implemented in
-the ODBCEnv.[ch], ODBCDbc.{ch], ODBCStmt.[ch] and ODBCHostVar.[ch] files.
+the ODBCEnv.[ch], ODBCDbc.[ch], ODBCStmt.[ch] and ODBCDesc.[ch] files.
 
 Error handling in ODBC is done in a special way which is explained here.
 Every ODBC API function returns a code (integer) which can be:
@@ -126,7 +125,7 @@ specific handle (e.g. addDbcError()), to
 
 Implementation of the ODBC API functions:
 
-Although 73 SQL*() functions are implemented, some do not 

MonetDB: default - Merge with Nov2019

2019-11-19 Thread Pedro Ferreira
Changeset: 0469d51d2922 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0469d51d2922
Modified Files:
sql/server/rel_optimizer.c
sql/test/BugTracker-2018/Tests/case_with_orderby_limit.Bug-6512.sql

sql/test/BugTracker-2018/Tests/case_with_orderby_limit.Bug-6512.stable.out
sql/test/pg_regress/Tests/loadwisconsin.sql
sql/test/pg_regress/Tests/loadwisconsin.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 118857 to 300 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -1374,7 +1374,7 @@ static sql_exp *
if (get_cmp(e) == cmp_or || get_cmp(e) == cmp_filter) {
list *l, *r;
 
-   l = exps_push_down(sql, e->l, f, t);
+   l = exps_push_down(sql, e->l, f, t);
if (!l)
return NULL;
r = exps_push_down(sql, e->r, f, t);
@@ -1448,7 +1448,6 @@ exp_push_down(mvc *sql, sql_exp *e, sql_
return _exp_push_down(sql, e, f, t);
 }
 
-
 /* some projections results are order dependend (row_number etc) */
 static int 
 project_unsafe(sql_rel *rel, int allow_identity)
@@ -1760,13 +1759,13 @@ rel_push_count_down(int *changes, mvc *s
if (!is_groupby(rel->op))
return rel;
 
-   r = rel->l;
+   r = rel->l;
 
if (is_groupby(rel->op) && !rel_is_ref(rel) &&
-r && !r->exps && r->op == op_join && !(rel_is_ref(r)) && 
-   /* currently only single count aggregation is handled, no other 
projects or aggregation */
-   list_length(rel->exps) == 1 && 
exp_aggr_is_count(rel->exps->h->data)) {
-   sql_exp *nce, *oce;
+   r && !r->exps && r->op == op_join && !(rel_is_ref(r)) && 
+   /* currently only single count aggregation is handled, no other 
projects or aggregation */
+   list_length(rel->exps) == 1 && 
exp_aggr_is_count(rel->exps->h->data)) {
+   sql_exp *nce, *oce;
sql_rel *gbl, *gbr; /* Group By */
sql_rel *cp;/* Cross Product */
sql_subfunc *mult;
@@ -1780,7 +1779,7 @@ rel_push_count_down(int *changes, mvc *s
rname = exp_relname(oce);
name  = exp_name(oce);
 
-   args = new_exp_list(sql->sa);
+   args = new_exp_list(sql->sa);
srel = r->l;
{
sql_subaggr *cf = sql_bind_aggr(sql->sa, 
sql->session->schema, "count", NULL);
@@ -6069,7 +6068,7 @@ exps_remove_dictexps(mvc *sql, list *exp
 static sql_rel *
 rel_remove_join(int *changes, mvc *sql, sql_rel *rel)
 {
-   if (is_join(rel->op) && !is_outerjoin(rel->op) && /* DISABLES CODE */ 
(0)) {
+   if (is_join(rel->op) && !is_outerjoin(rel->op)) {
sql_rel *l = rel->l;
sql_rel *r = rel->r;
int lconst = 0, rconst = 0;
@@ -6100,7 +6099,7 @@ rel_remove_join(int *changes, mvc *sql, 
list_merge(rel->exps, r->exps, (fdup)NULL);
}
}
-   if (is_join(rel->op) && /* DISABLES CODE */ (0)) {
+   if (is_join(rel->op)) {
sql_rel *l = rel->l;
sql_rel *r = rel->r;
int ldict = 0, rdict = 0;
@@ -6137,7 +6136,7 @@ rel_remove_join(int *changes, mvc *sql, 
 * where non of the project_cols are from B and x=y is a foreign key 
join (B is the unique side)
 * and there are no filters on B
 */
-   if (/* DISABLES CODE */ (0) && is_project(rel->op)) {
+   if (is_project(rel->op)) {
sql_rel *j = rel->l;
 
if (is_join(j->op)) {
@@ -8354,7 +8353,7 @@ add_nulls(mvc *sql, sql_rel *rel, sql_re
 static sql_rel *
 rel_split_outerjoin(int *changes, mvc *sql, sql_rel *rel)
 {
-   if (/* DISABLES CODE */ (0) && (rel->op == op_left || rel->op == 
op_right || rel->op == op_full) &&
+   if ((rel->op == op_left || rel->op == op_right || rel->op == op_full) &&
list_length(rel->exps) == 1 && exps_nr_of_or(rel->exps) == 
list_length(rel->exps)) { 
sql_rel *l = rel->l, *nl, *nll, *nlr;
sql_rel *r = rel->r, *nr;
@@ -9153,13 +9152,13 @@ optimize_rel(mvc *sql, sql_rel *rel, int
 * also joins between a relation and a DICT (which isn't used)
 * could be removed.
 * */
-   if (gp.cnt[op_join] && gp.cnt[op_project])
+   if (gp.cnt[op_join] && gp.cnt[op_project] && /* DISABLES CODE */ (0))
rel = rewrite(sql, rel, _remove_join, ); 
 
if (gp.cnt[op_join] || 
-   gp.cnt[op_left] || gp.cnt[op_right] || gp.cnt[op_full] || 
-   gp.cnt[op_semi] || gp.cnt[op_anti] ||
-   gp.cnt[op_select]) {
+   gp.cnt[op_left] || 

MonetDB: default - Merge with Nov2019

2019-11-19 Thread Pedro Ferreira
Changeset: ec29946a6608 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec29946a6608
Modified Files:
sql/backends/monet5/rel_bin.c
sql/common/sql_types.c
sql/server/rel_rel.h
sql/server/rel_select.c
sql/server/rel_select.h
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.sql
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.err
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/package.py
sql/test/emptydb-upgrade-chain/Tests/package.py
sql/test/emptydb/Tests/package-hge.py
sql/test/emptydb/Tests/package.py
sql/test/testdb-upgrade-chain-hge/Tests/package.py
sql/test/testdb-upgrade-chain/Tests/package.py
sql/test/testdb/Tests/package-hge.py
sql/test/testdb/Tests/package.py
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 559 to 300 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
@@ -1166,11 +1166,6 @@ check_types(backend *be, sql_subtype *ct
int c = 0;
sql_subtype *t = NULL, *st = NULL;
 
-   /*
-   if (ct->types) 
-   return check_table_types(sql, ct->types, s, tpe);
-   */
-
st = tail_type(s);
if ((!st || !st->type) && stmt_set_type_param(sql, ct, s) == 0) {
return s;
@@ -1188,14 +1183,17 @@ check_types(backend *be, sql_subtype *ct
}
 
if (!t) {   /* try to convert if needed */
-   c = sql_type_convert(st->type->eclass, ct->type->eclass);
-   if (!c || (c == 2 && tpe == type_set) || 
-   (c == 3 && tpe != type_cast)) { 
-   s = NULL;
+   if (EC_INTERVAL(st->type->eclass) && (ct->type->eclass == 
EC_NUM || ct->type->eclass == EC_POS) && ct->digits < st->digits) {
+   s = NULL; /* conversion from interval to num depends on 
the number of digits */
} else {
-   s = stmt_convert(be, s, st, ct, NULL);
+   c = sql_type_convert(st->type->eclass, 
ct->type->eclass);
+   if (!c || (c == 2 && tpe == type_set) || (c == 3 && tpe 
!= type_cast)) { 
+   s = NULL;
+   } else {
+   s = stmt_convert(be, s, st, ct, NULL);
+   }
}
-   } 
+   }
if (!s) {
stmt *res = sql_error(
sql, 03,
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
@@ -409,7 +409,7 @@ subtype2string(sql_subtype *t)
snprintf(buf, BUFSIZ, "%s(%u)", 
t->type->sqlname, t->digits);
} else {
-   snprintf(buf, BUFSIZ, "%s", t->type->sqlname);
+   snprintf(buf, BUFSIZ, "%s", t->type->sqlname);
}
return _STRDUP(buf);
 }
@@ -440,7 +440,7 @@ int
 subaggr_cmp( sql_subaggr *a1, sql_subaggr *a2)
 {
if (a1->aggr == a2->aggr) 
-   return list_cmp(a1->res, a2->res, (fcmp) _cmp);
+   return list_cmp(a1->res, a2->res, (fcmp) _cmp);
return -1;
 }
 
@@ -448,7 +448,7 @@ int
 subfunc_cmp( sql_subfunc *f1, sql_subfunc *f2)
 {
if (f1->func == f2->func) 
-   return list_cmp(f1->res, f2->res, (fcmp) _cmp);
+   return list_cmp(f1->res, f2->res, (fcmp) _cmp);
return -1;
 }
 
@@ -460,7 +460,6 @@ arg_subtype_cmp(sql_arg *a, sql_subtype 
return (is_subtype(t, >type )?0:-1);
 }
 
-
 static sql_subaggr *
 _dup_subaggr(sql_allocator *sa, sql_func *a, sql_subtype *member)
 {
@@ -507,8 +506,8 @@ sql_bind_aggr(sql_allocator *sa, sql_sch
arg = a->ops->h->data;
 
if (strcmp(a->base.name, sqlaname) == 0 && (!arg ||
-   arg->type.type->eclass == EC_ANY || 
-   (type && is_subtype(type, >type  
+   arg->type.type->eclass == EC_ANY || 
+   (type && is_subtype(type, >type  
return _dup_subaggr(sa, a, type);
n = n->next;
}
@@ -526,8 +525,8 @@ sql_bind_aggr(sql_allocator *sa, sql_sch
arg = a->ops->h->data;
 
if (strcmp(a->base.name, sqlaname) == 0 && (!arg ||
-   arg->type.type->eclass == EC_ANY || 
-   (type && is_subtype(type, >type  
+   arg->type.type->eclass == EC_ANY || 
+   (type && is_subtype(type, >type  
return _dup_subaggr(sa, a, type);
   

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

2019-11-18 Thread Sjoerd Mullender
Changeset: d11738886ae7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d11738886ae7
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 Nov2019 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 Nov2019 branch.

2019-11-18 Thread Sjoerd Mullender
Changeset: 454270f0b844 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=454270f0b844
Added Files:
debian/libmonetdb19.install
Removed Files:
ChangeLog.Apr2019
buildtools/ChangeLog.Apr2019
buildtools/selinux/ChangeLog.Apr2019
clients/ChangeLog.Apr2019
clients/mapilib/ChangeLog.Apr2019
common/stream/ChangeLog.Apr2019
debian/libmonetdb18.install
gdk/ChangeLog.Apr2019
geom/ChangeLog.Apr2019
monetdb5/ChangeLog.Apr2019
sql/ChangeLog.Apr2019
testing/ChangeLog.Apr2019
tools/merovingian/ChangeLog.Apr2019
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
debian/control
gdk/ChangeLog-Archive
gdk/ChangeLog.Nov2019
libversions
monetdb5/ChangeLog-Archive
monetdb5/ChangeLog.Nov2019
sql/ChangeLog-Archive
sql/ChangeLog.Nov2019
tools/merovingian/ChangeLog-Archive
tools/merovingian/ChangeLog.Nov2019
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 763 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -737,3 +737,5 @@ 6566d90185b83ed95129db9ea68baf52f2de5cc7
 a6674f7048a13fe7dc53995a4f723d33a34bce23 Apr2019_SP1_release
 6566d90185b83ed95129db9ea68baf52f2de5cc7 Apr2019_SP1_release
 d4c1a8c3cbcd965169f1836eaa635101436db81c Nov2019_root
+90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_1
+90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release
diff --git a/ChangeLog.Apr2019 b/ChangeLog.Apr2019
deleted file mode 100644
--- a/ChangeLog.Apr2019
+++ /dev/null
@@ -1,2 +0,0 @@
-# ChangeLog file for devel
-# This file is updated with Maddlog
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -114,7 +114,7 @@ Group: Applications/Databases
 License: MPLv2.0
 URL: https://www.monetdb.org/
 BugURL: https://bugs.monetdb.org/
-Source: 
https://www.monetdb.org/downloads/sources/Apr2019-SP1/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Nov2019/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 # we need checkpolicy and selinux-policy-devel for the SELinux policy
@@ -1059,6 +1059,146 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Mon Nov 18 2019 Sjoerd Mullender  - 11.35.1-20191118
+- Rebuilt.
+- BZ#6134: Query produces error: HEAPalloc: Insufficient space for HEAP
+  of 1168033427456 bytes.
+- BZ#6613: LATERAL crash /.../rel_bin.c:1473: rel2bin_table: Assertion
+  `0' failed.
+- BZ#6683: Bug in subselect
+- BZ#6686: Bug in subselect (count function)
+- BZ#6688: Bug in subselect (or condition)
+- BZ#6689: Trying to improve the performance of SQL queries with a large
+  list of members in IN clause.
+- BZ#6695: timestamp transformation
+- BZ#6700: Monetdb Bugs in Subselect statements:
+- BZ#6722: window functions issues
+- BZ#6740: while upgrading the database from verison (MonetDB-11.27.13)
+  to (MonetDB-11.33.3) we are unable to bring up the database
+- BZ#6754: in mclient a strang msg is reported after issueing command:
+  set schema sys;
+- BZ#6755: Assertion failure in rel_bin.c
+- BZ#6756: Error in optimizer garbageCollector on merge tables select
+- BZ#6757: Double free or corruption (out)
+- BZ#6758: SIGSEGV in __strcmp_sse2_unaligned()
+- BZ#6759: Python JSON loader creates invalid data type for strings
+- BZ#6761: Error: Program contains errors.:(NONE).multiplex
+- BZ#6762: mserver5 crashes on (re-)start
+- BZ#6764: mserver5 crashes with corruption, double free, invalid size
+  or invalid pointer
+- BZ#6766: Missing bulk implementation for get_value and next_value calls
+- BZ#6769: ProfilerStart is not threadsafe
+- BZ#6771: R-devel
+- BZ#6773: json.filter returns corrupted string when selecting JSON
+  null value
+- BZ#6774: PROD aggregation gives wrong result
+- BZ#6775: NOT IN with an AND containing an OR gives wrong result
+- BZ#6776: Creating a table with a full outer join query gives type with
+  wrong digits on the joined key.
+- BZ#6779: Using Windows Messages translation for errno error codes.
+- BZ#6780: Wrong value of the rank function
+- BZ#6781: Insert after index creation crash
+- BZ#6782: JDBC IsValid(int) does not reset lastquerytimeout on server
+- BZ#6783: AVG changes scale of its results
+- BZ#6784: function sys.isauuid(string) should return false if string
+  value cannot be converted to a UUID
+
+* Mon Nov  4 2019 Pedro Ferreira  - 
11.35.1-20191118
+- sql: Removed functions json.text(string) returns string and json.text(int)
+  returns string. Their MAL implementation didn't exist, so they were
+  meaningless.
+
+* Thu Oct 17 2019 Pedro Ferreira  - 
11.35.1-20191118
+- merovingian: Added "vmmaxsize" and "memmaxsize" mserver5 options to the 
daemon in
+  order to set mserver5's maximum virtual and committed memory
+  respectively.
+
+* Wed Sep 25 2019 Sjoerd Mullender  - 11.35.1-20191118
+- sql: Strings are now limited 

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

2019-11-18 Thread Sjoerd Mullender
Changeset: 0012b9d1f229 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0012b9d1f229
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 Nov2019 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 Nov2019 branch.

2019-11-18 Thread Sjoerd Mullender
Changeset: 37de9e829161 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37de9e829161
Modified Files:
sql/test/BugTracker-2019/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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/mergetables/Tests/All
sql/test/subquery/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 Nov2019 branch.


diffs (truncated from 1118 to 300 lines):

diff --git a/sql/test/BugTracker-2019/Tests/All 
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -18,8 +18,8 @@ merge-statement-aliases.Bug-6715
 insert-into-select.Bug-6718
 copy-into-unicode-quote.Bug-6716
 select_window_function_and_asterisk.Bug-6722
-disallow_duplicate_column_aliases.Bug-6723
-prepare-types.Bug-6724
+KNOWNFAIL?disallow_duplicate_column_aliases.Bug-6723
+KNOWNFAIL?prepare-types.Bug-6724
 prepare-non-existing-function.Bug-6725
 select-distinct.Bug-6728
 table-duplicate-column.Bug-6729
@@ -30,13 +30,13 @@ sequence-first-next-value.Bug-6743
 sequences-defaults.Bug-6744
 sequences-types.Bug-6745
 alter_table_drop_column.Bug-6749
-HAVE_PYMONETDB?remote-table-non-existent-column.Bug-6750
+KNOWNFAIL_PYMONETDB?remote-table-non-existent-column.Bug-6750
 cte-union.Bug-6755
 merge-table-limit.Bug-6756
 double-free.Bug-6757
 HAVE_LIBPY3?python-loader-string.Bug-6759
 select-char.Bug-6761
-grant-select-column.Bug-6765
+KNOWNFAIL?grant-select-column.Bug-6765
 next-get-value-bulk.Bug-6766
 filter_json_null.Bug-6773
 prod-decimals.Bug-6774
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
@@ -5881,7 +5881,7 @@ drop procedure sys.times();
 set schema "sys";
 
 Running database upgrade commands:
-insert into sys.dependencies select c1, c2, c3 from 
(values(11839,11848,7),(11843,11852,7),(11597,12088,7),(11590,12088,7),(11593,12088,7),(11594,12088,7),(11595,12088,7),(11596,12088,7),(11656,12100,7),(12088,12100,7),(12092,12100,7),(25153,25155,13),(25141,25155,13),(25142,25155,13),(25143,25155,13),(25144,25155,13),(25145,25155,13),(25146,25155,13),(25147,25155,13),(25148,25155,13),(25149,25155,13),(25150,25155,13),(25151,25155,13),(25152,25155,13),(25056,25155,13),(25039,25155,13),(25040,25155,13),(25041,25155,13),(25042,25155,13),(25043,25155,13),(25044,25155,13),(25045,25155,13),(25046,25155,13),(25047,25155,13),(25048,25155,13),(25049,25155,13),(25050,25155,13),(25051,25155,13),(25052,25155,13),(25053,25155,13),(25054,25155,13),(25055,25155,13),(2079,25155,13),(2080,25155,13),(2081,25155,13),(2082,25155,13),(2083,25155,13),(2084,25155,13),(2085,25155,13),(2102,25155,13),(2103,25155,13),(2104,25155,13),(2105,25155,13),(20651,25155,13),(20652,25155,13),(20653,25155,13),(20654,2
 

MonetDB: default - Merge with Nov2019

2019-11-18 Thread Pedro Ferreira
Changeset: 9b13691eabb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b13691eabb1
Modified Files:
sql/backends/monet5/sql_upgrades.c
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (67 lines):

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
@@ -2286,6 +2286,10 @@ sql_update_nov2019(Client c, mvc *sql, c
"GRANT EXECUTE ON AGGREGATE quantile(INTERVAL MONTH, 
DOUBLE) TO PUBLIC;\n"
);
 
+   pos += snprintf(buf + pos, bufsize - pos,
+   "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys')"
+   " and name in ('stddev_samp', 'stddev_pop', 'var_samp', 
'var_pop', 'median', 'quantile') and type = %d;\n", (int) F_AGGR);
+
/* The MAL implementation of functions json.text(string) and 
json.text(int) do not exist */
pos += snprintf(buf + pos, bufsize - pos,
"drop function json.text(string);\n"
diff --git a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in 
b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
--- a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
+++ b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
@@ -1457,7 +1457,7 @@ COPY 56 RECORDS INTO segment4 FROM STDIN
 "74406"|"74406"
 "74404"|"74404"
 
-COPY INTO all_dates FROM E'$QTSTSRCDIR/all_dates.csv.gz' DELIMITERS '|' , 
E'\n', '"';
+COPY 49998 RECORDS INTO all_dates FROM E'$QTSTSRCDIR/all_dates.csv.gz' 
DELIMITERS '|' , E'\n', '"';
 
 -- this works
 SELECT loc.code
@@ -1490,9 +1490,9 @@ SELECT loc.code
 AND f.book_code = 'G2FIN'
 AND ( cat.subcategory_code = 200 OR cat.subcategory_code = 301 OR 
cat.subcategory_code >= 221 )
 AND ( cat.subcategory_code = 200 OR cat.subcategory_code = 301 OR 
cat.subcategory_code <= 290 )
-AND d.month_code BETWEEN '2016.01' AND '2016.10';
+AND d.month_code BETWEEN '2016.01' AND '2016.10'
+ ORDER BY d.d_date;
 
-
 SELECT loc.code
   ,cat.subcategory_code
   ,cat.category_code
@@ -1524,7 +1524,8 @@ SELECT loc.code
 AND ( cat.subcategory_code = 200 OR cat.subcategory_code = 301 OR 
cat.subcategory_code >= 221 )
 AND ( cat.subcategory_code = 200 OR cat.subcategory_code = 301 OR 
cat.subcategory_code <= 290 )
 AND ( s1.code = '03' OR cat.subcategory_code = 25 )
-AND d.month_code BETWEEN '2016.01' AND '2016.10';
+AND d.month_code BETWEEN '2016.01' AND '2016.10'
+ ORDER BY d.d_date;
 
 SELECT 1 FROM location loc,segment1 s1,fact f WHERE s1.id = f.s1_id AND loc.id 
= f.location_id;
 
diff --git a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out 
b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
--- a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
+++ b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
@@ -284,6 +284,7 @@ stdout of test 'heapextend.Bug-6134` in 
 % code,subcategory_code,   category_code,  code,   code,   code,   
code,   d_date, month_code # name
 % varchar, varchar,varchar,varchar,varchar,
varchar,varchar,date,   varchar # type
 % 5,   3,  2,  2,  4,  4,  5,  10, 7 # length
+[ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-01-16, "2016.01"   ]
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-02-16, "2016.02"   ]
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-03-16, "2016.03"   ]
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-04-16, "2016.04"   ]
@@ -293,7 +294,6 @@ stdout of test 'heapextend.Bug-6134` in 
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-08-16, "2016.08"   ]
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-09-16, "2016.09"   ]
 [ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-10-16, "2016.10"   ]
-[ "(n/z)", "301",  "30",   "10",   "1300", "7422", "0",
2016-01-16, "2016.01"   ]
 #SELECT loc.code
 #  ,cat.subcategory_code
 #  ,cat.category_code
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2019-11-15 Thread Pedro Ferreira
Changeset: 64e88b8fedac for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64e88b8fedac
Added Files:
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.sql
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.err
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.err
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
Removed Files:
sql/test/BugTracker-2016/Tests/consolidated_table.Bug-3954.sql
sql/test/BugTracker-2017/Tests/multiplevalues.Bug-6336.sql
Modified Files:
gdk/ChangeLog.Apr2019
gdk/ChangeLog.Nov2019
sql/backends/monet5/sql_upgrades.c
sql/scripts/39_analytics.sql
sql/server/rel_dump.c
sql/server/rel_optimizer.c
sql/server/rel_partition.c
sql/server/sql_partition.c
sql/test/BugTracker-2014/Tests/All
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
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/sys-schema/Tests/systemfunctions.stable.out
sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
sql/test/xquery/Tests/create.sql
sql/test/xquery/Tests/drop.sql
tools/merovingian/ChangeLog.Apr2019
tools/merovingian/ChangeLog.Nov2019
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1868 to 300 lines):

diff --git a/gdk/ChangeLog.Apr2019 b/gdk/ChangeLog.Apr2019
--- a/gdk/ChangeLog.Apr2019
+++ b/gdk/ChangeLog.Apr2019
@@ -1,3 +1,3 @@
-# ChangeLog file for MonetDB
+# ChangeLog file for gdk
 # This file is updated with Maddlog
 
diff --git a/gdk/ChangeLog.Nov2019 b/gdk/ChangeLog.Nov2019
--- a/gdk/ChangeLog.Nov2019
+++ b/gdk/ChangeLog.Nov2019
@@ -1,4 +1,4 @@
-# ChangeLog file for MonetDB
+# ChangeLog file for gdk
 # This file is updated with Maddlog
 
 * Sun Sep  8 2019 Sjoerd Mullender 
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
@@ -2062,7 +2062,7 @@ bailout:
 static str
 sql_update_nov2019(Client c, mvc *sql, const char *prev_schema, bool 
*systabfixed)
 {
-   size_t bufsize = 8192, pos = 0;
+   size_t bufsize = 16384, pos = 0;
char *err = NULL, *buf = GDKmalloc(bufsize);
res_table *output;
BAT *b;
@@ -2241,6 +2241,51 @@ sql_update_nov2019(Client c, mvc *sql, c
"update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'wlr')"
" and name in ('master', 'stop', 'accept', 'replicate', 
'beat') and type = %d;\n", (int) F_PROC);
 
+   /* 39_analytics.sql */
+   pos += snprintf(buf + pos, bufsize - pos,
+   "create aggregate stddev_samp(val INTERVAL SECOND) 
returns DOUBLE\n"
+   "external name \"aggr\".\"stdev\";\n"
+   "GRANT EXECUTE ON AGGREGATE stddev_samp(INTERVAL 
SECOND) TO PUBLIC;\n"
+   "create aggregate stddev_samp(val INTERVAL MONTH) 
returns DOUBLE\n"
+   "external name \"aggr\".\"stdev\";\n"
+   "GRANT EXECUTE ON AGGREGATE stddev_samp(INTERVAL MONTH) 
TO PUBLIC;\n"
+
+   "create aggregate stddev_pop(val INTERVAL SECOND) 
returns DOUBLE\n"
+   "external name \"aggr\".\"stdevp\";\n"
+   "GRANT EXECUTE ON AGGREGATE stddev_pop(INTERVAL SECOND) 
TO PUBLIC;\n"
+   "create aggregate stddev_pop(val INTERVAL MONTH) 
returns DOUBLE\n"
+   "external name \"aggr\".\"stdevp\";\n"
+   "GRANT EXECUTE ON AGGREGATE stddev_pop(INTERVAL MONTH) 
TO PUBLIC;\n"
+
+   "create aggregate var_samp(val INTERVAL SECOND) returns 
DOUBLE\n"
+   "external name \"aggr\".\"variance\";\n"
+   "GRANT EXECUTE ON AGGREGATE var_samp(INTERVAL SECOND) 
TO PUBLIC;\n"
+   "create aggregate var_samp(val INTERVAL MONTH) returns 
DOUBLE\n"
+   "external name \"aggr\".\"variance\";\n"
+   "GRANT EXECUTE ON AGGREGATE var_samp(INTERVAL MONTH) TO 
PUBLIC;\n"
+
+   "create aggregate var_pop(val INTERVAL SECOND) returns 
DOUBLE\n"
+   "external name \"aggr\".\"variancep\";\n"
+   "GRANT EXECUTE ON AGGREGATE var_pop(INTERVAL SECOND) TO 
PUBLIC;\n"
+   "create aggregate var_pop(val INTERVAL MONTH) returns 
DOUBLE\n"
+   "external name \"aggr\".\"variancep\";\n"
+   "GRANT EXECUTE ON AGGREGATE var_pop(INTERVAL MONTH) TO 

MonetDB: default - Merge with Nov2019

2019-11-14 Thread Pedro Ferreira
Changeset: 07a6fb005fe7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07a6fb005fe7
Added Files:
sql/benchmarks/arno/Tests/inserts.options5
sql/benchmarks/arno/Tests/inserts.reqtests
sql/benchmarks/arno/Tests/inserts.sql.src
sql/benchmarks/arno/Tests/inserts.stable.err
sql/benchmarks/arno/Tests/inserts.stable.out
sql/benchmarks/arno/inserts.sql
sql/benchmarks/arno_flt/inserts.flt.sql
Removed Files:
sql/benchmarks/arno/Tests/insert_ATOM.options5
sql/benchmarks/arno/Tests/insert_ATOM.reqtests
sql/benchmarks/arno/Tests/insert_ATOM.sql.src
sql/benchmarks/arno/Tests/insert_ATOM.stable.err
sql/benchmarks/arno/Tests/insert_ATOM.stable.out
sql/benchmarks/arno/Tests/insert_BOND.options5
sql/benchmarks/arno/Tests/insert_BOND.reqtests
sql/benchmarks/arno/Tests/insert_BOND.sql.src
sql/benchmarks/arno/Tests/insert_BOND.stable.err
sql/benchmarks/arno/Tests/insert_BOND.stable.out
sql/benchmarks/arno/Tests/insert_MODEL.reqtests
sql/benchmarks/arno/Tests/insert_MODEL.sql.src
sql/benchmarks/arno/Tests/insert_MODEL.stable.err
sql/benchmarks/arno/Tests/insert_MODEL.stable.out
sql/benchmarks/arno/insert_ATOM.int.sql
sql/benchmarks/arno/insert_BOND.int.sql
sql/benchmarks/arno/insert_MODEL.int.sql
sql/benchmarks/arno_flt/insert_ATOM.flt.sql
sql/benchmarks/arno_flt/insert_BOND.flt.sql
sql/benchmarks/arno_flt/insert_MODEL.flt.sql
sql/test/VOC/VOCcreate_user.sql
sql/test/VOC/VOCdrop.sql
sql/test/VOC/VOCdrop_user.sql
sql/test/VOC/VOCinsert.sql
sql/test/VOC/VOCmanual_examples.sql
sql/test/VOC/VOCquery.sql
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/benchmarks/ATIS/Tests/load.stable.out
sql/benchmarks/ATIS/load.sql
sql/benchmarks/arno/Tests/01.reqtests
sql/benchmarks/arno/Tests/02.reqtests
sql/benchmarks/arno/Tests/03.reqtests
sql/benchmarks/arno/Tests/04.reqtests
sql/benchmarks/arno/Tests/05.reqtests
sql/benchmarks/arno/Tests/06.reqtests
sql/benchmarks/arno/Tests/07.reqtests
sql/benchmarks/arno/Tests/08.reqtests
sql/benchmarks/arno/Tests/09.reqtests
sql/benchmarks/arno/Tests/10.reqtests
sql/benchmarks/arno/Tests/11.reqtests
sql/benchmarks/arno/Tests/12.reqtests
sql/benchmarks/arno/Tests/13.reqtests
sql/benchmarks/arno/Tests/14.reqtests
sql/benchmarks/arno/Tests/15.reqtests
sql/benchmarks/arno/Tests/16.reqtests
sql/benchmarks/arno/Tests/17.reqtests
sql/benchmarks/arno/Tests/18.reqtests
sql/benchmarks/arno/Tests/19.reqtests
sql/benchmarks/arno/Tests/20.reqtests
sql/benchmarks/arno/Tests/21.reqtests
sql/benchmarks/arno/Tests/22.reqtests
sql/benchmarks/arno/Tests/23.reqtests
sql/benchmarks/arno/Tests/24.reqtests
sql/benchmarks/arno/Tests/25.reqtests
sql/benchmarks/arno/Tests/26.reqtests
sql/benchmarks/arno/Tests/27.reqtests
sql/benchmarks/arno/Tests/28.reqtests
sql/benchmarks/arno/Tests/29.reqtests
sql/benchmarks/arno/Tests/30.reqtests
sql/benchmarks/arno/Tests/31.reqtests
sql/benchmarks/arno/Tests/32.reqtests
sql/benchmarks/arno/Tests/33.reqtests
sql/benchmarks/arno/Tests/34.reqtests
sql/benchmarks/arno/Tests/35.reqtests
sql/benchmarks/arno/Tests/36.reqtests
sql/benchmarks/arno/Tests/37.reqtests
sql/benchmarks/arno/Tests/38.reqtests
sql/benchmarks/arno/Tests/39.reqtests
sql/benchmarks/arno/Tests/40.reqtests
sql/benchmarks/arno/Tests/41.reqtests
sql/benchmarks/arno/Tests/42.reqtests
sql/benchmarks/arno/Tests/43.reqtests
sql/benchmarks/arno/Tests/44.reqtests
sql/benchmarks/arno/Tests/45.reqtests
sql/benchmarks/arno/Tests/46.reqtests
sql/benchmarks/arno/Tests/47.reqtests
sql/benchmarks/arno/Tests/48.reqtests
sql/benchmarks/arno/Tests/49.reqtests
sql/benchmarks/arno/Tests/50.reqtests
sql/benchmarks/arno/Tests/51.reqtests
sql/benchmarks/arno/Tests/52.reqtests
sql/benchmarks/arno/Tests/53.reqtests
sql/benchmarks/arno/Tests/54.reqtests
sql/benchmarks/arno/Tests/55.reqtests
sql/benchmarks/arno/Tests/56.reqtests
sql/benchmarks/arno/Tests/57.reqtests
sql/benchmarks/arno/Tests/58.reqtests
sql/benchmarks/arno/Tests/59.reqtests
sql/benchmarks/arno/Tests/60.reqtests
sql/benchmarks/arno/Tests/61.reqtests
sql/benchmarks/arno/Tests/62.reqtests
sql/benchmarks/arno/Tests/63.reqtests

MonetDB: default - Merge with Nov2019 branch.

2019-11-13 Thread Sjoerd Mullender
Changeset: 19bd77490b9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19bd77490b9a
Modified Files:
common/utils/msabaoth.c
common/utils/msabaoth.h
gdk/gdk_utils.c
monetdb5/mal/mal_session.c
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_optimizer.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/discoveryrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/forkmserver.h
tools/merovingian/utils/database.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 599 to 300 lines):

diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -671,11 +671,7 @@ msab_getSingleStatus(const char *pathbuf
}
}
snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
MAINTENANCEFILE);
-   if (stat(buf, ) == -1) {
-   sdb->locked = 0;
-   } else {
-   sdb->locked = 1;
-   }
+   sdb->locked = stat(buf, ) != -1;
 
/* add scenarios that are supported */
sdb->scens = NULL;
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -27,7 +27,7 @@ typedef enum {
 typedef struct Ssabdb {
char *dbname;/* database name */
char *path;  /* path to this database */
-   int locked;  /* whether this database is under maintenance 
*/
+   bool locked; /* whether this database is under maintenance 
*/
SABdbState state;/* current database state */
sablist* scens;  /* scenarios available for this database */
sablist* conns;  /* connections available for this database */
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -408,53 +408,110 @@ MT_init(void)
fc = fopen("/proc/self/cgroup", "r");
if (fc != NULL) {
char buf[1024];
+   /* each line is of the form:
+* hierarchy-ID:controller-list:cgroup-path
+*
+* For cgroup v1, the hierarchy-ID refers to the
+* second column in /proc/cgroups (which we ignore)
+* and the controller-list is a comma-separated list
+* of the controllers bound to the hierarchy.  We look
+* for the "memory" controller and use its
+* cgroup-path.  We ignore the other lines.
+*
+* For cgroup v2, the hierarchy-ID is 0 and the
+* controller-list is empty.  We just use the
+* cgroup-path.
+*
+* We use the first line that we can match (either v1
+* or v2) and for which we can open any of the files
+* that we are looking for.
+*/
while (fgets(buf, (int) sizeof(buf), fc) != NULL) {
+   char pth[1024];
char *p, *q;
-   p = strchr(buf, ':');
-   if (p == NULL)
-   break;
-   q = p + 1;
-   p = strchr(q, ':');
+   bool success = false; /* true if we can open any file */
+   FILE *f;
+   uint64_t mem;
+   size_t l;
+
+   p = strchr(buf, '\n');
if (p == NULL)
break;
-   *p++ = 0;
-   if (strstr(q, "memory") != NULL) {
-   char pth[1024];
-   FILE *f;
-   size_t l;
-   q = strchr(p, '\n');
-   if (q == NULL)
+   *p = 0;
+   if (strncmp(buf, "0::", 3) == 0) {
+   /* cgroup v2 entry */
+   l = strconcat_len(pth, sizeof(pth),
+ "/sys/fs/cgroup",
+ buf + 3, "/", NULL);
+   /* hard limit */
+   strcpy(pth + l, "memory.max");
+   f = fopen(pth, "r");
+   if (f != NULL) {
+   if (fscanf(f, "%" SCNu64, ) == 1 && 
mem < (uint64_t) _MT_pagesize * _MT_npages) {
+   _MT_npages = (size_t) (mem / 
_MT_pagesize);
+   }
+   success = 

MonetDB: default - Merge with Nov2019 branch.

2019-11-13 Thread Sjoerd Mullender
Changeset: 913055453096 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=913055453096
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_optimizer.c
sql/server/rel_unnest.c
sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.stable.out
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (136 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
@@ -2231,7 +2231,7 @@ rel2bin_semijoin(backend *be, sql_rel *r
 *  first cheap join(s) (equality or idx) 
 *  second selects/filters 
 */
-   
+
 #if 0
if (rel->exps && rel->op == op_anti && need_no_nil(rel)) {
sql_subtype *lng = sql_bind_localtype("lng");
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -5268,7 +5268,7 @@ rel_find_joins(mvc *sql, sql_rel *parent
case op_full:
case op_semi:
case op_anti: {
-   found_join *fl = MNEW(found_join);
+   found_join *fl = SA_NEW(sql->sa, found_join);
fl->p = parent;
fl->j = rel;
list_append(l, fl);
@@ -5308,43 +5308,41 @@ rel_find_joins(mvc *sql, sql_rel *parent
 static sql_rel *
 rel_merge_identical_joins(int *changes, mvc *sql, sql_rel *rel) 
 {
-   if (is_joinop(rel->op)) {
+   if (is_joinop(rel->op) && rel->l && rel->r) {
list *l1 = sa_list(sql->sa), *l2 = sa_list(sql->sa);
 
-   if (rel->l && rel->r) {
-   rel_find_joins(sql, rel, rel->l, l1);
-   rel_find_joins(sql, rel, rel->r, l2);
-
-   if (list_length(l1) && list_length(l2)) { /* found 
joins on both */
-   for (node *n1 = l1->h ; n1; n1 = n1->next) {
-   found_join *f1 = (found_join*) n1->data;
-   for (node *n2 = l2->h ; n2; n2 = 
n2->next) {
-   found_join *f2 = (found_join*) 
n2->data;
-   sql_rel *j1 = f1->j, *j2 = 
f2->j, *j1_l = j1->l, *j1_r = j1->r, *j2_l = j2->l, *j2_r = j2->r;
-   bool sides_equal = false;
-
-   if (j1 != j2) {
-   const char *j1_ln = 
rel_name(j1_l), *j1_rn = rel_name(j1_r), *j2_ln = rel_name(j2_l), *j2_rn = 
rel_name(j2_r);
-
-   /* So far it looks on 
identical relations and common basetable relations */
-   if ((j1_l == j2_l || 
(is_basetable(j1_l->op) && is_basetable(j2_l->op) && strcmp(j1_ln, j2_ln) == 0 
&& j1_l->l == j2_l->l)) && 
-   (j1_r == j2_r 
|| (is_basetable(j1_r->op) && is_basetable(j2_r->op) && strcmp(j1_rn, j2_rn) == 
0 && j1_r->l == j2_r->l)))
-   sides_equal = 
true;
-   else if ((j1_l == j2_r 
|| (is_basetable(j1_l->op) && is_basetable(j2_r->op) && strcmp(j1_ln, j2_rn) == 
0 && j1_l->l == j2_r->l)) && 
-   (j1_r == j2_l 
|| (is_basetable(j1_r->op) && is_basetable(j2_l->op) && strcmp(j1_rn, j2_ln) == 
0 && j1_r->l == j2_l->l)))
-   sides_equal = 
true;
-
-   /* the left and right 
sides are equal */
-   if (sides_equal && 
exp_match_list(j1->exps, j2->exps)) {
-   sql_rel *p2 = 
f2->p;
-
-   if (p2->l == 
j2) /* replace j2's parent join with j1 */
-   p2->l = 
rel_dup(j1);
-   else
-   p2->r = 
rel_dup(j1);
-   (*changes)++;
-   return rel;
-   }
+   rel_find_joins(sql, rel, rel->l, l1);
+   rel_find_joins(sql, rel, rel->r, l2);
+
+   if (list_length(l1) && list_length(l2)) { /* found joins on 
both */
+   for (node *n1 = l1->h ; n1; n1 = n1->next) {
+   found_join 

MonetDB: default - Merge with Nov2019

2019-11-12 Thread Pedro Ferreira
Changeset: 331a0848fcd1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=331a0848fcd1
Added Files:
sql/test/BugTracker-2019/Tests/isaUUID.Bug-6784.sql
sql/test/BugTracker-2019/Tests/isaUUID.Bug-6784.stable.err
sql/test/BugTracker-2019/Tests/isaUUID.Bug-6784.stable.out
Modified Files:
monetdb5/modules/atoms/uuid.c
sql/backends/monet5/rel_bin.c
sql/server/rel_schema.c
sql/test/BugTracker-2019/Tests/All
testing/exportutils.py
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 331 to 300 lines):

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
@@ -163,7 +163,7 @@ UUIDfromString(const char *svalue, size_
return (ssize_t) (s - svalue);
 
   bailout:
-   GDKerror("Syntax error in UUID.\n");
+   **retval = uuid_nil;
return -1;
 }
 
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
@@ -330,6 +330,27 @@ handle_in_exps(backend *be, sql_exp *ce,
s = stmt_uselect(be, 
stmt_const(be, bin_first_column(be, left), s), 
stmt_bool(be, 1), cmp_equal, sel, 0); 
+   } else if (list_length(nl) < 16) {
+   comp_type cmp = (in)?cmp_equal:cmp_notequal;
+
+   if (!in)
+   s = sel;
+   for( n = nl->h; n; n = n->next) {
+   sql_exp *e = n->data;
+   stmt *i = exp_bin(be, use_r?e->r:e, left, right, grp, 
ext, cnt, NULL);
+   if(!i)
+   return NULL;
+
+   if (in) { 
+   i = stmt_uselect(be, c, i, cmp, sel, 0); 
+   if (s)
+   s = stmt_tunion(be, s, i); 
+   else
+   s = i;
+   } else {
+   s = stmt_uselect(be, c, i, cmp, s, 0); 
+   }
+   }
} else {
// TODO: handle_in_exps should contain all necessary logic for 
in-expressions to be SQL compliant.
// For non-SQL-standard compliant behavior, e.g. PostgreSQL 
backwards compatibility, we should
@@ -379,7 +400,6 @@ handle_in_exps(backend *be, sql_exp *ce,
s = stmt_result(be, s, 0);
}
}
-
return s;
 }
 
diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -1484,11 +1484,9 @@ sql_alter_table(sql_query *query, dlist 
return rel_psm_block(sql->sa, new_exp_list(sql->sa));
return sql_error(sql, 02, SQLSTATE(42S02) "ALTER TABLE: no such 
table '%s' in schema '%s'", tname, s->base.name);
} else {
-   int i;
-   node *n;
sql_rel *res = NULL, *r;
sql_table *nt = NULL;
-   sql_exp ** updates, *e;
+   sql_exp **updates, *e;
 
assert(te);
if (t->persistence != SQL_DECLARED_TABLE)
@@ -1604,21 +1602,17 @@ sql_alter_table(sql_query *query, dlist 
if (!isTable(nt))
return res;
 
-   /* new columns need update with default values */
-   updates = SA_ZNEW_ARRAY(sql->sa, sql_exp*, 
list_length(nt->columns.set));
-   for (n = nt->columns.set->h, i = 0; n; n = n->next, i++) {
-   sql_column *c = n->data;
-   c->colnr = i;
-   }
+   /* New columns need update with default values. Add one more 
element for new column */
+   updates = SA_ZNEW_ARRAY(sql->sa, sql_exp*, 
(list_length(nt->columns.set) + 1));
e = exp_column(sql->sa, nt->base.name, TID, 
sql_bind_localtype("oid"), CARD_MULTI, 0, 1);
r = rel_project(sql->sa, res, append(new_exp_list(sql->sa),e));
if (nt->columns.nelm) {
list *cols = new_exp_list(sql->sa);
-   for (n = nt->columns.nelm; n; n = n->next) {
+   for (node *n = nt->columns.nelm; n; n = n->next) {
sql_column *c = n->data;
if (c->def) {
char *d, *typestr = 
subtype2string2(>type);
-   if(!typestr)
+   if (!typestr)
return sql_error(sql, 02, 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
d = sql_message("select cast(%s as 
%s);", c->def, typestr);
 

MonetDB: default - Merge with Nov2019

2019-11-12 Thread Pedro Ferreira
Changeset: 25c5c509d9b6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25c5c509d9b6
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
clients/mapilib/mapi.c
gdk/gdk_batop.c
gdk/gdk_logger.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/algebra.mal
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/include/sql_mem.h
sql/rel.txt
sql/server/rel_exp.c
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_schema.c
sql/server/rel_unnest.c
sql/server/rel_updates.c
sql/server/rel_updates.h
sql/test/Triggers/Tests/All
sql/test/Triggers/trigger_action.sql
sql/test/mergetables/Tests/mergequery.stable.out
sql/test/miscellaneous/Tests/alter_table_add_column.sql
sql/test/miscellaneous/Tests/alter_table_add_column.stable.out
sql/test/remote/Tests/partition_elim.stable.out
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql

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

Merge with Nov2019


diffs (truncated from 1865 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
@@ -576,7 +576,9 @@ stdout of test 'MAL-signatures` in direc
 [ "algebra",   "rangejoin","command algebra.rangejoin(l:bat[:any_1], 
r1:bat[:any_1], r2:bat[:any_1], sl:bat[:oid], sr:bat[:oid], li:bit, hi:bit, 
estimate:lng) (X_0:bat[:oid], X_1:bat[:oid]) ",   "ALGrangejoin;",
"Range join: values in l and r1/r2 match if r1 <[=] l <[=] r2"  ]
 [ "algebra",   "reuse","command 
algebra.reuse(b:bat[:any_1]):bat[:any_1] ","ALGreuse;","Reuse a 
temporary BAT if you can. Otherwise,\n\tallocate enough storage to accept 
result of an\n \toperation (not involving the heap)" ]
 [ "algebra",   "select",   "command algebra.select(b:bat[:any_1], 
low:any_1, high:any_1, li:bit, hi:bit, anti:bit):bat[:oid] ","ALGselect1;", 
 "Select all head values for which the tail value is in range.\n\tInput is a 
dense-headed BAT, output is a dense-headed BAT with in\n\tthe tail the head 
value of the input BAT for which the tail value\n\tis between the values low 
and high (inclusive if li respectively\n\thi is set).  The output BAT is sorted 
on the tail value.  If low\n\tor high is nil, the boundary is not considered 
(effectively - and\n\t+ infinity).  If anti is set, the result is the 
complement.  Nil\n\tvalues in the tail are never matched, unless low=nil, 
high=nil,\n\tli=1, hi=1, anti=0.  All non-nil values are returned if 
low=nil,\n\thigh=nil, and li, hi are not both 1, or anti=1.\n\tNote that the 
output is suitable as second input for the other\n\tversion of this function."  
]
+[ "algebra",   "select",   "command algebra.select(b:bat[:any_1], 
low:any_1, high:any_1, li:bit, hi:bit, anti:bit, unknown:bit):bat[:oid] ",  
 "ALGselect1nil;",   "With unknow set, each nil != nil"  ]
 [ "algebra",   "select",   "command algebra.select(b:bat[:any_1], 
s:bat[:oid], low:any_1, high:any_1, li:bit, hi:bit, anti:bit):bat[:oid] ",  
 "ALGselect2;",  "Select all head values of the first input BAT for which the 
tail value\n\tis in range and for which the head value occurs in the tail of 
the\n\tsecond input BAT.\n\tThe first input is a dense-headed BAT, the second 
input is a\n\tdense-headed BAT with sorted tail, output is a dense-headed 
BAT\n\twith in the tail the head value of the input BAT for which the\n\ttail 
value is between the values low and high (inclusive if li\n\trespectively hi is 
set).  The output BAT is sorted on the tail\n\tvalue.  If low or high is nil, 
the boundary is not considered\n\t(effectively - and + infinity).  If anti is 
set, the result is the\n\tcomplement.  Nil values in the tail are never 
matched, unless\n\tlow=nil, high=nil, li=1, hi=1, anti=0.  All non-nil values 
are\n\treturned if low=nil, high=nil, and li, hi are not both 1, or 
anti=1.\n\tNote that th
 e output is suitable as second input for this\n\tfunction."]
+[ "algebra",   "select",   "command algebra.select(b:bat[:any_1], 
s:bat[:oid], low:any_1, high:any_1, li:bit, hi:bit, anti:bit, 
unknown:bit):bat[:oid] ",  "ALGselect2nil;",   "With unknow set, each nil 
!= nil"  ]
 [ "algebra",   "selectNotNil", "command 
algebra.selectNotNil(b:bat[:any_2]):bat[:any_2] ", "ALGselectNotNil;", 
"Select all not-nil values" ]
 [ "algebra",   "semijoin", "command algebra.semijoin(l:bat[:any_1], 
r:bat[:any_1], sl:bat[:oid], sr:bat[:oid], nil_matches:bit, 

MonetDB: default - Merge with Nov2019 branch.

2019-11-07 Thread Sjoerd Mullender
Changeset: c2f23b27baf7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c2f23b27baf7
Modified Files:
gdk/gdk_bat.c
gdk/gdk_calc.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (23 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -682,7 +682,7 @@ COLcopy(BAT *b, int tt, bool writable, r
if (tt != bn->ttype) {
bn->ttype = tt;
bn->tvarsized = ATOMvarsized(tt);
-   bn->tseqbase = b->tseqbase;
+   bn->tseqbase = ATOMtype(tt) == TYPE_oid ? b->tseqbase : 
oid_nil;
}
} else {
/* check whether we need case (4); BUN-by-BUN copy (by
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -14219,6 +14219,7 @@ BATconvert(BAT *b, BAT *s, int tp, bool 
 
if (cnt == ncand && tp != TYPE_bit &&
ATOMbasetype(b->ttype) == ATOMbasetype(tp) &&
+   (tp != TYPE_oid || b->ttype == TYPE_oid) &&
(tp != TYPE_str ||
 BATatoms[b->ttype].atomToStr == BATatoms[TYPE_str].atomToStr)) {
return COLcopy(b, tp, false, TRANSIENT);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019

2019-11-07 Thread Pedro Ferreira
Changeset: 0422beaa0d11 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0422beaa0d11
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_hash.c
gdk/gdk_private.h
sql/NT/dump-restore.rst
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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 Nov2019


diffs (truncated from 183874 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
@@ -120,7 +120,6 @@ gdk_return BATextend(BAT *b, BUN newcap)
 void BATfakeCommit(BAT *b);
 gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, 
BUN n, bool asc, bool nilslast, bool distinct) 
__attribute__((__warn_unused_result__));
 restrict_t BATgetaccess(BAT *b);
-PROPrec *BATgetprop(BAT *b, enum prop_t idx);
 gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, 
BAT *g, BAT *e, BAT *h) __attribute__((__warn_unused_result__));
 const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid 
*maxp, BUN *ngrpp, struct canditer *ci, BUN *ncand);
 gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s, 
int tp, bool skip_nils, bool abort_on_error, int scale);
@@ -168,7 +167,6 @@ 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, bool li, bool hi, BUN estimate) 
__attribute__((__warn_unused_result__));
 gdk_return BATreplace(BAT *b, BAT *p, BAT *n, bool force) 
__attribute__((__warn_unused_result__));
-void BATrmprop(BAT *b, enum prop_t idx);
 gdk_return BATroles(BAT *b, const char *tnme);
 BAT *BATsample(BAT *b, BUN n);
 BAT *BATsample_with_seed(BAT *b, BUN n, unsigned seed);
@@ -178,7 +176,6 @@ gdk_return BATsemijoin(BAT **r1p, BAT **
 gdk_return BATsetaccess(BAT *b, restrict_t mode);
 void BATsetcapacity(BAT *b, BUN cnt);
 void BATsetcount(BAT *b, BUN cnt);
-void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v);
 BAT *BATslice(BAT *b, BUN low, BUN high);
 gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, 
BAT *g, bool reverse, bool nilslast, bool stable) 
__attribute__((__warn_unused_result__));
 gdk_return BATstr_group_concat(ValPtr res, BAT *b, BAT *s, bool skip_nils, 
bool abort_on_error, bool nil_if_empty, const char *separator);
@@ -332,7 +329,6 @@ ssize_t OIDtoStr(str *dst, size_t *len, 
 BUN ORDERfnd(BAT *b, const void *v);
 BUN ORDERfndfirst(BAT *b, const void *v);
 BUN ORDERfndlast(BAT *b, const void *v);
-void PROPdestroy(BAT *b);
 BUN SORTfnd(BAT *b, const void *v);
 BUN SORTfndfirst(BAT *b, const void *v);
 BUN SORTfndlast(BAT *b, const void *v);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2717,11 +2717,6 @@ enum prop_t {
GDK_HASH_MASK,  /* last used hash mask */
 };
 
-gdk_export void PROPdestroy(BAT *b);
-gdk_export PROPrec *BATgetprop(BAT *b, enum prop_t idx);
-gdk_export void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v);
-gdk_export void BATrmprop(BAT *b, enum prop_t idx);
-
 /*
  * @- BAT relational operators
  *
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1921,45 +1921,18 @@ PROPdestroy(BAT *b)
 }
 
 PROPrec *
-BATgetprop(BAT *b, enum prop_t idx)
+BATgetprop_nolock(BAT *b, enum prop_t idx)
 {
-   PROPrec *p = b->tprops;
+   PROPrec *p;
 
-   while (p) {
-   if (p->id == idx)
-   return p;
+   p = b->tprops;
+   while (p && p->id != idx)
p = p->next;
-   }
-   

MonetDB: default - Merge with Nov2019

2019-11-07 Thread Pedro Ferreira
Changeset: ae9ec61e9d7c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae9ec61e9d7c
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_partition.c
sql/server/rel_propagate.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/sql_partition.c

sql/test/BugTracker-2008/Tests/too_many_nested_operators.SF-2102167.stable.err
sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.err
sql/test/pg_regress/Tests/interval.stable.err
sql/test/pg_regress/Tests/interval.stable.err.int128
sql/test/pg_regress/Tests/interval.stable.out
sql/test/pg_regress/Tests/interval.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 593 to 300 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
@@ -453,7 +453,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
stmt *s = NULL;
 
if (THRhighwater())
-   return sql_error(be->mvc, 10, SQLSTATE(42000) "query too 
complex: running out of stack space");
+   return sql_error(be->mvc, 10, SQLSTATE(42000) "Query too 
complex: running out of stack space");
 
if (!e) {
assert(0);
@@ -1441,7 +1441,7 @@ exp2bin_args(backend *be, sql_exp *e, li
mvc *sql = be->mvc;
 
if (THRhighwater())
-   return sql_error(sql, 10, SQLSTATE(42000) "query too complex: 
running out of stack space");
+   return sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
 
if (!e)
return args;
@@ -1519,7 +1519,7 @@ static list *
 rel2bin_args(backend *be, sql_rel *rel, list *args)
 {
if (THRhighwater())
-   return sql_error(be->mvc, 10, SQLSTATE(42000) "query too 
complex: running out of stack space");
+   return sql_error(be->mvc, 10, SQLSTATE(42000) "Query too 
complex: running out of stack space");
 
if (!rel)
return args;
@@ -3220,7 +3220,7 @@ sql_parse(backend *be, sql_allocator *sa
bstream * bst;
 
if (THRhighwater())
-   return sql_error(m, 10, SQLSTATE(42000) "SELECT: too many 
nested operators");
+   return sql_error(m, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
 
o = MNEW(mvc);
if (!o)
@@ -5593,7 +5593,7 @@ subrel_bin(backend *be, sql_rel *rel, li
stmt *s = NULL;
 
if (THRhighwater())
-   return sql_error(be->mvc, 10, SQLSTATE(42000) "query too 
complex: running out of stack space");;
+   return sql_error(be->mvc, 10, SQLSTATE(42000) "Query too 
complex: running out of stack space");;
 
if (!rel)
return s;
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -2217,7 +2217,7 @@ static int
 exp_set_list_recurse(mvc *sql, sql_subtype *type, sql_exp *e, const char 
**relname, const char** expname)
 {
if (THRhighwater()) {
-   (void) sql_error(sql, 10, SQLSTATE(42000) "query too complex: 
running out of stack space");
+   (void) sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
return -1;
}
assert(*relname && *expname);
@@ -2243,7 +2243,7 @@ static int
 exp_set_type_recurse(mvc *sql, sql_subtype *type, sql_exp *e, const char 
**relname, const char** expname)
 {
if (THRhighwater()) {
-   (void) sql_error(sql, 10, SQLSTATE(42000) "query too complex: 
running out of stack space");
+   (void) sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
return -1;
}
assert(*relname && *expname);
@@ -2333,7 +2333,7 @@ int
 rel_set_type_recurse(mvc *sql, sql_subtype *type, sql_rel *rel, const char 
**relname, const char **expname)
 {
if (THRhighwater()) {
-   (void) sql_error(sql, 10, SQLSTATE(42000) "query too complex: 
running out of stack space");
+   (void) sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
return -1;
}
assert(*relname && *expname);
diff --git a/sql/server/rel_partition.c b/sql/server/rel_partition.c
--- a/sql/server/rel_partition.c
+++ b/sql/server/rel_partition.c
@@ -45,7 +45,7 @@ static void
 find_basetables(mvc *sql, sql_rel *rel, list *tables )
 {
if (THRhighwater()) {
-   (void) sql_error(sql, 10, SQLSTATE(42000) "query too complex: 
running out of stack space");
+   (void) sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
return;
}
 
@@ -143,7 +143,7 

MonetDB: default - Merge with Nov2019

2019-11-06 Thread Pedro Ferreira
Changeset: fb7cafba74ea for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb7cafba74ea
Added Files:
sql/test/BugTracker-2019/Tests/avg-changes-value-scale.Bug-6783.sql

sql/test/BugTracker-2019/Tests/avg-changes-value-scale.Bug-6783.stable.err

sql/test/BugTracker-2019/Tests/avg-changes-value-scale.Bug-6783.stable.out
Modified Files:
.hgignore
NT/rules.msc
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/codegen.py
buildtools/autogen/autogen/filesplit.py
buildtools/autogen/autogen/msc.py
buildtools/conf/rules.mk
configure.ag
monetdb5/modules/atoms/strptime.c
sql/backends/monet5/sql_statement.c
sql/common/sql_types.c
sql/server/rel_dump.c
sql/test/BugTracker-2019/Tests/All
sql/test/Tests/truncate-statements-extra.sql
sql/test/Tests/truncate-statements-extra.stable.out
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/sys-schema/Tests/systemfunctions.stable.out
sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 741 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -49,7 +49,6 @@ sql/backends/monet5/UDF/capi/cheader.tex
 .#*
 
 # files generated by compilers
-lex.yy.c
 *.tab.c
 *.tab.h
 .libs
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -186,8 +186,7 @@ libpy3_CFLAGS = -DHAVE_LIBPY3 "-I$(PYTHO
 # PYTHON may be either a version 2 or a version 3
 # here we let %Path% determine which version we get
 PYTHON = python
-YACC = bison
-LEX = flex
+BISON = bison
 
 ARCHIVER = lib /nologo
 GENDLL =
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
@@ -19,7 +19,7 @@ from filesplit import split_filename, rs
 # buildtools/conf.  The generated sources should therefore be included
 # in the tar ball and not be removed with `make distclean' when
 # running "in" said tar ball.
-buildtools_ext = ['brg', 'l', 'pm.i', 'syms', 't', 'y']
+buildtools_ext = ['syms', 'y']
 
 am_assign = "+="
 
@@ -150,6 +150,8 @@ def am_find_srcs(target, deps, am, cond)
 am['CLEAN'].append(pf)
 b, ext = split_filename(pf)
 if ext in automake_ext:
+if ext in ['tab.c', 'tab.h']:
+dist = True
 return dist, pf
 return dist, ""
 
@@ -563,7 +565,7 @@ def am_binary(fd, var, binmap, am):
 if ext in scripts_ext:
 if target not in SCRIPTS:
 SCRIPTS.append(target)
-elif ext in ('o', 'glue.o', 'tab.o', 'yy.o'):
+elif ext in ('o', 'tab.o'):
 dist, src = am_find_srcs(target, binmap['DEPS'], am, cond)
 if src in binmap['SOURCES']:
 dist = True
diff --git a/buildtools/autogen/autogen/codegen.py 
b/buildtools/autogen/autogen/codegen.py
--- a/buildtools/autogen/autogen/codegen.py
+++ b/buildtools/autogen/autogen/codegen.py
@@ -21,25 +21,15 @@ from filesplit import split_filename
 # direct rules
 code_gen = {'y':[ '.tab.c', '.tab.h' ],
 'tab.c':[ '.tab.o' ],
-'l':[ '.yy.c', '.yy.h' ],
-'yy.c': [ '.yy.o' ],
 'mt':   [ '.symbols.h', '.c' ],
-'brg':  [ '.c' ],
 't':[ '.c' ],
 'c':[ '.o' ],
-'cpp':  [ '.o' ],
-#'java': [ '.class' ],
-#'tex':  [ '.html', '.dvi', '.pdf' ],
-#'dvi':  [ '.ps' ],
-#'fig':  [ '.eps' ],
-#'feps': [ '.eps' ],
 'in':   [ '' ],
 '1.in': [ '.1' ],  # TODO: add more manpage sections as needed
 'cfg.in':   [ '.cfg' ],
 'java.in':  [ '.java' ],
 'mal.in':   [ '.mal' ],
 'py.in':[ '.py' ],
-'pl.in':[ '.pl' ],
 'bat.in':   [ '.bat' ],
 'mt.sed':   [ '.mt' ],
 'c.sed':[ '.c' ],
@@ -69,15 +59,8 @@ t_inc = re.compile(t_inc, re.MULTILINE)
 
 scan_map = {
 'c': [ c_inc, None, '' ],
-'cpp': [ c_inc, None, '' ],
 'h': [ c_inc, None, '' ],
 'y': [ c_inc, None, '' ],
-'l': [ c_inc, None, '' ],
-'mt': [ c_inc, None, '' ],
-'brg': [ c_inc, None, '' ],
-'t': [ t_inc, None, '' ],
-'xsl': [ xsl_inc, None, '' ],
-'tex': [ tex_inc, None, '' ],
 }
 
 def readfile(f):
diff --git a/buildtools/autogen/autogen/filesplit.py 
b/buildtools/autogen/autogen/filesplit.py
--- a/buildtools/autogen/autogen/filesplit.py
+++ b/buildtools/autogen/autogen/filesplit.py
@@ -13,7 +13,7 @@ def rsplit_filename(f):
 return f[:s], f[s+1:]
 return base, ext
 
-automake_ext = 

MonetDB: default - Merge with Nov2019

2019-11-05 Thread Pedro Ferreira
Changeset: d094ee4b76b7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d094ee4b76b7
Added Files:
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.err
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.stable.out
Modified Files:
sql/backends/monet5/rel_bin.c
sql/include/sql_catalog.h
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 346 to 300 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
@@ -3688,7 +3688,7 @@ rel2bin_insert(backend *be, sql_rel *rel
}
 
 /* before */
-   if(be->cur_append && !be->first_statement_generated) {
+   if (be->cur_append && !be->first_statement_generated) {
for(sql_table *up = t->p ; up ; up = up->p) {
if (!sql_insert_triggers(be, up, updates, 0))
return sql_error(sql, 02, SQLSTATE(27000) 
"INSERT INTO: triggers failed for table '%s'", up->base.name);
@@ -3702,8 +3702,9 @@ rel2bin_insert(backend *be, sql_rel *rel
stmt *is = m->data;
sql_idx *i = n->data;
 
-   if ((hash_index(i->type) && list_length(i->columns) <= 1) ||
-   i->type == no_idx)
+   if (non_updatable_index(i->type)) /* Some indexes don't hold 
delta structures */
+   continue;
+   if (hash_index(i->type) && list_length(i->columns) <= 1)
is = NULL;
if (i->key && constraint) {
stmt *ckeys = sql_insert_key(be, inserts->op4.lval, 
i->key, is, pin);
@@ -3728,7 +3729,7 @@ rel2bin_insert(backend *be, sql_rel *rel
if (!insert)
return NULL;
 
-   if(be->cur_append && !be->first_statement_generated) {
+   if (be->cur_append && !be->first_statement_generated) {
for(sql_table *up = t->p ; up ; up = up->p) {
if (!sql_insert_triggers(be, up, updates, 1))
return sql_error(sql, 02, SQLSTATE(27000) 
"INSERT INTO: triggers failed for table '%s'", up->base.name);
@@ -3748,7 +3749,7 @@ rel2bin_insert(backend *be, sql_rel *rel
ret = s;
}
 
-   if(be->cur_append) //building the total number of rows affected across 
all tables
+   if (be->cur_append) //building the total number of rows affected across 
all tables
ret->nr = add_to_merge_partitions_accumulator(be, ret->nr);
 
if (ddl)
@@ -4553,7 +4554,6 @@ sql_update_triggers(backend *be, sql_tab
return res;
 }
 
-
 static void
 sql_update_check_null(backend *be, sql_table *t, stmt **updates)
 {
@@ -4603,7 +4603,7 @@ sql_update(backend *be, sql_table *t, st
}
 
 /* before */
-   if(be->cur_append && !be->first_statement_generated) {
+   if (be->cur_append && !be->first_statement_generated) {
for(sql_table *up = t->p ; up ; up = up->p) {
if (!sql_update_triggers(be, up, rows, updates, 0))
return sql_error(sql, 02, SQLSTATE(27000) 
"UPDATE: triggers failed for table '%s'", up->base.name);
@@ -4623,7 +4623,7 @@ sql_update(backend *be, sql_table *t, st
return sql_error(sql, 02, SQLSTATE(42000) "UPDATE: cascade 
failed for table '%s'", t->base.name);
 
 /* after */
-   if(be->cur_append && !be->first_statement_generated) {
+   if (be->cur_append && !be->first_statement_generated) {
for(sql_table *up = t->p ; up ; up = up->p) {
if (!sql_update_triggers(be, up, rows, updates, 1))
return sql_error(sql, 02, SQLSTATE(27000) 
"UPDATE: triggers failed for table '%s'", up->base.name);
@@ -4695,13 +4695,16 @@ rel2bin_update(backend *be, sql_rel *rel
for (m = rel->exps->h; m; m = m->next) {
sql_exp *ce = m->data;
sql_idx *i = find_sql_idx(t, exp_name(ce)+1);
+   stmt *update_idx, *is = NULL;
 
if (i) {
-   stmt *update_idx = bin_find_column(be, update, ce->l, 
ce->r), *is = NULL;
-
+   if (non_updatable_index(i->type)) /* Some indexes don't 
hold delta structures */
+   continue;
+
+   update_idx = bin_find_column(be, update, ce->l, ce->r);
if (update_idx)
is = update_idx;
-   if ((hash_index(i->type) && list_length(i->columns) <= 
1) || i->type == no_idx) {
+   if (hash_index(i->type) && list_length(i->columns) <= 
1) {
is = NULL;
update_idx = NULL;
}
@@ -4713,7 +4716,7 @@ 

MonetDB: default - Merge with Nov2019 branch.

2019-11-05 Thread Sjoerd Mullender
Changeset: 043642d1d5ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=043642d1d5ba
Added Files:
sql/jdbc/tests/Tests/Bug_IsValid_Timeout_Bug_6782.SQL.bat
sql/jdbc/tests/Tests/Bug_IsValid_Timeout_Bug_6782.SQL.sh
sql/jdbc/tests/Tests/Bug_IsValid_Timeout_Bug_6782.stable.err
sql/jdbc/tests/Tests/Bug_IsValid_Timeout_Bug_6782.stable.out
Modified Files:
clients/mapiclient/tomograph.c
gdk/gdk.h
monetdb5/mal/mal_profiler.c
monetdb5/modules/mal/clients.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/jdbc/tests/Tests/All
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.sql
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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
tools/merovingian/daemon/controlrunner.c
tools/merovingian/utils/control.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 706 to 300 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1688,7 +1688,7 @@ main(int argc, char **argv)
break;
if( *optarg == '=')
optarg++;
-   cnt = sscanf(optarg,"%"PRId64"-%"PRId64, 
,);
+   cnt = sscanf(optarg,"%"SCNd64"-%"SCNd64, 
,);
if( cnt != 2)
usageTomograph();

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -509,6 +509,8 @@ typedef char *str;
 #define LL_CONSTANT(val)   INT64_C(val)
 #define LLFMT  "%" PRId64
 #define ULLFMT "%" PRIu64
+#define LLSCN  "%" SCNd64
+#define ULLSCN "%" SCNu64
 
 typedef oid var_t; /* type used for heap index of var-sized BAT */
 #define SIZEOF_VAR_T   SIZEOF_OID
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -445,7 +445,7 @@ getCPULoad(char cpuload[BUFSIZ]){
break;
 
while( *s && isspace((unsigned char)*s)) s++;
-   i= sscanf(s,LLFMT" "LLFMT" "LLFMT" "LLFMT" "LLFMT,  
, , , , );
+   i= sscanf(s,LLSCN" "LLSCN" "LLSCN" "LLSCN" "LLSCN,  
, , , , );
if ( i != 5 )
goto skip;
newload = (user - corestat[cpu].user + nice - 
corestat[cpu].nice + system - corestat[cpu].system);
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -481,6 +481,9 @@ CLTsetPrintTimeout(void *ret, int *secs)
 str CLTmd5sum(str *ret, str *pw) {
 #ifdef HAVE_MD5_UPDATE
char *mret = mcrypt_MD5Sum(*pw, strlen(*pw));
+
+   if (!mret)
+   throw(MAL, "clients.md5sum", SQLSTATE(HY001) MAL_MALLOC_FAIL);
*ret = GDKstrdup(mret);
free(mret);
if(*ret == NULL)
@@ -496,6 +499,9 @@ str CLTmd5sum(str *ret, str *pw) {
 str CLTsha1sum(str *ret, str *pw) {
 #ifdef HAVE_SHA1_UPDATE
char *mret = mcrypt_SHA1Sum(*pw, strlen(*pw));
+
+   if (!mret)
+   throw(MAL, "clients.sha1sum", SQLSTATE(HY001) MAL_MALLOC_FAIL);
*ret = GDKstrdup(mret);
free(mret);
if(*ret == NULL)
@@ -511,6 +517,9 @@ str CLTsha1sum(str *ret, str *pw) {
 str CLTripemd160sum(str *ret, str *pw) {
 #ifdef HAVE_RIPEMD160_UPDATE
char *mret = mcrypt_RIPEMD160Sum(*pw, strlen(*pw));
+
+   if (!mret)
+   throw(MAL, 

MonetDB: default - Merge with Nov2019 branch.

2019-11-05 Thread Sjoerd Mullender
Changeset: 3890859a2c56 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3890859a2c56
Modified Files:
NT/Makefile
gdk/gdk_select.c
monetdb5/modules/mal/clients.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (178 lines):

diff --git a/NT/Makefile b/NT/Makefile
--- a/NT/Makefile
+++ b/NT/Makefile
@@ -25,6 +25,8 @@ all: _all
 install: targetdirs all
$(MAKE) /nologo /f "$(srcdir)\Makefile.msc" "prefix=$(prefix)" 
"bits=$(bits)" install
$(INSTALL) .monetdb "$(sysconfdir)"
+
+makewxs:
$(PYTHON) $(NT)\mksqlwxs.py $(VERSION) "$(MAKE_INCLUDEFILE)" 
"$(prefix)" > "$(prefix)\MonetDB5-SQL-Installer.wxs"
$(PYTHON) $(NT)\mkodbcwxs.py $(VERSION) "$(MAKE_INCLUDEFILE)" 
"$(prefix)" > "$(prefix)\MonetDB-ODBC-Installer.wxs"
 
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -971,7 +971,8 @@ ilog2(BUN x)
  * v1  v2  truefalse   truex < v1 or x >= v2
  * v1  v2  false   truetruex <= v1 or x > v2
  * v1  v2  truetruetruex < v1 or x > v2
- * v2  v1  ignored ignored ignored NOTHING
+ * v2  v1  ignored ignored false   NOTHING
+ * v2  v1  ignored ignored truex != nil
  */
 BAT *
 BATselect(BAT *b, BAT *s, const void *tl, const void *th,
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -87,42 +87,39 @@ CLTsetScenario(Client cntxt, MalBlkPtr m
return msg;
 }
 
-static char *
-local_itoa(int i)
+static char*
+CLTtimeConvert(time_t l, char *s, size_t len)
 {
-   static char buf[32];
-
-   sprintf(buf, "%d", i);
-   return buf;
-}
+   char *converted = NULL;
+   struct tm localt;
 
-static void
-CLTtimeConvert(time_t l, char *s){
-   struct tm localt;
-
+   (void) len;
 #ifdef HAVE_LOCALTIME_R
-   (void) localtime_r(, );
+   (void) localtime_r(, );
 #else
-   /* race condition: return value could be
-* overwritten in parallel thread before
-* assignment complete */
-   localt = *localtime();
+   /* race condition: return value could be
+* overwritten in parallel thread before
+* assignment complete */
+   localt = *localtime();
 #endif
 
 #ifdef HAVE_ASCTIME_R3
-   asctime_r(, s, 26);
+   converted = asctime_r(, s, 26);
 #else
 #ifdef HAVE_ASCTIME_R
-   asctime_r(, s);
+   converted = asctime_r(, s);
 #else
-   /* race condition: return value could be
-* overwritten in parallel thread before copy
-* complete, however on Windows, asctime is
-* thread-safe */
-   strncpy(s, asctime(), 26);
+   /* race condition: return value could be
+* overwritten in parallel thread before copy
+* complete, however on Windows, asctime is
+* thread-safe */
+   converted = asctime();
+   if (!converted || strlen(converted) > (len - 1))
+   return NULL;
+   strcpy(s, converted);
 #endif
 #endif
-   s[24] = 0;
+   return converted;
 }
 
 str
@@ -132,7 +129,7 @@ CLTInfo(Client cntxt, MalBlkPtr mb, MalS
bat *ret2=  getArgReference_bat(stk,pci,0);
BAT *b = COLnew(0, TYPE_str, 12, TRANSIENT);
BAT *bn = COLnew(0, TYPE_str, 12, TRANSIENT);
-   char s[26];
+   char buf[32]; /* 32 bytes are enough */
 
(void) mb;
if (b == 0 || bn == 0){
@@ -141,29 +138,36 @@ CLTInfo(Client cntxt, MalBlkPtr mb, MalS
throw(MAL, "clients.info", SQLSTATE(HY001) MAL_MALLOC_FAIL);
}
 
+   (void) sprintf(buf, ""LLFMT"", (lng) cntxt->user);
if (BUNappend(b, "user", false) != GDK_SUCCEED ||
-   BUNappend(bn, local_itoa((int)cntxt->user), false) != 
GDK_SUCCEED ||
-
-   BUNappend(b, "scenario", false) != GDK_SUCCEED ||
-   BUNappend(bn, cntxt->scenario, false) != GDK_SUCCEED ||
+   BUNappend(bn, buf, false) != GDK_SUCCEED)
+   goto bailout;
 
-   BUNappend(b, "listing", false) != GDK_SUCCEED ||
-   BUNappend(bn, local_itoa(cntxt->listing), false) != GDK_SUCCEED 
||
-
-   BUNappend(b, "debug", false) != GDK_SUCCEED ||
-   BUNappend(bn, local_itoa(cntxt->debug), false) != GDK_SUCCEED)
+   if (BUNappend(b, "scenario", false) != GDK_SUCCEED ||
+   BUNappend(bn, cntxt->scenario, false) != GDK_SUCCEED)
goto bailout;
 
-   CLTtimeConvert(cntxt->login, s);
+   (void) sprintf(buf, "%d", cntxt->listing);
+   if (BUNappend(b, "listing", false) != GDK_SUCCEED ||
+   BUNappend(bn, buf, false) != 

MonetDB: default - Merge with Nov2019

2019-11-04 Thread Pedro Ferreira
Changeset: 2e8a54c6fce0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2e8a54c6fce0
Added Files:
sql/test/BugTracker-2019/Tests/index-insert-crash.Bug-6781.sql
Removed Files:
clients/mapiclient/mnc.c
sql/test/datacell/Tests/All
sql/test/datacell/Tests/crashonundefined.sql
sql/test/datacell/Tests/crashonundefined.stable.err
sql/test/datacell/Tests/crashonundefined.stable.out
sql/test/datacell/Tests/garbagecollect.sql
sql/test/datacell/Tests/garbagecollect.stable.err
sql/test/datacell/Tests/garbagecollect.stable.out
sql/test/datacell/Tests/select.sql
sql/test/datacell/Tests/select.stable.err
sql/test/datacell/Tests/select.stable.out
sql/test/datacell/Tests/topbasket.sql
sql/test/datacell/Tests/topbasket.stable.err
sql/test/datacell/Tests/topbasket.stable.out
Modified Files:
NT/mkodbcwxs.py
NT/mksqlwxs.py
clients/Tests/MAL-signatures.stable.out.int128
clients/mapiclient/Makefile.ag
gdk/gdk_bbp.c
monetdb5/modules/atoms/00_json_hge.mal
sql/ChangeLog.Nov2019
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_upgrades.c
sql/common/sql_types.c
sql/scripts/40_json.sql
sql/test/BugTracker-2019/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/sql_xml/Tests/funcs.sql
sql/test/sys-schema/Tests/systemfunctions.stable.out
sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1320 to 300 lines):

diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -55,16 +55,13 @@ def main():
 print(r'')
 print(r'')
 print(r'')
-if vs in ('17', '19'):
-msvc = r'C:\Program Files (x86)\Microsoft Visual 
Studio\20%s\Community\VC\Redist\MSVC' % vs
-d = sorted(os.listdir(msvc))[-1]
-msm = '_CRT_%s.msm' % arch
-for f in sorted(os.listdir(os.path.join(msvc, d, 'MergeModules'))):
-if msm in f:
-fn = f
-print(r'  ' % (msvc, d, fn))
-else:
-print(r'  ' % (vs, arch))
+msvc = r'C:\Program Files (x86)\Microsoft Visual 
Studio\20%s\Community\VC\Redist\MSVC' % vs
+d = sorted(os.listdir(msvc))[-1]
+msm = '_CRT_%s.msm' % arch
+for f in sorted(os.listdir(os.path.join(msvc, d, 'MergeModules'))):
+if msm in f:
+fn = f
+print(r'  ' % (msvc, d, fn))
 print(r'  ' % folder)
 print(r'')
 print(r'  ')
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -114,16 +114,13 @@ def main():
 print(r'')
 print(r'')
 print(r'')
-if vs in ('17', '19'):
-msvc = r'C:\Program Files (x86)\Microsoft Visual 
Studio\20%s\Community\VC\Redist\MSVC' % vs
-d = sorted(os.listdir(msvc))[-1]
-msm = '_CRT_%s.msm' % arch
-for f in sorted(os.listdir(os.path.join(msvc, d, 'MergeModules'))):
-if msm in f:
-fn = f
-print(r'  ' % (msvc, d, fn))
-else:
-print(r'  ' % (vs, arch))
+msvc = r'C:\Program Files (x86)\Microsoft Visual 
Studio\20%s\Community\VC\Redist\MSVC' % vs
+d = sorted(os.listdir(msvc))[-1]
+msm = '_CRT_%s.msm' % arch
+for f in sorted(os.listdir(os.path.join(msvc, d, 'MergeModules'))):
+if msm in f:
+fn = f
+print(r'  ' % (msvc, d, fn))
 print(r'  ' % folder)
 print(r'')
 print(r'  ')
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -15544,8 +15544,6 @@ stdout of test 'MAL-signatures` in direc
 [ "io","setmallocsuccesscount","command 
io.setmallocsuccesscount(count:lng):void ","IOsetmallocsuccesscount;", 
"Set number of mallocs that are allowed to succeed."]
 [ "io","stdin","pattern io.stdin():bstream ",  "io_stdin;",
"return the input stream to the database client"]
 [ "io","stdout",   "pattern io.stdout():streams ", "io_stdout;",   
"return the output stream for the database client"  ]
-[ "iterator",  "filter",   "command iterator.filter(name:json, idx:hge, 
other:str):json ", "JSONfilterArrayDefault_hge;",  ""  ]
-[ "iterator",  "filter",   "command iterator.filter(name:json, 
idx:hge):json ","JSONfilterArray_hge;", ""  ]
 [ "iterator",  "new",  "pattern iterator.new(b:bat[:any_2]) (h:oid, t:any_2) 
","ITRbunIterator;",  "Process the buns one by one extracted from a 
void table."  ]
 

MonetDB: default - Merge with Nov2019

2019-11-01 Thread Pedro Ferreira
Changeset: 058cc058ecd4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=058cc058ecd4
Modified Files:
gdk/gdk_analytic_bounds.c
gdk/gdk_analytic_func.c
monetdb5/modules/atoms/mtime_analytic.c
sql/backends/monet5/sql.mal
sql/server/rel_exp.c
sql/server/rel_optimizer.c
sql/server/sql_scan.c
sql/test/BugTracker-2013/Tests/pivot.Bug-3339.stable.err

sql/test/BugTracker-2016/Tests/CREATE_INDEX_breaks_table_queries.Bug-4053.stable.out
sql/test/BugTracker/Tests/bug_in_selection.SF-1892413.stable.err
sql/test/BugTracker/Tests/bug_in_selection.SF-1892413.stable.out
sql/test/Tests/keys.sql
sql/test/Tests/keys.stable.out
sql/test/copy/Tests/nonutf8.stable.err
sql/test/miscellaneous/Tests/All
sql/test/miscellaneous/Tests/view-mul-digits.stable.out
sql/test/subquery/Tests/correlated.stable.err
testing/malcheck.py
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1171 to 300 lines):

diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -39,76 +39,144 @@
lng m = k - 1;  \
TPE1 v, calc;   \
TPE2 rlimit;\
-   for (; k < i; k++, rb++) {  \
-   rlimit = (TPE2) LIMIT;  \
-   v = bp[k];  \
-   if (is_##TPE1##_nil(v)) {   \
+   if (b->tnonil) {\
+   for (; k < i; k++, rb++) {  \
+   rlimit = (TPE2) LIMIT;  \
+   v = bp[k];  \
for (j = k; ; j--) {\
if (j == m) \
break;  \
-   if (!is_##TPE1##_nil(bp[j]))\
-   break;  \
-   }   \
-   } else {\
-   for (j = k; ; j--) {\
-   if (j == m) \
-   break;  \
-   if (is_##TPE1##_nil(bp[j])) \
-   break;  \
SUB_WITH_CHECK(v, bp[j], TPE1, calc, 
GDK_##TPE1##_max, goto calc_overflow); \
if ((TPE2)(ABSOLUTE(calc)) > rlimit) \
break;  \
}   \
-   }   \
-   j++;\
-   *rb = j;\
-   }   \
+   j++;
\
+   *rb = j;
\
+   }   
\
+   } else { \
+   for (; k < i; k++, rb++) {  
\
+   rlimit = (TPE2) LIMIT;  
\
+   v = bp[k];  
\
+   if (is_##TPE1##_nil(v)) {   
\
+   for (j = k; ; j--) {
\
+   if (j == m) 
\
+   break;  
\
+   if (!is_##TPE1##_nil(bp[j]))
\
+   break;  
\
+   }   
\
+   } else {
\
+   for (j = k; ; j--) {
\
+   if (j == m) 
\
+   break;  
\
+   if 

MonetDB: default - Merge with Nov2019

2019-10-31 Thread Pedro Ferreira
Changeset: 3bd6002e24a3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3bd6002e24a3
Removed Files:
sql/test/miscellaneous/README
sql/test/miscellaneous/Tests/now.sql
sql/test/miscellaneous/Tests/now.stable.err
Modified Files:
NT/monetdb_config.h.in
clients/mapiclient/mhelp.c
common/utils/mutils.c
configure.ag
gdk/gdk_posix.c
gdk/gdk_private.h
gdk/gdk_system.c
gdk/gdk_system.h
gdk/gdk_utils.c
monetdb5/mal/mal_module.c
monetdb5/modules/atoms/mtime.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/Makefile.ag
sql/server/rel_psm.c
sql/server/rel_schema.c
sql/server/sql_parser.y
sql/test/BugTracker-2012/Tests/create_function.Bug-3172.sql
sql/test/BugTracker-2012/Tests/create_function.Bug-3172.stable.err
sql/test/BugTracker-2012/Tests/create_function.Bug-3172.stable.out

sql/test/BugTracker-2012/Tests/table_function_with_column_subselects.Bug-3172.sql

sql/test/BugTracker-2012/Tests/table_function_with_column_subselects.Bug-3172.stable.err

sql/test/BugTracker-2019/Tests/disallow_duplicate_column_aliases.Bug-6723.stable.out
sql/test/BugTracker-2019/Tests/prepare-types.Bug-6724.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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-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/miscellaneous/Tests/All
sql/test/miscellaneous/Tests/select_groupby.sql
sql/test/miscellaneous/Tests/select_groupby.stable.err
sql/test/miscellaneous/Tests/select_groupby.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
testing/Mtest.py.in
tools/merovingian/daemon/merovingian.c
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1849 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
@@ -508,9 +508,6 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_STAT_H 1
 
-/* Define to 1 if you have the  header file. */
-/* #undef HAVE_SYS_SYSCTL_H */
-
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_SYS_TIMES_H */
 
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -87,7 +87,7 @@ SQLhelp sqlhelp1[] = {
{"ANALYZE",
 "Collect column/table/schema data statistics for analysis and 
optimizer usage",
 "ANALYZE ident [ . ident [ column_list ] ] [SAMPLE size] [MINMAX]",
-"column_list",
+"ident,column_list",
 "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/statistics"},
{"CALL",
 "",
@@ -163,10 +163,10 @@ SQLhelp sqlhelp1[] = {
 
"qname,param,data_type,function_return,statement,ident,language_keyword,external_code",
 "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"},
{"CREATE INDEX",
-"",
+"Create a hint for a secondary index on a column or set of columns of 
a table",
 "CREATE [ UNIQUE | ORDERED | IMPRINTS ] INDEX ident ON qname '(' 
ident_list ')'",
 NULL,
-NULL},
+"See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Indices"},
{"CREATE PROCEDURE",
 "Create a user-defined procedure",
 "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] 
} ')'\n"
@@ -203,12 +203,12 @@ SQLhelp sqlhelp1[] = {
 "ident",
 

MonetDB: default - Merge with Nov2019

2019-10-29 Thread Pedro Ferreira
Changeset: eac848448663 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eac848448663
Added Files:
sql/test/miscellaneous/Tests/select_groupby.sql
sql/test/miscellaneous/Tests/select_groupby.stable.err
sql/test/miscellaneous/Tests/select_groupby.stable.out
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/msqldump.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/server/rel_exp.c
sql/server/rel_optimizer.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_updates.c

sql/test/BugDay_2005-12-19_2.9.3/Tests/default_next_value_for_non_ex_seq.SF.1246631.stable.err
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
sql/test/Tests/comment-dump.stable.out
sql/test/miscellaneous/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 796 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
@@ -2575,8 +2575,7 @@ dump_database(Mapi mid, stream *toConsol
goto bailout;
 
/* start a transaction for the dump */
-   if (!describe)
-   mnstr_printf(toConsole, "%s;\n", start_trx);
+   mnstr_printf(toConsole, "%s;\n", start_trx);
 
if ((hdl = mapi_query(mid, start_trx)) == NULL || mapi_error(mid))
goto bailout;
@@ -3095,8 +3094,7 @@ dump_database(Mapi mid, stream *toConsol
mapi_close_handle(hdl);
 
/* finally commit the whole transaction */
-   if (!describe)
-   mnstr_printf(toConsole, "COMMIT;\n");
+   mnstr_printf(toConsole, "COMMIT;\n");
if (sname)
free(sname);
if (query)
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -226,11 +226,15 @@ main(int argc, char **argv)
dump_version(mid, out, "-- server:");
mnstr_printf(out, "-- %s\n", buf);
}
-   if (functions)
+   if (functions) {
+   mnstr_printf(out, "START TRANSACTION;\n");
c = dump_functions(mid, out, true, NULL, NULL, NULL);
-   else if (table)
+   mnstr_printf(out, "COMMIT;\n");
+   } else if (table) {
+   mnstr_printf(out, "START TRANSACTION;\n");
c = dump_table(mid, NULL, table, out, describe, true, 
useinserts, false);
-   else
+   mnstr_printf(out, "COMMIT;\n");
+   } else
c = dump_database(mid, out, describe, useinserts);
mnstr_flush(out);
 
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
@@ -645,7 +645,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
}
if (cond_execution) {
/* var_x = nil; */
-   nme = number2name(name, 16, ++sql->label);
+   nme = number2name(name, sizeof(name), ++sql->label);
(void)stmt_var(be, nme, exp_subtype(e), 1, 2);
/* if_barrier ... */
cond_execution = stmt_cond(be, cond_execution, NULL, 0, 
0);
@@ -1674,7 +1674,7 @@ rel2bin_table(backend *be, sql_rel *rel,
char name[16], *nme;
sql_rel *fr;
 
-   nme = number2name(name, 16, ++sql->remote);
+   nme = number2name(name, sizeof(name), ++sql->remote);
 
l = rel2bin_args(be, rel->l, sa_list(sql->sa));
if(!l)
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
@@ -311,18 +311,18 @@ create_table_or_view(mvc *sql, char* sna
list *id_l;
 
sql->sa = sa_create();
-   if(!sql->sa) {
+   if (!sql->sa) {
sql->sa = osa;
throw(SQL, "sql.catalog",SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
}
buf = sa_alloc(sql->sa, strlen(c->def) + 8);
-   if(!buf) {
+   if (!buf) {
sa_destroy(sql->sa);
sql->sa = osa;
throw(SQL, "sql.catalog",SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
}
typestr = subtype2string2(>type);
-   if(!typestr) {
+   if (!typestr) {
sa_destroy(sql->sa);
sql->sa = osa;
throw(SQL, 

MonetDB: default - Merge with Nov2019

2019-10-28 Thread Pedro Ferreira
Changeset: c381ac083667 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c381ac083667
Modified Files:
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/sql_upgrades.h
sql/scripts/99_system.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 389 to 300 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -507,8 +507,8 @@ SQLinit(Client c)
slash_2_dir_sep(path);
fullname = MSP_locate_sqlscript(path, 1);
if (fullname) {
-   str filename = fullname;
-   str p, n, newmsg= MAL_SUCCEED;
+   str filename = fullname, p, n;
+
fprintf(stdout, "# SQL catalog created, loading sql 
scripts once\n");
do {
stream *fd = NULL;
@@ -531,31 +531,40 @@ SQLinit(Client c)
sz = getFileSize(fd);
if (sz > (size_t) 1 << 29) {
close_stream(fd);
-   newmsg = createException(MAL, 
"createdb", SQLSTATE(42000) "File %s too large to process", filename);
+   msg = createException(MAL, 
"createdb", SQLSTATE(42000) "File %s too large to process", filename);
} else {
bstream *bfd = NULL;
 
-   if((bfd = bstream_create(fd, sz 
== 0 ? (size_t) (128 * BLOCK) : sz)) == NULL) {
+   if ((bfd = bstream_create(fd, 
sz == 0 ? (size_t) (128 * BLOCK) : sz)) == NULL) {
close_stream(fd);
-   newmsg = 
createException(MAL, "createdb", SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   msg = 
createException(MAL, "createdb", SQLSTATE(HY001) MAL_MALLOC_FAIL);
} else {
if (bstream_next(bfd) 
>= 0)
-   newmsg = 
SQLstatementIntern(c, >buf, "sql.init", TRUE, FALSE, NULL);
+   msg = 
SQLstatementIntern(c, >buf, "sql.init", TRUE, FALSE, NULL);
bstream_destroy(bfd);
}
}
-   if (m->sa)
-   sa_destroy(m->sa);
-   m->sa = NULL;
-   if (newmsg){
-   fprintf(stderr,"%s",newmsg);
-   freeException(newmsg);
-   }
-   }
-   } while (p);
+   } else
+   msg = createException(MAL, "createdb", 
SQLSTATE(HY001) "Couldn't open file %s", filename);
+   } while (p && msg == MAL_SUCCEED);
GDKfree(fullname);
} else
-   fprintf(stderr, "!could not read createdb.sql\n");
+   msg = createException(MAL, "createdb", SQLSTATE(HY001) 
"Could not read createdb.sql");
+
+   /* Commit after all the startup scripts have been processed */
+   assert(m->session->tr->active);
+   if (mvc_status(m) < 0 || msg)
+   other = mvc_rollback(m, 0, NULL, false);
+   else
+   other = mvc_commit(m, 0, NULL, false);
+
+   if (other && !msg) /* 'msg' variable might be set or not, as 
well as 'other'. Throw the earliest one */
+   msg = other;
+   else if (other)
+   freeException(other);
+
+   if (msg)
+   fprintf(stderr, "%s", msg);
 #endif
} else {/* handle upgrades */
if (!m->sa)
@@ -564,10 +573,10 @@ SQLinit(Client c)
msg = createException(MAL, "createdb", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
} else if (maybeupgrade) {
if ((msg = SQLtrans(m)) == MAL_SUCCEED) {
-   SQLupgrades(c,m);
+   int res = SQLupgrades(c, m);
/* Commit at the end of the 

MonetDB: default - Merge with Nov2019

2019-10-27 Thread Pedro Ferreira
Changeset: 804427e295f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=804427e295f6
Modified Files:
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:

Merge with Nov2019


diffs (206 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -565,9 +565,11 @@ SQLinit(Client c)
} else if (maybeupgrade) {
if ((msg = SQLtrans(m)) == MAL_SUCCEED) {
SQLupgrades(c,m);
-   /* sometimes the upgrade ends in a COMMIT,
-* sometimes not */
-   if (m->session->tr->active)
+   /* Commit at the end of the upgrade */
+   assert(m->session->tr->active);
+   if (mvc_status(m) < 0)
+   msg = mvc_rollback(m, 0, NULL, false);
+   else
msg = mvc_commit(m, 0, NULL, false);
}
}
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
@@ -248,7 +248,6 @@ sql_update_hugeint(Client c, mvc *sql, c
"update sys.functions set system = true where name = 
'filter' and schema_id = (select id from sys.schemas where name = 'json');\n");
 
pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
 
printf("Running database upgrade commands:\n%s\n", buf);
@@ -297,7 +296,6 @@ sql_update_geom(Client c, mvc *sql, int 
}
 
pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
 
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -411,7 +409,6 @@ sql_update_jul2017(Client c, const char 
res_tables_destroy(output);
 
pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
 
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -456,7 +453,6 @@ sql_update_jul2017_sp2(Client c)
"GRANT EXECUTE ON FUNCTION sys.environment() TO 
PUBLIC;\n"
"GRANT SELECT ON sys.environment TO PUBLIC;\n"
);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, , "update", true, 
false, NULL);
@@ -508,7 +504,6 @@ sql_update_jul2017_sp3(Client c, mvc *sq
"create trigger system_update_schemas after update on 
sys.schemas for each statement call sys_update_schemas();\n"
"create trigger system_update_tables after update on 
sys._tables for each statement call sys_update_tables();\n");
pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, , "update", true, false, NULL);
@@ -545,7 +540,6 @@ sql_update_mar2018_geom(Client c, sql_ta
"update sys._tables set system = true where name = 
'geometry_columns' and schema_id in (select id from schemas where name = 
'sys');\n");
 
pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
 
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1014,7 +1008,6 @@ sql_update_mar2018(Client c, mvc *sql, c
);
 
pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
-   pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
 
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1025,7 +1018,6 @@ sql_update_mar2018(Client c, mvc *sql, c
   "ALTER TABLE sys.function_types SET READ ONLY;\n"
   "ALTER TABLE sys.function_languages SET READ 
ONLY;\n");
pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", prev_schema);
-   pos += 

MonetDB: default - Merge with Nov2019

2019-10-27 Thread Pedro Ferreira
Changeset: 1b4349e213c6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b4349e213c6
Modified Files:
gdk/gdk_analytic_bounds.c
sql/test/BugConstraints/Tests/check_constraint.SF-1714829.stable.err
sql/test/pg_regress/Tests/alter_table.stable.err
sql/test/pg_regress/Tests/alter_table.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 694 to 300 lines):

diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -94,7 +94,7 @@
do {\
lng m = k - 1;  \
for (; k < i; k++, rb++) {  \
-   TPE2 rlimit = (TPE2) LIMIT; \
+   TPE2 rlimit = LIMIT;\
TPE1 v = bp[k]; \
if (is_##TPE1##_nil(v)) {   \
for (j = k; ; j--) {\
@@ -125,7 +125,7 @@
 #define ANALYTICAL_WINDOW_BOUNDS_FIXED_GROUPS_FOLLOWING(TPE1, LIMIT, TPE2) \
do {\
for (; k < i; k++, rb++) {  \
-   TPE2 rlimit = (TPE2) LIMIT; \
+   TPE2 rlimit = LIMIT;\
TPE1 v = bp[k]; \
if (is_##TPE1##_nil(v)) {   \
for (j = k + 1; j < i; j++) {   \
@@ -168,7 +168,7 @@
}   \
} while (0)
 
-#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_RANGE_PRECEDING(LIMIT)   \
+#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_RANGE_PRECEDING(LIMIT, TPE)  \
do {\
lng m = k - 1;  \
for (; k < i; k++, rb++) {  \
@@ -188,7 +188,7 @@
next = BUNtail(bpi, (BUN) j);   \
if (atomcmp(next, nil) == 0)\
break;  \
-   if (ABSOLUTE(atomcmp(v, next)) > (int) 
LIMIT) \
+   if (ABSOLUTE((TPE) atomcmp(v, next)) > 
(TPE) LIMIT) \
break;  \
}   \
}   \
@@ -197,7 +197,7 @@
}   \
} while (0)
 
-#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_RANGE_FOLLOWING(LIMIT)   \
+#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_RANGE_FOLLOWING(LIMIT, TPE)  \
do {\
for (; k < i; k++, rb++) {  \
void *v = BUNtail(bpi, (BUN) k);\
@@ -211,7 +211,7 @@
void *next = BUNtail(bpi, (BUN) j); \
if (atomcmp(next, nil) == 0)\
break;  \
-   if (ABSOLUTE(atomcmp(v, next)) > (int) 
LIMIT) \
+   if (ABSOLUTE((TPE) atomcmp(v, next)) > 
(TPE) LIMIT) \
break;  \
}   \
}   \
@@ -219,11 +219,11 @@
}   \
} while (0)
 
-#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_GROUPS_PRECEDING(LIMIT)  \
+#define ANALYTICAL_WINDOW_BOUNDS_VARSIZED_GROUPS_PRECEDING(LIMIT, TPE) \
do {\
lng m = k - 1;  \
for (; k < i; k++, rb++) {  \
-   lng rlimit = (lng) LIMIT;   \
+   TPE rlimit = LIMIT; \
void *v = BUNtail(bpi, (BUN) k);\
if (atomcmp(v, nil) == 0) { \
for (j = k; ; j--) {\
@@ -253,10 +253,10 @@
}   

MonetDB: default - Merge with Nov2019

2019-10-25 Thread Pedro Ferreira
Changeset: e94f215a8bdc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e94f215a8bdc
Modified Files:
sql/backends/monet5/sql_cat.c
sql/server/rel_psm.c
sql/server/rel_schema.c
Branch: default
Log Message:

Merge with Nov2019


diffs (117 lines):

diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -473,7 +473,7 @@ drop_trigger(mvc *sql, char *sname, char
s = cur_schema(sql);
assert(s);
if (!mvc_schema_privs(sql, s))
-   throw(SQL,"sql.drop_trigger",SQLSTATE(3F000) "DROP TRIGGER: 
access denied for %s to schema ;'%s'", stack_get_string(sql, "current_user"), 
s->base.name);
+   throw(SQL,"sql.drop_trigger",SQLSTATE(3F000) "DROP TRIGGER: 
access denied for %s to schema '%s'", stack_get_string(sql, "current_user"), 
s->base.name);
 
if ((tri = mvc_bind_trigger(sql, s, tname)) == NULL) {
if(if_exists)
@@ -510,7 +510,7 @@ drop_table(mvc *sql, char *sname, char *
} else if (t->system) {
throw(SQL,"sql.droptable", SQLSTATE(42000) "DROP TABLE: cannot 
drop system table '%s'", tname);
} else if (!mvc_schema_privs(sql, s) && !(isTempSchema(s) && 
t->persistence == SQL_LOCAL_TEMP)) {
-   throw(SQL,"sql.droptable",SQLSTATE(42000) "DROP TABLE: access 
denied for %s to schema ;'%s'", stack_get_string(sql, "current_user"), 
s->base.name);
+   throw(SQL,"sql.droptable",SQLSTATE(42000) "DROP TABLE: access 
denied for %s to schema '%s'", stack_get_string(sql, "current_user"), 
s->base.name);
}
if (!drop_action && t->keys.set) {
for (n = t->keys.set->h; n; n = n->next) {
@@ -602,7 +602,7 @@ drop_index(Client cntxt, mvc *sql, char 
if (!i) {
throw(SQL,"sql.drop_index", SQLSTATE(42S12) "DROP INDEX: no 
such index '%s'", iname);
} else if (!mvc_schema_privs(sql, s)) {
-   throw(SQL,"sql.drop_index", SQLSTATE(42000) "DROP INDEX: access 
denied for %s to schema ;'%s'", stack_get_string(sql, "current_user"), 
s->base.name);
+   throw(SQL,"sql.drop_index", SQLSTATE(42000) "DROP INDEX: access 
denied for %s to schema '%s'", stack_get_string(sql, "current_user"), 
s->base.name);
} else {
if (i->type == ordered_idx) {
sql_kc *ic = i->columns->h->data;
@@ -730,7 +730,7 @@ drop_func(mvc *sql, char *sname, char *n
sql_func *func = n->data;
 
if (!mvc_schema_privs(sql, s)) {
-   throw(SQL,"sql.drop_func", SQLSTATE(42000) 
"DROP %s%s: access denied for %s to schema ;'%s'", KF, F, stack_get_string(sql, 
"current_user"), s->base.name);
+   throw(SQL,"sql.drop_func", SQLSTATE(42000) 
"DROP %s%s: access denied for %s to schema '%s'", KF, F, stack_get_string(sql, 
"current_user"), s->base.name);
}
if (!action && mvc_check_dependency(sql, func->base.id, 
!IS_PROC(func) ? FUNC_DEPENDENCY : PROC_DEPENDENCY, NULL))
throw(SQL,"sql.drop_func", SQLSTATE(42000) 
"DROP %s%s: there are database objects dependent on %s%s %s;", KF, F, kf, f, 
func->base.name);
@@ -747,7 +747,7 @@ drop_func(mvc *sql, char *sname, char *n
 
if (!mvc_schema_privs(sql, s)) {
list_destroy(list_func);
-   throw(SQL,"sql.drop_func", SQLSTATE(42000) "DROP %s%s: 
access denied for %s to schema ;'%s'", KF, F, stack_get_string(sql, 
"current_user"), s->base.name);
+   throw(SQL,"sql.drop_func", SQLSTATE(42000) "DROP %s%s: 
access denied for %s to schema '%s'", KF, F, stack_get_string(sql, 
"current_user"), s->base.name);
}
for (n = list_func->h; n; n = n->next) {
sql_func *func = n->data;
@@ -1055,7 +1055,7 @@ SQLdrop_schema(Client cntxt, MalBlkPtr m
if(!if_exists)
throw(SQL,"sql.drop_schema",SQLSTATE(3F000) "DROP 
SCHEMA: name %s does not exist", sname);
} else if (!mvc_schema_privs(sql, s)) {
-   throw(SQL,"sql.drop_schema",SQLSTATE(42000) "DROP SCHEMA: 
access denied for %s to schema ;'%s'", stack_get_string(sql, "current_user"), 
s->base.name);
+   throw(SQL,"sql.drop_schema",SQLSTATE(42000) "DROP SCHEMA: 
access denied for %s to schema '%s'", stack_get_string(sql, "current_user"), 
s->base.name);
} else if (s == cur_schema(sql)) {
throw(SQL,"sql.drop_schema",SQLSTATE(42000) "DROP SCHEMA: 
cannot drop current schema");
} else if (s->system) {
diff --git a/sql/server/rel_psm.c b/sql/server/rel_psm.c
--- a/sql/server/rel_psm.c
+++ b/sql/server/rel_psm.c
@@ -819,7 +819,7 @@ rel_create_func(sql_query *query, dlist 
if (replace) {
  

MonetDB: default - Merge with Nov2019

2019-10-25 Thread Pedro Ferreira
Changeset: 7bfab0e4f9e1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7bfab0e4f9e1
Modified Files:
gdk/gdk_analytic_bounds.c
sql/backends/monet5/sql_rank.c
sql/server/rel_schema.c
sql/server/sql_parser.y
sql/test/BugTracker-2013/Tests/All
sql/test/BugTracker-2013/Tests/check-constraint.Bug-3335.stable.err
sql/test/BugTracker-2013/Tests/check-constraint.Bug-3335.stable.out
sql/test/analytics/Tests/analytics06.sql
sql/test/analytics/Tests/analytics06.stable.err
sql/test/analytics/Tests/analytics06.stable.out
sql/test/wlcr/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 417 to 300 lines):

diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -16,7 +16,7 @@
lng calc1, calc2;   \
j = k;  \
for (; k < i; k++, rb++) {  \
-   lng rlimit = (lng) LIMIT;   \
+   lng rlimit = LIMIT; \
SUB_WITH_CHECK(k, rlimit, lng, calc1, GDK_lng_max, goto 
calc_overflow); \
ADD_WITH_CHECK(calc1, !first_half, lng, calc2, 
GDK_lng_max, goto calc_overflow); \
*rb = MAX(calc2, j);\
@@ -27,7 +27,7 @@
do {\
lng calc1, calc2;   \
for (; k < i; k++, rb++) {  \
-   lng rlimit = (lng) LIMIT;   \
+   lng rlimit = LIMIT; \
ADD_WITH_CHECK(rlimit, k, lng, calc1, GDK_lng_max, goto 
calc_overflow); \
ADD_WITH_CHECK(calc1, !first_half, lng, calc2, 
GDK_lng_max, goto calc_overflow); \
*rb = MIN(calc2, i);\
@@ -489,39 +489,50 @@ GDKanalyticalrowbounds(BAT *r, BAT *b, B
case TYPE_bte:{
bte *restrict limit = (bte *) Tloc(l, 0);
if (preceding) {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, (lng) limit[k]);
} else {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, (lng) limit[k]);
}
break;
}
case TYPE_sht:{
sht *restrict limit = (sht *) Tloc(l, 0);
if (preceding) {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, (lng) limit[k]);
} else {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, (lng) limit[k]);
}
break;
}
case TYPE_int:{
int *restrict limit = (int *) Tloc(l, 0);
if (preceding) {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, (lng) limit[k]);
} else {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, (lng) limit[k]);
}
break;
}
case TYPE_lng:{
lng *restrict limit = (lng *) Tloc(l, 0);
if (preceding) {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_PRECEDING, (lng) limit[k]);
} else {
-   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, limit[k]);
+   
ANALYTICAL_WINDOW_BOUNDS_BRANCHES_ROWS(_FOLLOWING, (lng) limit[k]);
}
break;
}
+#ifdef HAVE_HGE
+   case TYPE_hge:{
+   hge *restrict limit = (hge *) Tloc(l, 0);
+   if (preceding) {
+   

MonetDB: default - Merge with Nov2019

2019-10-24 Thread Pedro Ferreira
Changeset: a3990762c1dd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a3990762c1dd
Added Files:
sql/test/BugTracker-2019/Tests/rank-nan.Bug-6780.sql
sql/test/BugTracker-2019/Tests/rank-nan.Bug-6780.stable.err
sql/test/BugTracker-2019/Tests/rank-nan.Bug-6780.stable.out
Modified Files:
gdk/gdk_analytic_func.c
sql/server/rel_exp.c
sql/test/BugTracker-2015/Tests/crash.Bug-3736.sql
sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
sql/test/BugTracker-2019/Tests/All
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1415 to 300 lines):

diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -25,13 +25,38 @@
}   \
} else {\
for (; bp < end; bp++, rb++) {  \
-   if (*bp != prev) {  \
+   if (*bp == prev) { \
+   *rb = FALSE;\
+   } else {\
+   *rb = TRUE; \
+   prev = *bp; \
+   } \
+   }   \
+   }   \
+   } while (0)
+
+/* We use NaN for floating point null values, which always output false on 
equality tests */
+#define ANALYTICAL_DIFF_FLOAT_IMP(TPE) \
+   do {\
+   TPE *bp = (TPE*)Tloc(b, 0); \
+   TPE prev = *bp, *end = bp + cnt;\
+   if (np) {   \
+   for (; bp < end; bp++, rb++, np++) {\
+   *rb = *np;  \
+   if (*bp != prev && (!is_##TPE##_nil(*bp) || 
!is_##TPE##_nil(prev))) { \
*rb = TRUE; \
prev = *bp; \
-   } else {\
-   *rb = FALSE;\
}   \
}   \
+   } else {\
+   for (; bp < end; bp++, rb++) {  \
+   if (*bp == prev || (is_##TPE##_nil(*bp) && 
is_##TPE##_nil(prev))) { \
+   *rb = FALSE; \
+   } else {\
+   *rb = TRUE; \
+   prev = *bp; \
+   } \
+   }   \
}   \
} while (0)
 
@@ -63,10 +88,10 @@ GDKanalyticaldiff(BAT *r, BAT *b, BAT *p
break;
 #endif
case TYPE_flt:
-   ANALYTICAL_DIFF_IMP(flt);
+   ANALYTICAL_DIFF_FLOAT_IMP(flt);
break;
case TYPE_dbl:
-   ANALYTICAL_DIFF_IMP(dbl);
+   ANALYTICAL_DIFF_FLOAT_IMP(dbl);
break;
default:{
BATiter it = bat_iterator(b);
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -2085,7 +2085,15 @@ exp_sum_scales(sql_subfunc *f, sql_exp *
 
/* numeric types are fixed length */
if (ares->type.type->eclass == EC_NUM) {
-   sql_find_numeric(, ares->type.type->localtype, 
res->digits);
+#ifdef HAVE_HGE
+   if (have_hge && ares->type.type->localtype == TYPE_hge 
&& res->digits == 128)
+   t = *sql_bind_localtype("hge");
+   else
+#endif
+   if (ares->type.type->localtype == TYPE_lng && 
res->digits == 64)
+   t = *sql_bind_localtype("lng");
+   else
+   sql_find_numeric(, 
ares->type.type->localtype, res->digits);
} else {
sql_find_subtype(, ares->type.type->sqlname, 
res->digits, res->scale);
}
diff --git a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.sql 
b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.sql
--- a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.sql
+++ b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.sql
@@ -1,4 +1,3 @@
-
 
 CREATE TABLE open_auctions (
  id int NOT NULL 

MonetDB: default - Merge with Nov2019

2019-10-24 Thread Pedro Ferreira
Changeset: 5a7a63e0a28a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a7a63e0a28a
Added Files:
sql/test/miscellaneous/Tests/view-mul-digits.sql
sql/test/miscellaneous/Tests/view-mul-digits.stable.err
sql/test/miscellaneous/Tests/view-mul-digits.stable.out
Modified Files:
clients/mapiclient/dump.c
sql/backends/monet5/sql_upgrades.c
sql/test/BugTracker-2019/Tests/crash-in-rel_dependencies.Bug-6703.sql

sql/test/BugTracker-2019/Tests/crash-in-rel_dependencies.Bug-6703.stable.out
sql/test/miscellaneous/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-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 348 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
@@ -1167,11 +1167,8 @@ describe_table(Mapi mid, const char *sch
t = sescape(tname);
maxquerylen = 5120 + strlen(t) + strlen(s);
query = malloc(maxquerylen);
-   if (query == NULL) {
-   if (sname != NULL)
-   free(sname);
+   if (query == NULL)
goto bailout;
-   }
 
snprintf(query, maxquerylen,
 "%s "
@@ -1485,7 +1482,7 @@ int
 describe_sequence(Mapi mid, const char *schema, const char *tname, stream 
*toConsole)
 {
MapiHdl hdl = NULL;
-   char *query;
+   char *query = NULL;
size_t maxquerylen;
char *sname = NULL;
const char *comments_clause = get_comments_clause(mid);
@@ -1509,11 +1506,8 @@ describe_sequence(Mapi mid, const char *
maxquerylen = 5120 + strlen(tname) + strlen(schema);
 
query = malloc(maxquerylen);
-   if (query == NULL) {
-   if (sname != NULL)
-   free(sname);
+   if (query == NULL)
goto bailout;
-   }
 
snprintf(query, maxquerylen,
"%s "
@@ -1959,8 +1953,12 @@ dump_function(Mapi mid, stream *toConsol
if (flkey) {
char* nflkey = flkey ? strdup(flkey) : NULL;
if (!nflkey) {
-   if (remark)
+   if (remark) {
free(remark);
+   free(sname);
+   free(fname);
+   free(ftkey);
+   }
goto bailout;
} else
flkey = nflkey;
@@ -1976,8 +1974,12 @@ dump_function(Mapi mid, stream *toConsol
if (!ffunc || query_len < 0 || query_len >= (int) query_size) {
free(ffunc);
free(flkey);
-   if (remark)
+   if (remark) {
free(remark);
+   free(sname);
+   free(fname);
+   free(ftkey);
+   }
free(query);
goto bailout;
}
@@ -1987,8 +1989,12 @@ dump_function(Mapi mid, stream *toConsol
if (hdl == NULL || mapi_error(mid)) {
free(ffunc);
free(flkey);
-   if (remark)
+   if (remark) {
free(remark);
+   free(sname);
+   free(fname);
+   free(ftkey);
+   }
goto bailout;
}
if (flang != 1 && flang != 2) {
@@ -2006,8 +2012,12 @@ dump_function(Mapi mid, stream *toConsol
free(ascal);
free(ffunc);
free(flkey);
-   if (remark)
+   if (remark) {
free(remark);
+   free(sname);
+   free(fname);
+   free(ftkey);
+   }
goto bailout;
}
if (strcmp(ainou, "0") == 0) {
@@ -2043,8 +2053,12 @@ dump_function(Mapi mid, stream *toConsol
free(ascal);
free(ffunc);
free(flkey);
-   if (remark)
+   if (remark) {
free(remark);
+   free(sname);
+   

MonetDB: default - Merge with Nov2019

2019-10-23 Thread Pedro Ferreira
Changeset: c0c552fd820c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0c552fd820c
Modified Files:
sql/backends/monet5/sql_upgrades.c
sql/test/BugTracker-2009/Tests/All

sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out

sql/test/BugTracker-2017/Tests/type-resolution-error.Bugs-6313.stable.err
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
sql/test/Dump/Tests/dump-again.stable.err
sql/test/Tests/comment-auth.stable.err
sql/test/Tests/comment-dump.stable.err
sql/test/mergetables/Tests/sqlsmith.Bug-6455.stable.err
sql/test/mergetables/Tests/sqlsmith.Bug-6459.stable.err
sql/test/testdb-reload/Tests/reload.stable.err
sql/test/testdb/Tests/dump-nogeom.stable.err
Branch: default
Log Message:

Merge with Nov2019


diffs (240 lines):

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
@@ -1941,6 +1941,7 @@ sql_update_apr2019_sp2(Client c)
if (pos > 7900) { \
pos += snprintf(buf + pos, bufsize - pos, ") as t1(c1,c2,c3) 
where t1.c1 not in (select \"id\" from dependencies where depend_id = 
t1.c2);\n"); \
assert(pos < bufsize); \
+   printf("Running database upgrade commands:\n%s\n", buf); \
err = SQLstatementIntern(c, , "update", true, false, NULL); 
\
if (err) \
goto bailout; \
@@ -2071,6 +2072,7 @@ sql_update_nov2019_missing_dependencies(
pos += snprintf(buf + pos, bufsize - pos, ") as t1(c1,c2,c3) 
where t1.c1 not in (select \"id\" from dependencies where depend_id = 
t1.c2);\n");
 
assert(pos < bufsize);
+   printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, , "update", true, false, NULL);
}
 
diff --git a/sql/test/BugTracker-2009/Tests/All 
b/sql/test/BugTracker-2009/Tests/All
--- a/sql/test/BugTracker-2009/Tests/All
+++ b/sql/test/BugTracker-2009/Tests/All
@@ -25,7 +25,7 @@ bool-str-bug
 rollback_bug
 update-crash
 correlated-selection-bug
-HAVE_MAL_DEBUGGER?segfault_when_quitting_debugger.SF-2538837
+HAVE_MAL_DEBUGGER_WIN32?segfault_when_quitting_debugger.SF-2538837
 row_number_bug.SF-2546109
 #set_history_and_drop_table.SF-2607045  not relevant anymore
 TypeException_having_count_distinct.SF-2494227
diff --git 
a/sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out
 
b/sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out
--- 
a/sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out
+++ 
b/sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out
@@ -60,8 +60,6 @@ stdout of test 'crash-select_after_MAL_e
 # loading sql script: 90_generator.sql
 # loading sql script: 90_generator_hge.sql
 # loading sql script: 99_system.sql
-#WARNING To speedup calc./ a bulk operator implementation is needed
-#X_24965:bat[:lng] := 
mal.multiplex("calc":str,"/":str,0:bte,X_24964:bat[:int]);
 
 # 14:22:38 >  
 # 14:22:38 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-11002" "--port=36959"
diff --git 
a/sql/test/BugTracker-2017/Tests/type-resolution-error.Bugs-6313.stable.err 
b/sql/test/BugTracker-2017/Tests/type-resolution-error.Bugs-6313.stable.err
--- a/sql/test/BugTracker-2017/Tests/type-resolution-error.Bugs-6313.stable.err
+++ b/sql/test/BugTracker-2017/Tests/type-resolution-error.Bugs-6313.stable.err
@@ -30,8 +30,6 @@ stderr of test 'type-resolution-error.Bu
 #X_353:bat[:lng] := mal.multiplex("user":str, "hashsize":str, 
X_319:bat[:bit], X_298:bat[:lng]);
 #WARNING To speedup user.imprintsize a bulk operator implementation is needed
 #X_355:bat[:lng] := mal.multiplex("user":str, "imprintsize":str, 
X_298:bat[:lng], X_284:bat[:str]);
-#WARNING To speedup calc.ifthenelse a bulk operator implementation is needed
-#X_572:bat[:bit] := mal.multiplex("calc":str, "ifthenelse":str, X_571:bit, 
X_130:bat[:int], X_560:bat[:bit]);
 
 # 12:52:03 >  
 # 12:52:03 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-19106" "--port=36358"
diff --git 
a/sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err 
b/sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
--- a/sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
+++ b/sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
@@ -20,16 +20,6 @@ stderr of test 'python-loader-string.Bug
 # cmdline opt  monet_prompt = 
 # cmdline opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Apr2019/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2019
 # cmdline opt  embedded_py = 2
-#WARNING To speedup sql.get_value a bulk operator implementation is needed
-#

MonetDB: default - Merge with Nov2019

2019-10-23 Thread Pedro Ferreira
Changeset: 6628fde0fc40 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6628fde0fc40
Added Files:
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.timeout
Modified Files:
clients/mapiclient/dump.c
sql/server/rel_optimizer.c
sql/server/rel_sequence.c
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.stable.out
sql/test/BugTracker-2019/Tests/next-get-value-bulk.Bug-6766.sql
sql/test/BugTracker-2019/Tests/next-get-value-bulk.Bug-6766.stable.out
sql/test/BugTracker-2019/Tests/sequences-defaults.Bug-6744.sql
sql/test/BugTracker-2019/Tests/sequences-defaults.Bug-6744.stable.err
sql/test/BugTracker-2019/Tests/sequences-defaults.Bug-6744.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 882 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
@@ -248,14 +248,14 @@ static char *actions[] = {
 static char *
 get_schema(Mapi mid)
 {
-   char *sname = NULL;
+   char *nsname = NULL, *sname = NULL;
MapiHdl hdl;
 
if ((hdl = mapi_query(mid, "SELECT current_schema")) == NULL ||
mapi_error(mid))
goto bailout;
while ((mapi_fetch_row(hdl)) != 0) {
-   sname = mapi_fetch_field(hdl, 0);
+   nsname = mapi_fetch_field(hdl, 0);
 
if (mapi_error(mid))
goto bailout;
@@ -263,20 +263,26 @@ get_schema(Mapi mid)
if (mapi_error(mid))
goto bailout;
/* copy before closing the handle */
-   if (sname)
-   sname = strdup(sname);
+   if (nsname)
+   sname = strdup(nsname);
+   if (nsname && !sname)
+   goto bailout;
mapi_close_handle(hdl);
return sname;
 
-  bailout:
+bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
+   else if (mapi_error(mid))
+   mapi_explain_query(hdl, stderr);
else
-   mapi_explain_query(hdl, stderr);
+   fprintf(stderr, "malloc failure1\n");
mapi_close_handle(hdl);
-   } else
+   } else if (mapi_error(mid))
mapi_explain(mid, stderr);
+   else
+   fprintf(stderr, "malloc failure\n");
return NULL;
 }
 
@@ -308,7 +314,7 @@ has_hugeint(Mapi mid)
answer = (int) ret;
return answer;
 
-  bailout:
+bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -356,7 +362,7 @@ has_funcsys(Mapi mid)
answer = ret;
return ret;
 
-  bailout:
+bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -397,7 +403,7 @@ has_table_partitions(Mapi mid)
answer = ret;
return ret;
 
-  bailout:
+bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -523,20 +529,22 @@ dump_foreign_keys(Mapi mid, const char *
if (hdl == NULL || mapi_error(mid))
goto bailout;
 
-   while ((cnt = mapi_fetch_row(hdl)) != 0) {
-   char *c_psname = strdup(mapi_fetch_field(hdl, 0));
-   char *c_ptname = strdup(mapi_fetch_field(hdl, 1));
-   char *c_pcolumn = strdup(mapi_fetch_field(hdl, 2));
-   char *c_fcolumn = strdup(mapi_fetch_field(hdl, 3));
+   cnt = mapi_fetch_row(hdl);
+   while (cnt != 0) {
+   char *nc_psname = mapi_fetch_field(hdl, 0), *c_psname = 
nc_psname ? strdup(nc_psname) : NULL;
+   char *nc_ptname = mapi_fetch_field(hdl, 1), *c_ptname = 
nc_ptname ? strdup(nc_ptname) : NULL;
+   char *nc_pcolumn = mapi_fetch_field(hdl, 2), *c_pcolumn = 
nc_pcolumn ? strdup(nc_pcolumn) : NULL;
+   char *nc_fcolumn = mapi_fetch_field(hdl, 3), *c_fcolumn = 
nc_fcolumn ? strdup(nc_fcolumn) : NULL;
char *c_nr = mapi_fetch_field(hdl, 4); /* no need to strdup, 
because it's not used */
-   char *c_fkname = strdup(mapi_fetch_field(hdl, 5));
-   char *c_faction = strdup(mapi_fetch_field(hdl, 6));
-   char *c_fsname = strdup(mapi_fetch_field(hdl, 7));
-   char *c_ftname = strdup(mapi_fetch_field(hdl, 8));
-   const char **fkeys, **pkeys;
+   char *nc_fkname = mapi_fetch_field(hdl, 5), *c_fkname = 
nc_fkname ? strdup(nc_fkname) : NULL;
+   char *nc_faction = mapi_fetch_field(hdl, 6), *c_faction = 
nc_faction ? strdup(nc_faction) : NULL;
+   char *nc_fsname = mapi_fetch_field(hdl, 7), *c_fsname = 
nc_fsname ? strdup(nc_fsname) : NULL;
+   char *nc_ftname = 

MonetDB: default - Merge with Nov2019

2019-10-22 Thread Pedro Ferreira
Changeset: 2111997f78f0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2111997f78f0
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.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_cat.c
sql/server/rel_sequence.c
sql/storage/sql_catalog.c
sql/storage/sql_storage.h
sql/storage/store.c
sql/storage/store_sequence.c
sql/storage/store_sequence.h
sql/test/Tests/alter-sequence.sql
sql/test/Tests/alter-sequence.stable.err
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 620 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
@@ -9010,6 +9010,13 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","prod", "pattern batsql.prod(b:bat[:lng], s:bat[:lng], 
e:bat[:lng]):bat[:lng] ","SQLprod;", "return the product of groups" 
 ]
 [ "batsql","prod", "pattern batsql.prod(b:bat[:sht], s:bat[:lng], 
e:bat[:lng]):bat[:lng] ","SQLprod;", "return the product of groups" 
 ]
 [ "batsql","rank", "pattern batsql.rank(b:bat[:any_1], p:any_2, 
o:any_3):bat[:int] ",  "SQLrank;", "return the ranked groups"  ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:bat[:str], start:bat[:lng]):bat[:lng] ",   "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:bat[:str], start:lng):bat[:lng] ", "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:str, start:bat[:lng]):bat[:lng] ", "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:str, start:lng):bat[:lng] ",   "mvc_bat_restart_seq;", "restart the 
sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:str, 
sequence:bat[:str], start:bat[:lng]):bat[:lng] ", "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:str, 
sequence:bat[:str], start:lng):bat[:lng] ",   "mvc_bat_restart_seq;", "restart 
the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:str, 
sequence:str, start:bat[:lng]):bat[:lng] ",   "mvc_bat_restart_seq;", "restart 
the sequence with value start" ]
 [ "batsql","round","command batsql.round(v:bat[:bte], d:int, 
s:int, r:bte):bat[:bte] ","bte_bat_round_wrap;",  "round off the decimal 
v(d,s) to r digits behind the dot (if r < 0, before the dot)"]
 [ "batsql","round","command batsql.round(v:bat[:dbl], 
r:bte):bat[:dbl] ",  "dbl_bat_round_wrap;",  "round off the floating point v to 
r digits behind the dot (if r < 0, before the dot)"  ]
 [ "batsql","round","command batsql.round(v:bat[:flt], 
r:bte):bat[:flt] ",  "flt_bat_round_wrap;",  "round off the floating point v to 
r digits behind the dot (if r < 0, before the dot)"  ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -12737,6 +12737,13 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","prod", "pattern batsql.prod(b:bat[:sht], s:bat[:lng], 
e:bat[:lng]):bat[:hge] ","SQLprod;", "return the product of groups" 
 ]
 [ "batsql","prod", "pattern batsql.prod(b:bat[:sht], s:bat[:lng], 
e:bat[:lng]):bat[:lng] ","SQLprod;", "return the product of groups" 
 ]
 [ "batsql","rank", "pattern batsql.rank(b:bat[:any_1], p:any_2, 
o:any_3):bat[:int] ",  "SQLrank;", "return the ranked groups"  ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:bat[:str], start:bat[:lng]):bat[:lng] ",   "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:bat[:str], start:lng):bat[:lng] ", "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:str, start:bat[:lng]):bat[:lng] ", "mvc_bat_restart_seq;", 
"restart the sequence with value start" ]
+[ "batsql","restart",  "unsafe pattern batsql.restart(sname:bat[:str], 
sequence:str, start:lng):bat[:lng] ",   "mvc_bat_restart_seq;", "restart the 
sequence 

MonetDB: default - Merge with Nov2019

2019-10-22 Thread Pedro Ferreira
Changeset: 68b926da7b27 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68b926da7b27
Added Files:
sql/test/BugTracker-2019/Tests/NOT_IN-AND-OR-wrong-results.Bug-6775.sql

sql/test/BugTracker-2019/Tests/NOT_IN-AND-OR-wrong-results.Bug-6775.stable.err

sql/test/BugTracker-2019/Tests/NOT_IN-AND-OR-wrong-results.Bug-6775.stable.out
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.py
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.stable.err
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.stable.out
sql/test/BugTracker-2019/Tests/outer-join-varchar.Bug-6776.sql
sql/test/BugTracker-2019/Tests/outer-join-varchar.Bug-6776.stable.err
sql/test/BugTracker-2019/Tests/outer-join-varchar.Bug-6776.stable.out
Modified Files:
clients/mapiclient/dump.c
sql/ChangeLog.Nov2019
sql/server/rel_select.c
sql/test/BugTracker-2019/Tests/All
sql/test/miscellaneous/Tests/groupby_expressions.stable.err
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 2380 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
@@ -523,22 +523,30 @@ dump_foreign_keys(Mapi mid, const char *
if (hdl == NULL || mapi_error(mid))
goto bailout;
 
-   cnt = mapi_fetch_row(hdl);
-   while (cnt != 0) {
-   const char *c_psname = mapi_fetch_field(hdl, 0);
-   const char *c_ptname = mapi_fetch_field(hdl, 1);
-   const char *c_pcolumn = mapi_fetch_field(hdl, 2);
-   const char *c_fcolumn = mapi_fetch_field(hdl, 3);
-   const char *c_nr = mapi_fetch_field(hdl, 4);
-   const char *c_fkname = mapi_fetch_field(hdl, 5);
-   const char *c_faction = mapi_fetch_field(hdl, 6);
-   const char *c_fsname = mapi_fetch_field(hdl, 7);
-   const char *c_ftname = mapi_fetch_field(hdl, 8);
+   while ((cnt = mapi_fetch_row(hdl)) != 0) {
+   char *c_psname = strdup(mapi_fetch_field(hdl, 0));
+   char *c_ptname = strdup(mapi_fetch_field(hdl, 1));
+   char *c_pcolumn = strdup(mapi_fetch_field(hdl, 2));
+   char *c_fcolumn = strdup(mapi_fetch_field(hdl, 3));
+   char *c_nr = mapi_fetch_field(hdl, 4); /* no need to strdup, 
because it's not used */
+   char *c_fkname = strdup(mapi_fetch_field(hdl, 5));
+   char *c_faction = strdup(mapi_fetch_field(hdl, 6));
+   char *c_fsname = strdup(mapi_fetch_field(hdl, 7));
+   char *c_ftname = strdup(mapi_fetch_field(hdl, 8));
const char **fkeys, **pkeys;
int nkeys = 0;
 
-   if (mapi_error(mid))
+   if (mapi_error(mid) || !c_psname || !c_ptname || !c_pcolumn || 
!c_fcolumn || !c_fkname || !c_faction || !c_fsname || !c_ftname) {
+   free(c_psname);
+   free(c_ptname);
+   free(c_pcolumn);
+   free(c_fcolumn);
+   free(c_fkname);
+   free(c_faction);
+   free(c_fsname);
+   free(c_ftname);
goto bailout;
+   }
assert(strcmp(c_nr, "0") == 0);
(void) c_nr;/* pacify compilers in case assertions are 
disabled */
nkeys = 1;
@@ -549,6 +557,14 @@ dump_foreign_keys(Mapi mid, const char *
free((void *) fkeys);
if (pkeys)
free((void *) pkeys);
+   free(c_psname);
+   free(c_ptname);
+   free(c_pcolumn);
+   free(c_fcolumn);
+   free(c_fkname);
+   free(c_faction);
+   free(c_fsname);
+   free(c_ftname);
goto bailout;
}
pkeys[nkeys - 1] = c_pcolumn;
@@ -560,6 +576,14 @@ dump_foreign_keys(Mapi mid, const char *
if (tkeys == NULL) {
free((void *) pkeys);
free((void *) fkeys);
+   free(c_psname);
+   free(c_ptname);
+   free(c_pcolumn);
+   free(c_fcolumn);
+   free(c_fkname);
+   free(c_faction);
+   free(c_fsname);
+   free(c_ftname);
goto bailout;
}
pkeys = tkeys;
@@ -567,6 +591,14 @@ dump_foreign_keys(Mapi mid, const char *
if 

MonetDB: default - Merge with Nov2019

2019-10-18 Thread Pedro Ferreira
Changeset: 104dc9145456 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=104dc9145456
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/storage/store.c
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 448 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
@@ -8973,9 +8973,9 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","diff", "pattern batsql.diff(b:bat[:any_1]):bat[:bit] ",
"SQLdiff;", "return true if cur != prev row"]
 [ "batsql","diff", "pattern batsql.diff(p:bat[:bit], 
b:bat[:any_1]):bat[:bit] ",   "SQLdiff;", "return true if cur != prev row"  
  ]
 [ "batsql","first_value",  "pattern batsql.first_value(b:bat[:any_1], 
s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLfirst_value;",  "return 
the first value of groups"  ]
+[ "batsql","get_value","pattern batsql.get_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ", "mvc_bat_get_value;",   "return the 
current value of sequences" ]
 [ "batsql","get_value","pattern batsql.get_value(sname:bat[:str], 
sequence:str):bat[:lng] ",   "mvc_bat_get_value;",   "return the current value 
of the sequence"  ]
-[ "batsql","get_value","pattern batsql.get_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",   "mvc_bat_schema_sequences_get_value;",  
"return the current value of sequences" ]
-[ "batsql","get_value","pattern batsql.get_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ", "mvc_bat_schemas_sequences_get_value;", 
"return the current value of sequences" ]
+[ "batsql","get_value","pattern batsql.get_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",   "mvc_bat_get_value;",   "return the current 
value of sequences" ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, d:any_1, 
p:any_3, o:any_4):bat[:any_1] ",   "SQLlag;",  "return the value in the 
previous 'l' row in the partition or 'd' if non existent"  ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, 
d:bat[:any_1], p:any_3, o:any_4):bat[:any_1] ", "SQLlag;",  "return the 
value in the previous 'l' row in the partition or 'd' if non existent"  ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, p:any_3, 
o:any_4):bat[:any_1] ","SQLlag;",  "return the value in the previous 
'l' row in the partition or NULL if non existent" ]
@@ -8993,9 +8993,9 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","lead", "pattern batsql.lead(b:bat[:any_1], p:any_3, 
o:any_4):bat[:any_1] ","SQLlead;", "return the value in the next row in 
the partition or NULL if non existent" ]
 [ "batsql","max",  "pattern batsql.max(b:bat[:any_1], s:bat[:lng], 
e:bat[:lng]):bat[:any_1] ", "SQLmax;",  "return the maximum of groups"  
]
 [ "batsql","min",  "pattern batsql.min(b:bat[:any_1], s:bat[:lng], 
e:bat[:lng]):bat[:any_1] ", "SQLmin;",  "return the minimum of groups"  
]
+[ "batsql","next_value",   "pattern batsql.next_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ","mvc_bat_next_value;",  "return the next 
value of sequences"]
 [ "batsql","next_value",   "pattern batsql.next_value(sname:bat[:str], 
sequence:str):bat[:lng] ",  "mvc_bat_next_value;",  "return the next value of 
the sequence" ]
-[ "batsql","next_value",   "pattern batsql.next_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",  "mvc_bat_schema_sequences_next_value;", 
"return the next value of sequences"]
-[ "batsql","next_value",   "pattern batsql.next_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ","mvc_bat_schemas_sequences_next_value;",
"return the next value of sequences"]
+[ "batsql","next_value",   "pattern batsql.next_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",  "mvc_bat_next_value;",  "return the next 
value of sequences"]
 [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], 
n:any_2, s:bat[:lng], e:bat[:lng]):bat[:any_1] ",  "SQLnth_value;",
"return the nth value of each group"]
 [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], 
n:bat[:any_2], s:bat[:lng], e:bat[:lng]):bat[:any_1] ","SQLnth_value;", 
   "return the nth value of each group"]
 [ "batsql","ntile","pattern batsql.ntile(b:bat[:any_1], n:any_2, 
p:any_3, o:any_4):bat[:any_2] ",  "SQLntile;","return the groups divided as 
equally as possible"  ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ 

MonetDB: default - Merge with Nov2019

2019-10-18 Thread Pedro Ferreira
Changeset: 2072196020bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2072196020bf
Added Files:
sql/test/BugTracker-2019/Tests/next-get-value-bulk.Bug-6766.stable.err
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/storage/store_sequence.c
sql/storage/store_sequence.h
sql/test/BugTracker-2018/Tests/negative-sequences.Bug-6665.stable.err
sql/test/BugTracker-2019/Tests/next-get-value-bulk.Bug-6766.sql
sql/test/BugTracker-2019/Tests/next-get-value-bulk.Bug-6766.stable.out
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 736 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
@@ -8973,6 +8973,9 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","diff", "pattern batsql.diff(b:bat[:any_1]):bat[:bit] ",
"SQLdiff;", "return true if cur != prev row"]
 [ "batsql","diff", "pattern batsql.diff(p:bat[:bit], 
b:bat[:any_1]):bat[:bit] ",   "SQLdiff;", "return true if cur != prev row"  
  ]
 [ "batsql","first_value",  "pattern batsql.first_value(b:bat[:any_1], 
s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLfirst_value;",  "return 
the first value of groups"  ]
+[ "batsql","get_value","pattern batsql.get_value(sname:bat[:str], 
sequence:str):bat[:lng] ",   "mvc_bat_get_value;",   "return the current value 
of the sequence"  ]
+[ "batsql","get_value","pattern batsql.get_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",   "mvc_bat_schema_sequences_get_value;",  
"return the current value of sequences" ]
+[ "batsql","get_value","pattern batsql.get_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ", "mvc_bat_schemas_sequences_get_value;", 
"return the current value of sequences" ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, d:any_1, 
p:any_3, o:any_4):bat[:any_1] ",   "SQLlag;",  "return the value in the 
previous 'l' row in the partition or 'd' if non existent"  ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, 
d:bat[:any_1], p:any_3, o:any_4):bat[:any_1] ", "SQLlag;",  "return the 
value in the previous 'l' row in the partition or 'd' if non existent"  ]
 [ "batsql","lag",  "pattern batsql.lag(b:bat[:any_1], l:any_2, p:any_3, 
o:any_4):bat[:any_1] ","SQLlag;",  "return the value in the previous 
'l' row in the partition or NULL if non existent" ]
@@ -8991,6 +8994,8 @@ stdout of test 'MAL-signatures` in direc
 [ "batsql","max",  "pattern batsql.max(b:bat[:any_1], s:bat[:lng], 
e:bat[:lng]):bat[:any_1] ", "SQLmax;",  "return the maximum of groups"  
]
 [ "batsql","min",  "pattern batsql.min(b:bat[:any_1], s:bat[:lng], 
e:bat[:lng]):bat[:any_1] ", "SQLmin;",  "return the minimum of groups"  
]
 [ "batsql","next_value",   "pattern batsql.next_value(sname:bat[:str], 
sequence:str):bat[:lng] ",  "mvc_bat_next_value;",  "return the next value of 
the sequence" ]
+[ "batsql","next_value",   "pattern batsql.next_value(sname:str, 
sequence:bat[:str]):bat[:lng] ",  "mvc_bat_schema_sequences_next_value;", 
"return the next value of sequences"]
+[ "batsql","next_value",   "pattern batsql.next_value(sname:bat[:str], 
sequence:bat[:str]):bat[:lng] ","mvc_bat_schemas_sequences_next_value;",
"return the next value of sequences"]
 [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], 
n:any_2, s:bat[:lng], e:bat[:lng]):bat[:any_1] ",  "SQLnth_value;",
"return the nth value of each group"]
 [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], 
n:bat[:any_2], s:bat[:lng], e:bat[:lng]):bat[:any_1] ","SQLnth_value;", 
   "return the nth value of each group"]
 [ "batsql","ntile","pattern batsql.ntile(b:bat[:any_1], n:any_2, 
p:any_3, o:any_4):bat[:any_2] ",  "SQLntile;","return the groups divided as 
equally as possible"  ]
@@ -11666,11 +11671,12 @@ stdout of test 'MAL-signatures` in direc
 [ "sql",   "export_table", "unsafe pattern sql.export_table(fname:str, 
fmt:str, colsep:str, recsep:str, qout:str, nullrep:str, onclient:int, 
tbl:bat[:str], attr:bat[:str], tpe:bat[:str], len:bat[:int], scale:bat[:int], 
cols:any...):int ", "mvc_export_row_wrap;", "Prepare a table result set for 
the COPY INTO stream"   ]
 [ "sql",   "export_table", "unsafe pattern sql.export_table(fname:str, 
fmt:str, colsep:str, recsep:str, qout:str, nullrep:str, onclient:int, 
tbl:bat[:str], attr:bat[:str], tpe:bat[:str], len:bat[:int], scale:bat[:int], 
cols:bat[:any]...):int ",   "mvc_export_table_wrap;",   "Prepare a 

  1   2   >