MonetDB: default - Merge with Dec2016.

2016-10-26 Thread Mark Raasveldt
Changeset: 5d4a3a53f572 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d4a3a53f572
Modified Files:
sql/backends/monet5/Tests/pyapi18.sql
sql/backends/monet5/Tests/pyapi18.stable.err
sql/backends/monet5/Tests/pyapi18.stable.out
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
Branch: default
Log Message:

Merge with Dec2016.


diffs (truncated from 484 to 300 lines):

diff --git a/sql/backends/monet5/Tests/pyapi18.sql 
b/sql/backends/monet5/Tests/pyapi18.sql
--- a/sql/backends/monet5/Tests/pyapi18.sql
+++ b/sql/backends/monet5/Tests/pyapi18.sql
@@ -82,7 +82,8 @@ LANGUAGE PYTHON
 SELECT pyapi_inp_decimal(d) FROM pyapi_ret_decimal();
 
 # test unsupported type
-create table uuid_tbl as select uuid() AS d with data;
-CREATE FUNCTION pyapi_interval(d UUID) RETURNS DOUBLE LANGUAGE PYTHON { return 
d; };
+CREATE TABLE uuid_tbl(d UUID);
+INSERT INTO uuid_tbl VALUES ('54771a16-b4ad-4f1a-a9b7-4d8e8ca6fb7c');
+CREATE FUNCTION pyapi_interval(d UUID) RETURNS STRING LANGUAGE PYTHON { return 
d; };
 SELECT pyapi_interval(d) FROM uuid_tbl;
 ROLLBACK;
diff --git a/sql/backends/monet5/Tests/pyapi18.stable.err 
b/sql/backends/monet5/Tests/pyapi18.stable.err
--- a/sql/backends/monet5/Tests/pyapi18.stable.err
+++ b/sql/backends/monet5/Tests/pyapi18.stable.err
@@ -31,9 +31,6 @@ stderr of test 'pyapi18` in directory 's
 # 18:18:39 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21503" "--port=39173"
 # 18:18:39 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-21503/.s.monetdb.39173
-QUERY = SELECT pyapi_interval(d) FROM uuid_tbl;
-ERROR = !Unsupported SQL Type: uuid
 
 # 18:18:39 >  
 # 18:18:39 >  "Done."
diff --git a/sql/backends/monet5/Tests/pyapi18.stable.out 
b/sql/backends/monet5/Tests/pyapi18.stable.out
--- a/sql/backends/monet5/Tests/pyapi18.stable.out
+++ b/sql/backends/monet5/Tests/pyapi18.stable.out
@@ -33,8 +33,8 @@ Ready.
 [ 1]
 #CREATE FUNCTION pyapi_date(d DATE) RETURNS STRING LANGUAGE PYTHON { return d; 
};
 #SELECT pyapi_date(d) FROM date_table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % clob # type
 % 10 # length
 [ "2000-10-10" ]
@@ -43,28 +43,28 @@ Ready.
 [ 1]
 #CREATE FUNCTION pyapi_time(d TIME) RETURNS STRING LANGUAGE PYTHON { return d; 
};
 #SELECT pyapi_time(d) FROM time_table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % clob # type
-% 8 # length
-[ "12:00:00"   ]
+% 12 # length
+[ "12:00:00.000"   ]
 #CREATE TABLE timestamp_table(d TIMESTAMP); # TIMESTAMP is converted to str
 #INSERT INTO timestamp_table VALUES (cast('2000-1-1 12:00:00' AS TIMESTAMP));
 [ 1]
 #CREATE FUNCTION pyapi_timestamp(d TIMESTAMP) RETURNS STRING LANGUAGE PYTHON { 
return d; };
 #SELECT pyapi_timestamp(d) FROM timestamp_table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % clob # type
-% 26 # length
-[ "2000-01-01 12:00:00.00" ]
+% 23 # length
+[ "2000-01-01 12:00:00.000"]
 #CREATE TABLE decimal_table(d DECIMAL(10, 3)); # DECIMAL is converted to dbl
 #INSERT INTO decimal_table VALUES (123.4567);
 [ 1]
 #CREATE FUNCTION pyapi_decimal(d DECIMAL) RETURNS DOUBLE LANGUAGE PYTHON { 
return d; };
 #SELECT pyapi_decimal(d) FROM decimal_table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % double # type
 % 24 # length
 [ 123.457  ]
@@ -76,7 +76,7 @@ Ready.
 #return result
 #};
 #SELECT * FROM pyapi_ret_date();
-% . # table_name
+% .L1 # table_name
 % d # name
 % date # type
 % 10 # length
@@ -89,7 +89,7 @@ Ready.
 #return result
 #};
 #SELECT * FROM pyapi_ret_time();
-% . # table_name
+% .L1 # table_name
 % d # name
 % time # type
 % 8 # length
@@ -102,7 +102,7 @@ Ready.
 #return result
 #};
 #SELECT * FROM pyapi_ret_timestamp();
-% . # table_name
+% .L1 # table_name
 % d # name
 % timestamp # type
 % 26 # length
@@ -115,7 +115,7 @@ Ready.
 #return result
 #};
 #SELECT * FROM pyapi_ret_decimal();
-% . # table_name
+% .L1 # table_name
 % d # name
 % decimal # type
 % 20 # length
@@ -135,13 +135,21 @@ Ready.
 #return numpy.mean(d) # average 100k decimal values
 #};
 #SELECT pyapi_inp_decimal(d) FROM pyapi_ret_decimal();
-% .L1 # table_name
-% L1 # name
+% .L3 # table_name
+% L3 # name
 % double # type
 % 24 # length
 [ 5e+04]
-#create table uuid_tbl as select uuid() AS d with data;
-#CREATE FUNCTION pyapi_interval(d UUID) RETURNS DOUBLE LANGUAGE PYTHON { 
return d; };
+#CREATE TABLE uuid_tbl(d UUID);
+#INSERT INTO uuid_tbl VALUES ('54771a16-b4ad-4f1a-a9b7-4d8e8ca6fb7c');
+[ 1]
+#CREATE FUNCTION pyapi_interval(d UUID) RETURNS STRING LANGUAGE PYTHON { 
return d; };
+#SELECT pyapi_interval(d) FROM uuid_tbl;
+% sys.L2 # table_name
+% L2 # name
+% clob # type
+% 36 # length
+[ "54771a16-b4ad-4f1a-a9b7-4d8e8ca6fb7c"   ]
 #ROLLBACK;
 
 # 18:18:39 >  
diff --git a/sql/backends/monet5/UDF/pyapi/connec

MonetDB: default - Merge with Dec2016.

2016-11-24 Thread Mark Raasveldt
Changeset: d63eb57c2247 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d63eb57c2247
Modified Files:
sql/backends/monet5/UDF/pyapi/pyapi.c
Branch: default
Log Message:

Merge with Dec2016.


diffs (51 lines):

diff --git a/sql/backends/monet5/UDF/pyapi/pyapi.c 
b/sql/backends/monet5/UDF/pyapi/pyapi.c
--- a/sql/backends/monet5/UDF/pyapi/pyapi.c
+++ b/sql/backends/monet5/UDF/pyapi/pyapi.c
@@ -39,6 +39,8 @@
 const char* verbose_enableflag = "enable_pyverbose";
 const char* warning_enableflag = "enable_pywarnings";
 const char* debug_enableflag = "enable_pydebug";
+const char* fork_disableflag = "disable_fork";
+static bool option_disable_fork = false;
 #ifdef _PYAPI_VERBOSE_
 static bool option_verbose;
 #endif
@@ -320,16 +322,21 @@ str PyAPIeval(Client cntxt, MalBlkPtr mb
 }
 
 #ifdef HAVE_FORK
-if (!mapped && !parallel_aggregation) {
-MT_lock_set(&pyapiLock);
-if (python_call_active) {
-mapped = true;
-holds_gil = false;
-} else {
-python_call_active = true;
-holds_gil = true;
+if (!option_disable_fork) {
+if (!mapped && !parallel_aggregation) {
+MT_lock_set(&pyapiLock);
+if (python_call_active) {
+mapped = true;
+holds_gil = false;
+} else {
+python_call_active = true;
+holds_gil = true;
+}
+MT_lock_unset(&pyapiLock);
 }
-MT_lock_unset(&pyapiLock);
+} else {
+mapped = false;
+holds_gil = true;
 }
 #endif
 
@@ -1369,6 +1376,7 @@ str
 #ifdef _PYAPI_WARNINGS_
 option_warning = GDKgetenv_isyes(warning_enableflag) || 
GDKgetenv_istrue(warning_enableflag);
 #endif
+option_disable_fork = GDKgetenv_istrue(fork_disableflag) || 
GDKgetenv_isyes(fork_disableflag);
 return MAL_SUCCEED;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016

2017-01-06 Thread Hannes Muehleisen
Changeset: 7aee4214df1a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7aee4214df1a
Modified Files:
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_stack.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_reorder.c
sql/backends/monet5/sql_optimizer.c
Branch: default
Log Message:

Merge with Dec2016


diffs (141 lines):

diff --git a/monetdb5/mal/mal_builder.c b/monetdb5/mal/mal_builder.c
--- a/monetdb5/mal/mal_builder.c
+++ b/monetdb5/mal/mal_builder.c
@@ -108,6 +108,10 @@ newComment(MalBlkPtr mb, const char *val
}
cst.len= (int) strlen(cst.val.sval);
getArg(q,0) = defConstant(mb,TYPE_str,&cst);
+   if (getArg(q,0) < 0) {
+   freeInstruction(q);
+   return NULL;
+   }
clrVarConstant(mb,getArg(q,0));
setVarDisabled(mb,getArg(q,0));
if (mb->errors) {
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -717,7 +717,6 @@ makeVarSpace(MalBlkPtr mb)
if (new == NULL) {
mb->errors++;
showScriptException(GDKout, mb, 0, MAL, "newMalBlk:no 
storage left\n");
-   assert(0);
return -1;
}
memset(new + mb->vsize, 0, (s - mb->vsize) * sizeof(VarPtr));
@@ -1245,6 +1244,9 @@ defConstant(MalBlkPtr mb, int type, ValP
return k;
}
k = newTmpVariable(mb, type);
+   if (k == -1) {
+   return k;
+   }
setVarConstant(mb, k);
setVarFixed(mb, k);
if (type >= 0 && type < GDKatomcnt && ATOMextern(type))
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -285,6 +285,9 @@ prepareMALstack(MalBlkPtr mb, int size)
 
assert(size >= mb->vsize);
stk = newGlobalStack(size);
+   if (!stk) {
+   return NULL;
+   }
//memset((char *)stk, 0, stackSize(size)); already set
//stk->stksize = size;
stk->stktop = mb->vtop;
diff --git a/monetdb5/mal/mal_stack.c b/monetdb5/mal/mal_stack.c
--- a/monetdb5/mal/mal_stack.c
+++ b/monetdb5/mal/mal_stack.c
@@ -59,8 +59,9 @@ newGlobalStack(int size)
MalStkPtr s;
 
s = (MalStkPtr) GDKzalloc(stackSize(size) + offsetof(MalStack, stk));
-   if (s == NULL)
-   GDKfatal("newGlobalStack:can not obtain memory\n");
+   if (!s) {
+   return NULL;
+   }
s->stksize = size;
return s;
 }
@@ -75,6 +76,9 @@ reallocGlobalStack(MalStkPtr old, int cn
return old;
k = ((cnt / STACKINCR) + 1) * STACKINCR;
s = newGlobalStack(k);
+   if (!s) {
+   return NULL;
+   }
memcpy(s, old, stackSize(old->stksize));
s->stksize = k;
GDKfree(old);
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -1544,8 +1544,9 @@ OPTmergetableImplementation(Client cntxt
ml.vsize = mb->vsize;
ml.horigin = (int*) GDKmalloc(sizeof(int)* ml.vsize);
ml.torigin = (int*) GDKmalloc(sizeof(int)* ml.vsize);
-   if ( ml.v == NULL || ml.horigin == NULL || ml.torigin == NULL) 
+   if ( ml.v == NULL || ml.horigin == NULL || ml.torigin == NULL) {
goto cleanup;
+   }
for (i=0; i 0){
 chkTypes(cntxt->fdout, cntxt->nspace, mb, FALSE);
diff --git a/monetdb5/optimizer/opt_reorder.c b/monetdb5/optimizer/opt_reorder.c
--- a/monetdb5/optimizer/opt_reorder.c
+++ b/monetdb5/optimizer/opt_reorder.c
@@ -134,6 +134,11 @@ OPTdependencies(Client cntxt, MalBlkPtr 
sz += list[i]->used;
}
uselist = GDKzalloc(sizeof(int)*sz);
+   if (!uselist) {
+   GDKfree(list);
+   GDKfree(var);
+   return NULL;
+   }
 
for(i=0;istop; i++) {
if (list[i]->cnt) {
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
@@ -60,11 +60,11 @@ SQLgetColumnSize(sql_trans *tr, sql_colu
return size;
 }
 
-static lng 
+static lng
 SQLgetSpace(mvc *m, MalBlkPtr mb, int prepare)
 {
sql_trans *tr = m->session->tr;
-   lng size,space = 0, i; 
+   lng size,space = 0, i;
 
for (i = 0; i < mb->stop; i++) {
InstrPtr p = mb->stmt[i];
@@ -80,7 +80,7 @@ SQLgetSpace(mvc *m, MalBlkPtr mb, int pr
sql_table *t = 0;
sql_column *c = 0;
 
-   if (!s || strcmp(s->base.name, dt_schema) == 0) 
+

MonetDB: default - Merge with Dec2016

2017-01-19 Thread Martin Kersten
Changeset: df1239ee6ffb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df1239ee6ffb
Modified Files:
clients/Tests/exports.stable.out
geom/monetdb5/geom.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_runtime.c
monetdb5/mal/mal_runtime.h
sql/test/leaks/Tests/check1.stable.out
sql/test/leaks/Tests/check1.stable.out.int128
sql/test/leaks/Tests/check2.stable.out
sql/test/leaks/Tests/check2.stable.out.int128
sql/test/leaks/Tests/check3.stable.out
sql/test/leaks/Tests/check3.stable.out.int128
sql/test/leaks/Tests/check4.stable.out
sql/test/leaks/Tests/check4.stable.out.int128
sql/test/leaks/Tests/check5.stable.out
sql/test/leaks/Tests/check5.stable.out.int128
sql/test/leaks/Tests/drop3.stable.out
sql/test/leaks/Tests/drop3.stable.out.int128
sql/test/leaks/Tests/select1.stable.out.int128
sql/test/leaks/Tests/select2.stable.out.int128
sql/test/leaks/Tests/temp1.stable.out
sql/test/leaks/Tests/temp1.stable.out.int128
sql/test/leaks/Tests/temp2.stable.out
sql/test/leaks/Tests/temp2.stable.out.int128
sql/test/leaks/Tests/temp3.stable.out
sql/test/leaks/Tests/temp3.stable.out.int128
testing/process.py
Branch: default
Log Message:

Merge with Dec2016


diffs (truncated from 1312 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
@@ -2453,7 +2453,7 @@ str runMALsequence(Client cntxt, MalBlkP
 str runScenario(Client c);
 void runtimeProfileBegin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci, RuntimeProfile prof);
 void runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci, RuntimeProfile prof);
-void runtimeProfileFinish(Client cntxt, MalBlkPtr mb);
+void runtimeProfileFinish(Client cntxt, MalBlkPtr mb, MalStkPtr stk);
 void runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk);
 int safetyBarrier(InstrPtr p, InstrPtr q);
 str sampleRef;
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -2645,14 +2645,6 @@ wkbMLineStringToPolygon(wkb **geomWKB, s
}
}
 
-   //print areas
-   for (i = 0; i < itemsNum; i++) {
-   char *toStr = NULL;
-   int len = 0;
-   wkbTOSTR(&toStr, &len, linestringsWKB[i]);
-   GDKfree(toStr);
-   }
-
if (*flag == 0) {
//the biggest polygon is the external shell
GEOSCoordSeq coordSeq_external;
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -479,6 +479,7 @@ str runMALsequence(Client cntxt, MalBlkP
int stkpc = 0;
RuntimeProfileRecord runtimeProfile, runtimeProfileFunction;
lng lastcheck = 0;
+   int startedProfileQueue = 0;
 #define CHECKINTERVAL 1000 /* how often do we check for client disconnect */
runtimeProfile.ticks = runtimeProfileFunction.ticks = 0;
 
@@ -519,6 +520,7 @@ str runMALsequence(Client cntxt, MalBlkP
 
/* also produce event record for start of function */
if ( startpc == 1 &&  startpc < mb->stop ){
+   startedProfileQueue = 1;
runtimeProfileInit(cntxt, mb, stk);
runtimeProfileBegin(cntxt, mb, stk, getInstrPtr(mb,0), 
&runtimeProfileFunction);
mb->starttime = GDKusec();
@@ -769,7 +771,6 @@ str runMALsequence(Client cntxt, MalBlkP
ret = shutdownFactory(cntxt, mb);
runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
runtimeProfileExit(cntxt, mb, stk, getInstrPtr(mb,0), 
&runtimeProfileFunction);
-   runtimeProfileFinish(cntxt, mb);
if (pcicaller && garbageControl(getInstrPtr(mb, 0)))
garbageCollector(cntxt, mb, stk, TRUE);
if (cntxt->qtimeout && GDKusec()- mb->starttime > 
cntxt->qtimeout){
@@ -802,8 +803,6 @@ str runMALsequence(Client cntxt, MalBlkP
if( mb->stop <= 1)
continue;
runtimeProfileExit(cntxt, mb, stk, pci, &runtimeProfile);
-   if (ret != MAL_SUCCEED)
-   runtimeProfileFinish(cntxt, mb);
/* check for strong debugging after each MAL statement */
if ( pci->token != FACcall && ret== MAL_SUCCEED) {
for (i = 0; i < pci->retc; i++) {
@@ -1141,7 +1140,6 @@ str runMALsequence(Client cntxt, MalBlkP
if (stkpc == mb->stop) {
runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
r

MonetDB: default - Merge with Dec2016

2017-02-14 Thread Panagiotis Koutsourakis
Changeset: 0e6c17fca3ca for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=3Dchangeset;node=3D0e6c17fca3ca
Modified Files:
monetdb5/tools/Tests/mserver5--help.bat
monetdb5/tools/Tests/mserver5--help.stable.err.Windows
sql/backends/monet5/UDF/pyapi/convert_loops.h

sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err.Darwin

sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err.Windows
Branch: default
Log Message:

Merge with Dec2016


diffs (105 lines):

diff --git a/monetdb5/tools/Tests/mserver5--help.bat b/monetdb5/tools/Tests=
/mserver5--help.bat
--- a/monetdb5/tools/Tests/mserver5--help.bat
+++ b/monetdb5/tools/Tests/mserver5--help.bat
@@ -1,4 +1,4 @@
 @echo on
 @prompt # $t $g =20
=20
-   %MTIMEOUT% mserver5 --help
+   %MTIMEOUT% mserver5.exe --help
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows b/monet=
db5/tools/Tests/mserver5--help.stable.err.Windows
--- a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
@@ -5,11 +5,6 @@ stderr of test 'mserver5--help` in direc
 # 16:36:12 >  Mtimeout -timeout 300 ./mserver5--help mserver5--help=20
 # 16:36:12 > =20
=20
-
-# 16:36:12 > =20
-# 16:36:12 >  Mtimeout -timeout 60 mserver5 --config=3D --help
-# 16:36:12 > =20
-
 Usage: mserver5.exe [options] [scripts]
 --dbpath=3D  Specify database location
 --dbextra=3D Directory for transient BATs
diff --git a/sql/backends/monet5/UDF/pyapi/convert_loops.h b/sql/backends/m=
onet5/UDF/pyapi/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi/convert_loops.h
@@ -24,6 +24,37 @@
=20
 // This #define creates a new BAT with the internal data and mask from a N=
umpy array, without copying the data
 // 'bat' is a BAT* pointer, which will contain the new BAT. TYPE_'mtpe' is=
 the BAT type, and 'batstore' is the heap storage type of the BAT (this sho=
uld be STORE_CMEM or STORE_SHARED)
+#if defined(_MSC_VER) && _MSC_VER <=3D 1600
+#define isnan(x) _isnan(x)
+#endif
+
+#define nancheck_flt(bat)  
\
+   do {\
+   for (iu =3D 0; iu < ret->count; iu++) { \
+   if (isnan(((flt*)data)[index_offset * ret->count + 
iu])) { \
+   ((flt*)data)[index_offset * ret->count + iu] 
=3D flt_nil; \
+   bat->tnil =3D 1;
\
+   }   \
+   }   \
+   bat->tnonil =3D !bat->tnil; \
+   } while (0)
+#define nancheck_dbl(bat)  
\
+   do {\
+   for (iu =3D 0; iu < ret->count; iu++) { \
+   if (isnan(((dbl*)data)[index_offset * ret->count + 
iu])) { \
+   ((dbl*)data)[index_offset * ret->count + iu] 
=3D dbl_nil; \
+   bat->tnil =3D 1;
\
+   }   \
+   }   \
+   bat->tnonil =3D !bat->tnil; \
+   } while (0)
+#define nancheck_bit(bat) ((void) 0)
+#define nancheck_bte(bat) ((void) 0)
+#define nancheck_sht(bat) ((void) 0)
+#define nancheck_int(bat) ((void) 0)
+#define nancheck_lng(bat) ((void) 0)
+#define nancheck_hge(bat) ((void) 0) /* not used if no HAVE_HGE */
+#define nancheck_oid(bat) ((void) 0)
 #if defined (HAVE_FORK) && !defined(HAVE_EMBEDDED)
 #define CREATE_BAT_ZEROCOPY(bat, mtpe, batstore) {=
  \
 bat =3D COLnew(seqbase, TYPE_##mtpe, 0, TRANSIENT);   =
  \
@@ -43,6 +74,7 @@
 bat->tnonil =3D 1 - bat->tnil;=
\
 } else {  =
  \
 bat->tnil =3D 0; bat->tnonil =3D 0;   =
  \
+   nancheck_##mtpe(bat);\
 } =
  \
   =
  \
 /*When we create a BAT a small part of memory is allocated, free i=
t*/   \
@@ -90,6 +122,7 @@

MonetDB: default - merge with Dec2016

2017-02-26 Thread Niels Nes
Changeset: 4a0678a38a09 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a0678a38a09
Modified Files:
sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
sql/server/rel_rel.c

sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/remote/Tests/partition_elim.stable.out
Branch: default
Log Message:

merge with Dec2016


diffs (197 lines):

diff --git a/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out 
b/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
--- a/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
+++ b/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
@@ -35,7 +35,7 @@ Ready.
 #EXCEPT
 #SELECT qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen, seq, qual
 #FROM bam.alignments_73;
-% bam.L32, bam.L32,bam.L32,bam.L32,bam.L32,
bam.L32,bam.L32,bam.L32,bam.L32,bam.L32,
bam.L32 # table_name
+% bam.L33, bam.L33,bam.L33,bam.L33,bam.L33,
bam.L33,bam.L33,bam.L33,bam.L33,bam.L33,
bam.L33 # table_name
 % qname,   flag,   rname,  pos,mapq,   cigar,  rnext,  pnext,  tlen,   
seq,qual # name
 % clob,smallint,   clob,   int,smallint,   clob,   clob,   
int,int,clob,   clob # type
 % 0,   1,  0,  1,  1,  0,  0,  1,  1,  0,  
0 # length
@@ -54,7 +54,7 @@ Ready.
 #EXCEPT
 #SELECT qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen, seq, qual
 #FROM bam.alignments_74;
-% .L217,   .L217,  .L217,  .L217,  .L217,  .L217,  .L217,  .L217,  .L217,  
.L217,  .L217 # table_name
+% .L224,   .L224,  .L224,  .L224,  .L224,  .L224,  .L224,  .L224,  .L224,  
.L224,  .L224 # table_name
 % qname,   flag,   rname,  pos,mapq,   cigar,  rnext,  pnext,  tlen,   
seq,qual # name
 % clob,smallint,   clob,   int,smallint,   clob,   clob,   
int,int,clob,   clob # type
 % 0,   1,  0,  1,  1,  0,  0,  1,  1,  0,  
0 # length
diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -758,7 +758,7 @@ exps_has_nil(list *exps)
 list *
 rel_projections(mvc *sql, sql_rel *rel, const char *tname, int settname, int 
intern )
 {
-   list *rexps, *exps;
+   list *lexps, *rexps, *exps;
int intern_only = (intern==2)?1:0;
 
if (!rel || (is_subquery(rel) /*&& is_project(rel->op)*/ && rel->op == 
op_project))
@@ -806,15 +806,18 @@ rel_projections(mvc *sql, sql_rel *rel, 
}
return exps;
}
-   exps = rel_projections(sql, rel->l, tname, settname, intern );
-   if (exps) {
-   node *en;
+   lexps = rel_projections(sql, rel->l, tname, settname, intern );
+   rexps = rel_projections(sql, rel->r, tname, settname, intern );
+   exps = sa_list(sql->sa);
+   if (lexps && rexps && exps) {
+   node *en, *ren;
int label = ++sql->label;
-   for (en = exps->h; en; en = en->next) {
+   for (en = lexps->h, ren = rexps->h; en && ren; en = 
en->next, ren = ren->next) {
sql_exp *e = en->data;
e->card = rel->card;
if (!settname) /* noname use alias */
exp_setrelname(sql->sa, e, label);
+   append(exps, e);
}
}
return exps;
diff --git 
a/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
 
b/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
--- 
a/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
+++ 
b/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
@@ -74,10 +74,10 @@ project (
 | | | | table(sys.t2606b) [ t2606b.a ] COUNT 
 | | | ) [ t2606b.a ]
 | | ) [ t2606b.a ] [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
 #select * from t2606a   union   select * from t2606b   order by a;
-% .L10 # table_name
+% .L11 # table_name
 % a # name
 % int # type
 % 2 # length
@@ -107,10 +107,10 @@ project (
 | | | | table(sys.t2606b) [ t2606b.a ] COUNT 
 | | | ) [ t2606b.a ]
 | | ) [ t2606b.a ] [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.

MonetDB: default - Merge with Dec2016

2017-02-27 Thread Panagiotis Koutsourakis
Changeset: c0325da7d946 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0325da7d946
Modified Files:
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016


diffs (12 lines):

diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -1,7 +1,7 @@
 shutdown.Bug-6182
 avggroupbysq.Bug-6178
 semijoinunion.Bug-6150
-#HAVE_LIBZ?heapextend.Bug-6134
+HAVE_LIBZ?heapextend.Bug-6134
 incorrect_error.Bug-6141
 empty-interval.Bug-6184
 crash_in_null_cast.Bug-6186
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016

2017-03-24 Thread Panagiotis Koutsourakis
Changeset: 4af0978e96e1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4af0978e96e1
Added Files:

sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.sql

sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.err

sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.out
sql/test/orderidx/Tests/oidx_all_types.sql
sql/test/orderidx/Tests/oidx_all_types.stable.err
sql/test/orderidx/Tests/oidx_all_types.stable.out
sql/test/orderidx/Tests/oidx_hge_type.sql
sql/test/orderidx/Tests/oidx_hge_type.stable.err
sql/test/orderidx/Tests/oidx_hge_type.stable.out.int128
Modified Files:
sql/test/BugTracker-2017/Tests/All
sql/test/orderidx/Tests/All
Branch: default
Log Message:

Merge with Dec2016


diffs (truncated from 2329 to 300 lines):

diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -38,3 +38,4 @@ cast_boolean_to_string.Bug-6110
 modulo.Bug-6225
 one-plus-nil.Bug-6243
 with-alias-bug.6246
+crash_after_oidx_on_sys_statistics.Bug-6251
diff --git 
a/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.sql
 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.sql
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.sql
@@ -0,0 +1,20 @@
+DELETE FROM sys.statistics;
+
+-- fill sys.statistics
+ANALYZE sys.statistics;
+SELECT /*column_id,*/ type, width, /*stamp,*/ "sample", count, "unique", nils, 
/*minval,*/ /*maxval,*/ sorted, revsorted FROM sys.statistics ORDER BY 
column_id;
+
+-- update the values of: sample, count, unique, nils, minval, maxval, sorted, 
revsorted of sys.statistics
+ANALYZE sys.statistics;
+SELECT /*column_id,*/ type, width, /*stamp,*/ "sample", count, "unique", nils, 
/*minval,*/ /*maxval,*/ sorted, revsorted FROM sys.statistics ORDER BY 
column_id;
+
+-- ALTER TABLE sys.statistics SET READ ONLY;
+
+CREATE ORDERED INDEX stat_oidx ON sys.statistics (width);
+SELECT /*column_id,*/ type, width, /*stamp,*/ "sample", count, "unique", nils, 
/*minval,*/ /*maxval,*/ sorted, revsorted FROM sys.statistics ORDER BY 
column_id;
+-- now mserver5 is crashed !!
+
+-- ALTER TABLE sys.statistics SET READ WRITE;
+
+DELETE FROM sys.statistics;
+
diff --git 
a/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.err
 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.err
@@ -0,0 +1,39 @@
+stderr of test 'crash_after_oidx_on_sys_statistics.Bug-6251` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 17:38:14 >  
+# 17:38:14 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32740" "--set" 
"mapi_usock=/var/tmp/mtest-1294/.s.monetdb.32740" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2017"
 "--set" "embedded_r=yes" "--set" "embedded_py=true"
+# 17:38:14 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 32740
+# cmdline opt  mapi_usock = /var/tmp/mtest-1294/.s.monetdb.32740
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2017
+# cmdline opt  embedded_r = yes
+# cmdline opt  embedded_py = true
+# cmdline opt  gdk_debug = 536870922
+
+
+
+# 17:47:38 >  
+# 17:47:38 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1768" "--port=38565"
+# 17:47:38 >  
+
+
+
+# 17:38:15 >  
+# 17:38:15 >  "Done."
+# 17:38:15 >  
+
diff --git 
a/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.out
 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.stable.out
@@ -0,0 +1,129 @@
+stdout of test 'crash_after_oidx_on_sys_statistics.Bug-6251` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 17:38:14 >  
+# 17:38:14 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32740" "--set" 
"mapi_usock=/var/tmp/mtest-1294/.s.monetdb.32740" "

MonetDB: default - Merge with Dec2016 branch.

2016-10-14 Thread Sjoerd Mullender
Changeset: 25027e4c22ae for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25027e4c22ae
Added Files:
sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
sql/test/emptydb-upgrade/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.32bit
Modified Files:
sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/check.stable.out
sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
sql/test/emptydb-upgrade/Tests/check.stable.out
sql/test/emptydb-upgrade/Tests/check.stable.out.int128
sql/test/emptydb/Tests/All
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 14182 to 300 lines):

diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
@@ -39,10 +39,16 @@ Ready.
 \dSv
 \dSs
 \dSf
+\dn bam
 \dn json
 \dn profiler
 \dn sys
 \dn tmp
+\dSt bam.export
+\dSt bam.files
+\dSt bam.pg
+\dSt bam.rg
+\dSt bam.sq
 \dSt sys._columns
 \dSt sys._tables
 \dSt sys.args
@@ -55,6 +61,11 @@ Ready.
 \dSt sys.idxs
 \dSt sys.keys
 \dSt sys.keywords
+\dSt sys.netcdf_attrs
+\dSt sys.netcdf_dims
+\dSt sys.netcdf_files
+\dSt sys.netcdf_vardim
+\dSt sys.netcdf_vars
 \dSt sys.objects
 \dSt sys.privileges
 \dSt sys.schemas
@@ -94,6 +105,7 @@ Ready.
 \dSf sys."analyze"
 \dSf sys."bbp"
 \dSf sys."broadcast"
+\dSf sys."chi2prob"
 \dSf sys."clearrejects"
 \dSf sys."columnsize"
 \dSf sys."contains"
@@ -125,6 +137,8 @@ Ready.
 \dSf sys."environment"
 \dSf sys."epoch"
 \dSf sys."evalalgebra"
+\dSf sys."fitsattach"
+\dSf sys."fitsload"
 \dSf sys."flush_log"
 \dSf sys."fuse"
 \dSf sys."generate_series"
@@ -157,7 +171,12 @@ Ready.
 \dSf sys."isauuid"
 \dSf sys."left_shift"
 \dSf sys."left_shift_assign"
+\dSf sys."lidarattach"
+\dSf sys."lidarexport"
+\dSf sys."lidarload"
 \dSf sys."like"
+\dSf sys."listdir"
+\dSf sys."listdirpat"
 \dSf sys."malfunctions"
 \dSf sys."masklen"
 \dSf sys."mbr"
@@ -167,6 +186,8 @@ Ready.
 \dSf sys."ms_str"
 \dSf sys."ms_stuff"
 \dSf sys."ms_trunc"
+\dSf sys."netcdf_attach"
+\dSf sys."netcdf_importvar"
 \dSf sys."netmask"
 \dSf sys."network"
 \dSf sys."newurl"
@@ -194,6 +215,8 @@ Ready.
 \dSf sys."setmasklen"
 \dSf sys."setsession"
 \dSf sys."settimeout"
+\dSf sys."shpattach"
+\dSf sys."shpload"
 \dSf sys."shrink"
 \dSf sys."shutdown"
 \dSf sys."st_area"
@@ -308,6 +331,7 @@ Ready.
 \dSf sys."var"
 \dSf sys."var_pop"
 \dSf sys."var_samp"
+SYSTEM SCHEMA  bam
 SYSTEM SCHEMA  json
 SYSTEM SCHEMA profiler
 SYSTEM SCHEMA  sys
@@ -324,6 +348,11 @@ SYSTEM TABLE  sys.functions
 SYSTEM TABLE  sys.idxs
 SYSTEM TABLE  sys.keys
 SYSTEM TABLE  sys.keywords
+SYSTEM TABLE  sys.netcdf_attrs
+SYSTEM TABLE  sys.netcdf_dims
+SYSTEM TABLE  sys.netcdf_files
+SYSTEM TABLE  sys.netcdf_vardim
+SYSTEM TABLE  sys.netcdf_vars
 SYSTEM TABLE  sys.objects
 SYSTEM TABLE  sys.privileges
 SYSTEM TABLE  sys.schemas
@@ -380,6 +409,7 @@ SYSTEM FUNCTION sys.ceiling
 SYSTEM FUNCTION sys.char_length
 SYSTEM FUNCTION sys.character_length
 SYSTEM FUNCTION sys.charindex
+SYSTEM FUNCTION  sys.chi2prob
 SYSTEM FUNCTION  sys.clearrejects
 SYSTEM FUNCTION sys.code
 SYSTEM FUNCTION  sys.columnsize
@@ -435,6 +465,8 @@ SYSTEM FUNCTION  sys.epoch
 SYSTEM FUNCTION  sys.evalalgebra
 SYSTEM FUNCTION sys.exist
 SYSTEM FUNCTION sys.exp
+SYSTEM FUNCTION  sys.fitsattach
+SYSTEM FUNCTION  sys.fitsload
 SYSTEM FUNCTION sys.floor
 SYSTEM FUNCTION sys.flush_log
 SYSTEM FUNCTION  sys.fuse
@@ -481,7 +513,12 @@ SYSTEM FUNCTION  sys.left_shift
 SYSTEM FUNCTION  sys.left_shift_assign
 SYSTEM FUNCTION  sys.length
 SYSTEM FUNCTION sys.levenshtein
+SYSTEM FUNCTION  sys.lidarattach
+SYSTEM FUNCTION  sys.lidarexport
+SYSTEM FUNCTION  sys.lidarload
 SYSTEM FUNCTION  sys.like
+SYSTEM FUNCTION  sys.listdir
+SYSTEM FUNCTION  sys.listdirpat
 SYSTEM FUNCTION sys.local_timezone
 SYSTEM FUNCTION sys.localtime
 SYSTEM FUNCTION sys.localtimestamp
@@ -518,6 +555,8 @@ SYSTEM FUNCTION  sys.ms_round
 SYSTEM FUNCTION  sys.ms_str
 SYSTEM FUNCTION  sys.ms_stuff
 SYSTEM FUNCTION  sys.ms_trunc
+SYSTEM FUNCTION  sys.netcdf_attach
+SYSTEM FUNCTION  sys.netcdf_importvar
 SYSTEM FUNCTION  sys.netmask
 SYSTEM FUNCTION  sys.network
 SYSTEM FUNCTION  sys.newurl
@@ -574,6 +613,8 @@ SYSTEM FUNCTION  sys.sessions
 SYSTEM FUNCTION  sys.setmasklen
 SYSTEM FUNCTION  sys.setsession
 SYSTEM FUNCTION  sys.settimeout
+SYSTEM FUNCTION  sys.shpattach
+SYSTEM FUNCTION  sys.shpload
 SYSTEM FUNCTION  sys.shrink
 SYSTEM FUNCTION  sys.shutdown
 SYSTEM FUNCTION sys.sign
@@ -718,10 +759,16 @@ SYSTEM FUNCTION sys.weekofyear
 SYSTEM FUNCTION sys.xor
 S

MonetDB: default - Merge with Dec2016 branch.

2016-10-17 Thread Sjoerd Mullender
Changeset: 9adbe1674a73 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9adbe1674a73
Added Files:
sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql
sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.err
sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.out
Modified Files:
MonetDB.spec
gdk/gdk_calc.c
sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 335 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -361,8 +361,10 @@ Group: Applications/Databases
 Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release}
+%if (0%{?fedora} >= 22)
 Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
+%endif
 Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
 Requires: python-monetdb >= 1.0
 
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -13092,13 +13092,30 @@ VARcalcbetween(ValPtr ret, const ValReco
l += incr2; \
}   \
} while (0)
+#define IFTHENELSELOOP_oid()   \
+   do {\
+   for (i = 0; i < cnt; i++) { \
+   if (src[i] == bit_nil) {\
+   ((oid *) dst)[i] = oid_nil; \
+   nils++; \
+   } else if (src[i]) {\
+   ((oid *) dst)[i] = col1 ? ((oid *) col1)[k] : 
seq1; \
+   } else {\
+   ((oid *) dst)[i] = col2 ? ((oid *) col2)[k] : 
seq2; \
+   }   \
+   k += incr1; \
+   l += incr2; \
+   seq1 += incr1;  \
+   seq2 += incr2;  \
+   }   \
+   } while (0)
 
 static BAT *
 BATcalcifthenelse_intern(BAT *b,
 const void *col1, int incr1, const char *heap1,
-int width1, int nonil1,
+int width1, int nonil1, oid seq1,
 const void *col2, int incr2, const char *heap2,
-int width2, int nonil2,
+int width2, int nonil2, oid seq2,
 int tpe)
 {
BAT *bn;
@@ -13110,9 +13127,15 @@ BATcalcifthenelse_intern(BAT *b,
const bit *src;
BUN cnt = b->batCount;
 
-   assert(col2 != NULL);
-
-   bn = COLnew(b->hseqbase, tpe, cnt, TRANSIENT);
+   /* col1 and col2 can only be NULL for void columns */
+   assert(col1 != NULL || ATOMtype(tpe) == TYPE_oid);
+   assert(col2 != NULL || ATOMtype(tpe) == TYPE_oid);
+   assert(col1 != NULL || heap1 == NULL);
+   assert(col2 != NULL || heap2 == NULL);
+   assert(col1 != NULL || incr1 == 1);
+   assert(col2 != NULL || incr2 == 1);
+
+   bn = COLnew(b->hseqbase, ATOMtype(tpe), cnt, TRANSIENT);
if (bn == NULL)
return NULL;
 
@@ -13146,38 +13169,42 @@ BATcalcifthenelse_intern(BAT *b,
} else {
assert(heap1 == NULL);
assert(heap2 == NULL);
-   switch (bn->twidth) {
-   case 1:
-   IFTHENELSELOOP(bte);
-   break;
-   case 2:
-   IFTHENELSELOOP(sht);
-   break;
-   case 4:
-   IFTHENELSELOOP(int);
-   break;
-   case 8:
-   IFTHENELSELOOP(lng);
-   break;
-#ifdef HAVE_HGE
-   case 16:
-   IFTHENELSELOOP(hge);
-   break;
-#endif
-   default:
-   for (i = 0; i < cnt; i++) {
-   if (src[i] == bit_nil) {
-   p = nil;
-   nils++;
-   } else if (src[i]) {
-   p = ((const char *) col1) + k * width1;
-   } else {
-   p = ((const char *) col2) + l * width2;
+   if (ATOMtype(tpe) == TYP

MonetDB: default - Merge with Dec2016 branch.

2016-10-19 Thread Sjoerd Mullender
Changeset: 7a75706679ba for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a75706679ba
Modified Files:
clients/mapiclient/dotmonetdb.c
clients/mapiclient/dotmonetdb.h
clients/mapiclient/mclient.1
clients/mapiclient/mclient.c
clients/mapiclient/msqldump.c
clients/mapiclient/stethoscope.c
clients/mapiclient/tachograph.c
clients/mapiclient/tomograph.c
gdk/gdk_bbp.c
gdk/gdk_select.c
tools/merovingian/daemon/argvcmds.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/controlrunner.h
tools/merovingian/daemon/discoveryrunner.c
tools/merovingian/daemon/discoveryrunner.h
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/merovingian.h
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/daemon/proxy.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 945 to 300 lines):

diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -17,7 +17,7 @@
 #endif
 
 void
-parse_dotmonetdb(char **user, char **passwd, char **language, int 
*save_history, char **output, int *pagewidth)
+parse_dotmonetdb(char **user, char **passwd, char **dbname, char **language, 
int *save_history, char **output, int *pagewidth)
 {
char *cfile;
FILE *config = NULL;
@@ -52,6 +52,8 @@ parse_dotmonetdb(char **user, char **pas
*user = NULL;
if (passwd)
*passwd = NULL;
+   if (dbname)
+   *dbname = NULL;
if (language)
*language = NULL;
if (output)
@@ -88,6 +90,10 @@ parse_dotmonetdb(char **user, char **pas
if (passwd)
*passwd = strdup(q);
q = NULL;
+   } else if (strcmp(buf, "database") == 0) {
+   if (dbname)
+   *dbname = strdup(q);
+   q = NULL;
} else if (strcmp(buf, "language") == 0) {
/* make sure we don't set garbage */
if (strcmp(q, "sql") != 0 &&
diff --git a/clients/mapiclient/dotmonetdb.h b/clients/mapiclient/dotmonetdb.h
--- a/clients/mapiclient/dotmonetdb.h
+++ b/clients/mapiclient/dotmonetdb.h
@@ -6,5 +6,5 @@
  * Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
  */
 
-extern void parse_dotmonetdb(char **user, char **passwd, char **language,
+extern void parse_dotmonetdb(char **user, char **passwd, char **dbname, char 
**language,
 int *save_history, char **output, int *pagewidth);
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -72,6 +72,7 @@ This file can contain defaults for the f
 .BR user ,
 .BR password ,
 .BR language ,
+.BR database ,
 .BR save_history ,
 .BR format ,
 and
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3034,7 +3034,7 @@ main(int argc, char **argv)
 #endif
 
/* parse config file first, command line options override */
-   parse_dotmonetdb(&user, &passwd, &language, &save_history, &output, 
&pagewidth);
+   parse_dotmonetdb(&user, &passwd, &dbname, &language, &save_history, 
&output, &pagewidth);
pagewidthset = pagewidth != 0;
if (language) {
if (strcmp(language, "sql") == 0) {
@@ -3157,7 +3157,9 @@ main(int argc, char **argv)
break;
case 'd':
assert(optarg);
-   dbname = optarg;
+   if (dbname)
+   free(dbname);
+   dbname = strdup(optarg);
break;
case 's':
assert(optarg);
@@ -3255,7 +3257,7 @@ main(int argc, char **argv)
 
if (dbname == NULL && has_fileargs &&
(fp = fopen(argv[optind], "r")) == NULL) {
-   dbname = argv[optind];
+   dbname = strdup(argv[optind]);
optind++;
has_fileargs = optind != argc;
}
@@ -3271,6 +3273,9 @@ main(int argc, char **argv)
if (passwd)
free(passwd);
passwd = NULL;
+   if (dbname)
+   free(dbname);
+   dbname = NULL;
if (mid && mapi_error(mid) == MOK)
mapi_reconnect(mid);/* actually, initial connect */
 
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -

MonetDB: default - Merge with Dec2016 branch.

2016-10-19 Thread Sjoerd Mullender
Changeset: 37815014fb32 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37815014fb32
Modified Files:
configure.ag
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (16 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2600,8 +2600,11 @@ AC_MSG_CHECKING([__builtin_add_overflow]
 # to the runtime that contains the required function __muloti4.  Also
 # see https://llvm.org/bugs/show_bug.cgi?id=16404 which is a similar
 # issue.
+# Note that the program being compiled is complicated so that we work
+# around a too smart clang optimizer.
 AC_LINK_IFELSE(
-   [AC_LANG_PROGRAM([[]], [[__int128 a, b, c; __builtin_mul_overflow(a, b, 
&c);]])],
+   [AC_LANG_PROGRAM([[@%:@include 
+@%:@include ]], [[__int128 a=(__int128)atoll(getenv("a"))<<64, 
b=(__int128)atoll(getenv("b"))<<64, c; if (!__builtin_mul_overflow(a, b, &c)) 
printf("%lld %lld\n",(long long)(c>>64), (long long)c);]])],
[AC_DEFINE([HAVE___BUILTIN_ADD_OVERFLOW], 1,
[Define if you have the `__builtin_{add,sub,mul}_overflow' 
functions.])
 AC_MSG_RESULT(yes)],
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-10-20 Thread Sjoerd Mullender
Changeset: d5b040a51f58 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5b040a51f58
Removed Files:
tools/merovingian/daemon/peering.c
tools/merovingian/daemon/peering.h
Modified Files:
common/utils/msabaoth.c
common/utils/mutils.c
common/utils/mutils.h
monetdb5/modules/mal/mal_mapi.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/Makefile.ag
tools/merovingian/daemon/client.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/discoveryrunner.h
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/handlers.c
tools/merovingian/daemon/handlers.h
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/daemon/multiplex-funnel.h
tools/merovingian/daemon/proxy.c
tools/merovingian/utils/control.c
tools/merovingian/utils/utils.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1182 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
@@ -675,7 +675,7 @@ msab_getSingleStatus(const char *pathbuf
(void)fclose(f);
}
} else if ((snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
".gdk_lock") > 0) & /* no typo */
-  ((fd = MT_lockf(buf, F_TLOCK, 4, 1)) == -2)) {
+  ((fd = MT_lockf(buf, F_TEST, 4, 1)) == -2)) {
/* Locking failed; this can be because the lockfile couldn't
 * be created.  Probably there is no Mserver running for
 * that case also.
@@ -694,7 +694,7 @@ msab_getSingleStatus(const char *pathbuf
} else {
/* locking succeed, check for a crash in the uplog */
snprintf(log, sizeof(log), "%s/%s/%s", pathbuf, dbname, 
UPLOGFILE);
-   if ((f = fdopen(fd, "r+")) != NULL) {
+   if ((f = fopen(log, "r")) != NULL) {
(void)fseek(f, -1, SEEK_END);
if (fread(data, 1, 1, f) != 1) {
/* the log is empty, assume no crash */
@@ -704,12 +704,10 @@ msab_getSingleStatus(const char *pathbuf
} else { /* should be \t */
sdb->state = SABdbCrashed;
}
-   /* release the lock */
-   MT_lockf(buf, F_ULOCK, 4, 1);
(void)fclose(f);
} else {
-   /* shouldn't happen */
-   close(fd);
+   /* no uplog, so presumably never started */
+   sdb->state = SABdbInactive;
}
}
snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
MAINTENANCEFILE);
diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -356,6 +356,13 @@ MT_lockf(char *filename, int mode, off_t
ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
} else if (mode == F_LOCK) {
ret = LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
+   } else if (mode == F_TEST) {
+   ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
+   if (ret != 0) {
+   UnlockFileEx(fh, 0, len, 0, &ov);
+   close(fd);
+   return 0;
+   }
} else {
close(fd);
errno = EINVAL;
@@ -408,6 +415,7 @@ lockf(int fd, int cmd, off_t len)
 #endif
 /* returns -1 when locking failed,
  * returns -2 when the lock file could not be opened/created
+ * returns 0 when mode is F_TEST and the lock file was not locked
  * returns the (open) file descriptor to the file when locking
  * returns 0 when unlocking */
 int
@@ -420,7 +428,7 @@ MT_lockf(char *filename, int mode, off_t
 
if (lseek(fd, off, SEEK_SET) >= 0 &&
lockf(fd, mode, len) == 0) {
-   if (mode == F_ULOCK) {
+   if (mode == F_ULOCK || mode == F_TEST) {
close(fd);
return 0;
}
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -56,9 +56,10 @@ mutils_export char *dirname(char *path);
 
 #define MONETDB_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | 
S_IWOTH)
 
-#define F_TLOCK 2  /* test and lock a region for exclusive use */
-#define F_ULOCK 0  /* unlock a previously locked region */
-#define F_LOCK 1   /* lock a region for exclusive use */
+#define F_TEST 3   /* test a region for other processes lo

MonetDB: default - Merge with Dec2016 branch.

2016-10-24 Thread Sjoerd Mullender
Changeset: 5b8fcbe74694 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b8fcbe74694
Modified Files:
common/utils/msabaoth.c
sql/benchmarks/tpch/Tests/01-explain.stable.out
sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
sql/benchmarks/tpch/Tests/01-plan.stable.out
sql/benchmarks/tpch/Tests/03-explain.stable.out
sql/benchmarks/tpch/Tests/03-plan.stable.out
sql/benchmarks/tpch/Tests/05-explain.stable.out
sql/benchmarks/tpch/Tests/05-plan.stable.out
sql/benchmarks/tpch/Tests/06-explain.stable.out
sql/benchmarks/tpch/Tests/06-plan.stable.out
sql/benchmarks/tpch/Tests/07-explain.stable.out
sql/benchmarks/tpch/Tests/07-plan.stable.out
sql/benchmarks/tpch/Tests/08-explain.stable.out
sql/benchmarks/tpch/Tests/08-plan.stable.out
sql/benchmarks/tpch/Tests/09-explain.stable.out
sql/benchmarks/tpch/Tests/09-plan.stable.out
sql/benchmarks/tpch/Tests/10-explain.stable.out
sql/benchmarks/tpch/Tests/10-plan.stable.out
sql/benchmarks/tpch/Tests/11-explain.stable.out
sql/benchmarks/tpch/Tests/11-plan.stable.out
sql/benchmarks/tpch/Tests/14-explain.stable.out
sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
sql/benchmarks/tpch/Tests/14-plan.stable.out
sql/benchmarks/tpch/Tests/15-explain.stable.out
sql/benchmarks/tpch/Tests/15-plan.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out.int128
sql/benchmarks/tpch/Tests/17-plan.stable.out
sql/benchmarks/tpch/Tests/18-plan.stable.out
sql/benchmarks/tpch/Tests/19-explain.stable.out
sql/benchmarks/tpch/Tests/19-plan.stable.out
sql/benchmarks/tpch/Tests/20-explain.stable.out.int128
sql/benchmarks/tpch/Tests/20-plan.stable.out
tools/merovingian/daemon/client.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/discoveryrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/handlers.c
tools/merovingian/daemon/handlers.h
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/merovingian.h
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/utils/properties.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 2095 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
@@ -594,6 +594,85 @@ msab_getSingleStatus(const char *pathbuf
sdb->path = strdup(buf);
sdb->dbname = sdb->path + strlen(sdb->path) - strlen(dbname);
 
+
+   /* check the state of the server by looking at its gdk lock:
+* - if we can lock it, the server has crashed or isn't running
+* - if we can't open it because it's locked, the server is
+*   running
+* - to distinguish between a crash and proper shutdown, consult
+*   the uplog
+* - one exception to all above; if this is the same process, we
+*   cannot lock (it always succeeds), hence, if we have the
+*   same signature, we assume running if the uplog states so.
+*/
+   snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname,
+_sabaoth_internal_uuid);
+   if (stat(buf, &statbuf) != -1) {
+   /* database has the same process signature as ours, which
+* means, it must be us, rely on the uplog state */
+   snprintf(log, sizeof(log), "%s/%s/%s", pathbuf, dbname, 
UPLOGFILE);
+   if ((f = fopen(log, "r")) != NULL) {
+   (void)fseek(f, -1, SEEK_END);
+   if (fread(data, 1, 1, f) != 1) {
+   /* the log is empty, assume no crash */
+   sdb->state = SABdbInactive;
+   } else if (data[0] == '\t') {
+   /* see if the database has finished starting */
+   snprintf(buf, sizeof(buf), "%s/%s/%s",
+pathbuf, dbname, STARTEDFILE);
+   if (stat(buf, &statbuf) == -1) {
+   sdb->state = SABdbStarting;
+   } else {
+   sdb->state = SABdbRunning;
+   }
+   } else { /* should be \n */
+   sdb->state = SABdbInactive;
+   }
+   (void)fclose(f);
+   }
+   } else if ((snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
".gdk_lock") > 0) & /* no typo */
+  ((fd = MT_lockf(buf, F_TEST, 4, 1)) 

MonetDB: default - Merge with Dec2016 branch.

2016-10-24 Thread Sjoerd Mullender
Changeset: a758d241b149 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a758d241b149
Modified Files:
tools/merovingian/daemon/controlrunner.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (46 lines):

diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -930,6 +930,17 @@ control_handleclient(const char *host, i
ctl_handle_client(host, sock, fdin, fout);
 }
 
+static void *
+handle_client(void *p)
+{
+   int msgsock = * (int *) p;
+
+   ctl_handle_client("(local)", msgsock, NULL, NULL);
+   shutdown(msgsock, SHUT_RDWR);
+   closesocket(msgsock);
+   return NULL;
+}
+
 void *
 controlRunner(void *d)
 {
@@ -939,7 +950,7 @@ controlRunner(void *d)
fd_set fds;
struct timeval tv;
int msgsock;
-   char origin[128];
+   pthread_t tid;
 
do {
FD_ZERO(&fds);
@@ -975,11 +986,10 @@ controlRunner(void *d)
continue;
}
 
-   snprintf(origin, sizeof(origin), "(local)");
-
-   ctl_handle_client(origin, msgsock, NULL, NULL);
-   shutdown(msgsock, SHUT_RDWR);
-   closesocket(msgsock);
+   if (pthread_create(&tid, NULL, handle_client, &msgsock) != 0)
+   closesocket(msgsock);
+   else
+   pthread_detach(tid);
} while (_mero_keep_listening);
shutdown(usock, SHUT_RDWR);
closesocket(usock);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-10-24 Thread Sjoerd Mullender
Changeset: 2da88381f776 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2da88381f776
Modified Files:
tools/merovingian/daemon/handlers.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (13 lines):

diff --git a/tools/merovingian/daemon/handlers.c 
b/tools/merovingian/daemon/handlers.c
--- a/tools/merovingian/daemon/handlers.c
+++ b/tools/merovingian/daemon/handlers.c
@@ -76,7 +76,8 @@ handler(int sig)
strcpy(buf + 7, "some signal");
}
strcpy(buf + strlen(buf), ", starting shutdown sequence\n");
-   write(1, buf, strlen(buf));
+   if (write(1, buf, strlen(buf)) < 0)
+   perror("write failed");
_mero_keep_listening = 0;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-10-25 Thread Sjoerd Mullender
Changeset: f2e4890a3eca for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f2e4890a3eca
Modified Files:
gdk/gdk_logger.c
tools/merovingian/daemon/controlrunner.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (91 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1377,8 +1377,6 @@ logger_load(int debug, const char* fn, c
/* this is intentional - even if catalog_bid is 0, but the logger is 
shared,
 * force it to find the persistent catalog */
if (catalog_bid == 0 && !lg->shared) {
-   log_bid bid = 0;
-
/* catalog does not exist, so the log file also
 * shouldn't exist */
if (fp != NULL) {
@@ -1401,22 +1399,19 @@ logger_load(int debug, const char* fn, c
 
/* give the catalog bats names so we can find them
 * next time */
-   bid = lg->catalog_bid->batCacheid;
-   BBPincref(bid, TRUE);
+   BBPincref(lg->catalog_bid->batCacheid, TRUE);
snprintf(bak, sizeof(bak), "%s_catalog_bid", fn);
if (BBPrename(lg->catalog_bid->batCacheid, bak) < 0)
logger_fatal("logger_load: BBPrename to %s failed",
 bak, 0, 0);
 
-   bid = lg->catalog_nme->batCacheid;
-   BBPincref(bid, TRUE);
+   BBPincref(lg->catalog_nme->batCacheid, TRUE);
snprintf(bak, sizeof(bak), "%s_catalog_nme", fn);
if (BBPrename(lg->catalog_nme->batCacheid, bak) < 0)
logger_fatal("logger_load: BBPrename to %s failed",
 bak, 0, 0);
 
-   bid = lg->dcatalog->batCacheid;
-   BBPincref(bid, TRUE);
+   BBPincref(lg->dcatalog->batCacheid, TRUE);
snprintf(bak, sizeof(bak), "%s_dcatalog", fn);
if (BBPrename(lg->dcatalog->batCacheid, bak) < 0)
logger_fatal("logger_load: BBPrename to %s failed",
@@ -1484,7 +1479,6 @@ logger_load(int debug, const char* fn, c
if (d == NULL)
logger_fatal("Logger_new: cannot create "
 "dcatalog bat", 0, 0, 0);
-   BBPincref(d->batCacheid, TRUE);
if (BBPrename(d->batCacheid, bak) < 0)
logger_fatal("logger_load: BBPrename to %s 
failed", bak, 0, 0);
}
@@ -1503,6 +1497,9 @@ logger_load(int debug, const char* fn, c
lg->catalog_bid = b;
lg->catalog_nme = n;
lg->dcatalog = d;
+   BBPincref(lg->catalog_bid->batCacheid, TRUE);
+   BBPincref(lg->catalog_nme->batCacheid, TRUE);
+   BBPincref(lg->dcatalog->batCacheid, TRUE);
BATloop(b, p, q) {
bat bid = *(log_bid *) Tloc(b, p);
oid pos = p;
diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -338,13 +338,17 @@ static void ctl_handle_client(
dp = _mero_topdp->next; /* don't need the 
console/log */
while (dp != NULL) {
if (dp->type == MERODB && 
strcmp(dp->dbname, q) == 0) {
-   
pthread_mutex_unlock(&_mero_topdp_lock);
if (strcmp(p, "stop") == 0) {
-   
terminateProcess(dp->pid, strdup(dp->dbname), dp->type, 1);
+   pid_t pid = dp->pid;
+   char *dbname = 
strdup(dp->dbname);
+   mtype type = dp->type;
+   
pthread_mutex_unlock(&_mero_topdp_lock);
+   terminateProcess(pid, 
dbname, type, 1);
Mfprintf(_mero_ctlout, 
"%s: stopped "

"database '%s'\n", origin, q);
} else {
kill(dp->pid, SIGKILL);
+   
pthread_mutex_unlock(&_mero_topdp_lock);
Mfprintf(_mero_ctlout, 
"%s: killed "

"database '%s'\n", origin, q);
}
@@ -3

MonetDB: default - Merge with Dec2016 branch.

2016-10-26 Thread Sjoerd Mullender
Changeset: fff62b74bd61 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fff62b74bd61
Modified Files:
debian/monetdb5-sql.init.d
tools/merovingian/daemon/argvcmds.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (125 lines):

diff --git a/debian/monetdb5-sql.init.d b/debian/monetdb5-sql.init.d
--- a/debian/monetdb5-sql.init.d
+++ b/debian/monetdb5-sql.init.d
@@ -37,16 +37,16 @@ set -e
 init() {
 if [ ! -d ${DBFARM} ]; then
 mkdir ${DBFARM}
-   echo "${DBFARM} doesn't exist, creating..."
+   echo "${DBFARM} doesn't exist, creating..."
 fi
 
-   chown -R monetdb.monetdb ${DBFARM}
-   chmod 770 ${DBFARM}
+chown -R monetdb.monetdb ${DBFARM}
+chmod 770 ${DBFARM}
 
-   if [ ! -f ${DBFARM}/.merovingian_properties ]; then
-   echo "${DBFARM} not initialized, initializing..."
-   sudo -u monetdb ${DAEMON} create ${DBFARM} || exit 1
-   fi
+if [ ! -f ${DBFARM}/.merovingian_properties ]; then
+   echo "${DBFARM} not initialized, initializing..."
+   sudo -u monetdb ${DAEMON} create ${DBFARM} || exit 1
+fi
 }
 
 running_pid() {
@@ -70,42 +70,41 @@ running() {
 }
 
 case "$1" in
-  start)
-if [ "$STARTUP" != "yes" ]; then
-echo "can't start, should be enabled first by changing STARTUP to 
yes in /etc/default/monetdb5-sql"
-exit 0
-fi
+start)
+if [ "$STARTUP" != "yes" ]; then
+echo "can't start, should be enabled first by changing STARTUP to yes 
in /etc/default/monetdb5-sql"
+exit 0
+fi
 
-if running; then
-echo "$NAME is already running"
-exit 0
-fi
+if running; then
+echo "$NAME is already running"
+exit 0
+fi
 
-init
+init
 
-echo -n "Starting $DESC: "
-start-stop-daemon --start --exec $DAEMON -c monetdb:monetdb -- start 
$DAEMON_OPTS $DBFARM
-if running ; then
-echo "$NAME."
-else
-echo " ERROR, $NAME didn't start"
-fi
-;;
-  stop)
-if running ;  then
-echo -n "Stopping $DESC: "
-start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON -c 
monetdb:monetdb -- stop ${DBFARM}
-echo "$NAME."
-   else
-   echo "$NAME not running."
-fi
-;;
-  restart)
-$0 stop
-sleep 5
-$0 start
-;;
-  status)
+echo -n "Starting $DESC: "
+start-stop-daemon --start --exec $DAEMON -c monetdb:monetdb -- start 
$DAEMON_OPTS $DBFARM
+if running ; then
+echo "$NAME."
+else
+echo " ERROR, $NAME didn't start"
+fi
+;;
+stop)
+if running ;  then
+echo -n "Stopping $DESC: "
+start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --retry 60 
--signal TERM
+echo "$NAME."
+else
+   echo "$NAME not running."
+fi
+;;
+restart)
+$0 stop
+$0 start
+;;
+status)
 echo -n "$NAME is "
 if running ;  then
 echo "running"
@@ -114,7 +113,7 @@ case "$1" in
 exit 1
 fi
 ;;
-  *)
+*)
 echo "Usage: $0 {start|stop|restart|status}" >&2
 exit 1
 ;;
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
@@ -501,8 +501,8 @@ command_stop(confkeyval *ckv, int argc, 
return(1);
}
 
-   /* wait up to 5 seconds for monetdbd to actually stop */
-   for (i = 0; i < 10; i++) {
+   /* wait up to 30 seconds for monetdbd to actually stop */
+   for (i = 0; i < 60; i++) {
tv.tv_sec = 0;
tv.tv_usec = 50;
select(0, NULL, NULL, NULL, &tv);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-10-27 Thread Sjoerd Mullender
Changeset: 30504820f792 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=30504820f792
Modified Files:
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.int128
clients/Tests/exports.stable.out
gdk/ChangeLog.Dec2016
gdk/gdk_atoms.c
gdk/gdk_atoms.h
gdk/gdk_calc.c
monetdb5/modules/mal/00_batcalc_hge.mal
monetdb5/modules/mal/00_batcalc_hge.mal.sh
monetdb5/modules/mal/00_calc_hge.mal
monetdb5/modules/mal/00_calc_hge.mal.sh
monetdb5/modules/mal/01_batcalc.mal
monetdb5/modules/mal/01_batcalc.mal.sh
monetdb5/modules/mal/01_calc.mal
monetdb5/modules/mal/01_calc.mal.sh
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/check.stable.out
sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
sql/test/emptydb-upgrade/Tests/check.stable.out
sql/test/emptydb-upgrade/Tests/check.stable.out.32bit
sql/test/emptydb-upgrade/Tests/check.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/emptydb/Tests/load.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
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
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 Dec2016 branch.


diffs (truncated from 1416 to 300 lines):

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
@@ -7543,47 +7543,11 @@ Ready.
 [ "batcalc",   "sign", "pattern batcalc.sign(b:bat[:sht]):bat[:bte] ", 
"CMDbatSIGN;",  "Unary sign (-1,0,1) over the tail of the bat"  ]
 [ "batcalc",   "sign", "pattern 
batcalc.sign(b:bat[:sht],s:bat[:oid]):bat[:bte] ", "CMDbatSIGN;",  "Unary 
sign (-1,0,1) over the tail of the bat with candidates list" ]
 [ "batcalc",   "sqlblob",  "command 
batcalc.sqlblob(v:bat[:str]):bat[:sqlblob] ",  "batstr_2_sqlblob;","cast to 
sqlblob"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:bit]):bat[:str] ",  
"CMDconvertsignal_str;","cast from bit to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:bit],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from bit to str with candidates 
list, signal error on overflow"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:bte]):bat[:str] ",  
"CMDconvertsignal_str;","cast from bte to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:bte],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from bte to str with candidates 
list, signal error on overflow"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:dbl]):bat[:str] ",  
"CMDconvertsignal_str;","cast from dbl to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:dbl],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from dbl to str with candidates 
list, signal error on overflow"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:flt]):bat[:str] ",  
"CMDconvertsignal_str;","cast from flt to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:flt],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from flt to str with candidates 
list, signal error on overflow"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:hge]):bat[:str] ",  
"CMDconvertsignal_str;","cast from hge to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:hge],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from hge to str with candidates 
list, signal error on overflow"   ]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:int]):bat[:str] ",  
"CMDconvertsignal_str;","cast from int to str, signal error on 
overflow"]
-[ "batcalc",   "str",  "pattern batcalc.str(b:bat[:int],s:bat[:oid]):bat[:str] 
",  "CMDconvertsignal_str;","cast from int to str with candidates 
list

MonetDB: default - Merge with Dec2016 branch.

2016-10-31 Thread Sjoerd Mullender
Changeset: b5db3aa89b84 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b5db3aa89b84
Removed Files:

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows.single

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.single
sql/benchmarks/ssbm/Tests/01-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/01-explain.reqtests
sql/benchmarks/ssbm/Tests/01-explain.stable.err
sql/benchmarks/ssbm/Tests/01-explain.stable.out
sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/01-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/01-plan.reqtests
sql/benchmarks/ssbm/Tests/01-plan.stable.err
sql/benchmarks/ssbm/Tests/01-plan.stable.out
sql/benchmarks/ssbm/Tests/02-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/02-explain.reqtests
sql/benchmarks/ssbm/Tests/02-explain.stable.err
sql/benchmarks/ssbm/Tests/02-explain.stable.out
sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/02-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/02-plan.reqtests
sql/benchmarks/ssbm/Tests/02-plan.stable.err
sql/benchmarks/ssbm/Tests/02-plan.stable.out
sql/benchmarks/ssbm/Tests/03-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/03-explain.reqtests
sql/benchmarks/ssbm/Tests/03-explain.stable.err
sql/benchmarks/ssbm/Tests/03-explain.stable.out
sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/03-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/03-plan.reqtests
sql/benchmarks/ssbm/Tests/03-plan.stable.err
sql/benchmarks/ssbm/Tests/03-plan.stable.out
sql/benchmarks/ssbm/Tests/04-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/04-explain.reqtests
sql/benchmarks/ssbm/Tests/04-explain.stable.err
sql/benchmarks/ssbm/Tests/04-explain.stable.out
sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/04-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/04-plan.reqtests
sql/benchmarks/ssbm/Tests/04-plan.stable.err
sql/benchmarks/ssbm/Tests/04-plan.stable.out
sql/benchmarks/ssbm/Tests/05-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/05-explain.reqtests
sql/benchmarks/ssbm/Tests/05-explain.stable.err
sql/benchmarks/ssbm/Tests/05-explain.stable.out
sql/benchmarks/ssbm/Tests/05-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/05-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/05-plan.reqtests
sql/benchmarks/ssbm/Tests/05-plan.stable.err
sql/benchmarks/ssbm/Tests/05-plan.stable.out
sql/benchmarks/ssbm/Tests/06-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/06-explain.reqtests
sql/benchmarks/ssbm/Tests/06-explain.stable.err
sql/benchmarks/ssbm/Tests/06-explain.stable.out
sql/benchmarks/ssbm/Tests/06-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/06-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/06-plan.reqtests
sql/benchmarks/ssbm/Tests/06-plan.stable.err
sql/benchmarks/ssbm/Tests/06-plan.stable.out
sql/benchmarks/ssbm/Tests/07-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/07-explain.reqtests
sql/benchmarks/ssbm/Tests/07-explain.stable.err
sql/benchmarks/ssbm/Tests/07-explain.stable.out
sql/benchmarks/ssbm/Tests/07-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/07-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/07-plan.reqtests
sql/benchmarks/ssbm/Tests/07-plan.stable.err
sql/benchmarks/ssbm/Tests/07-plan.stable.out
sql/benchmarks/ssbm/Tests/08-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/08-explain.reqtests
sql/benchmarks/ssbm/Tests/08-explain.stable.err
sql/benchmarks/ssbm/Tests/08-explain.stable.out
sql/benchmarks/ssbm/Tests/08-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/08-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/08-plan.reqtests
sql/benchmarks/ssbm/Tests/08-plan.stable.err
sql/benchmarks/ssbm/Tests/08-plan.stable.out
sql/benchmarks/ssbm/Tests/09-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/09-explain.reqtests
sql/benchmarks/ssbm/Tests/09-explain.stable.err
sql/benchmarks/ssbm/Tests/09-explain.stable.out
sql/benchmarks/ssbm/Tests/09-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/09-plan.SQL.py.src
sql/benchmarks/ssbm/Tests/09-plan.reqtests
sql/benchmarks/ssbm/Tests/09-plan.stable.err
sql/benchmarks/ssbm/Tests/09-plan.stable.out
sql/benchmarks/ssbm/Tests/10-explain.SQL.py.src
sql/benchmarks/ssbm/Tests/10-explain.reqtests
sql/benchmarks/ssbm/Tests/10-explain.stable.err
sql/benchmarks/ssbm/Tests/10-explain.stable.out
sql/benchm

MonetDB: default - Merge with Dec2016 branch.

2016-11-01 Thread Sjoerd Mullender
Changeset: 7ae910ab6c3f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ae910ab6c3f
Modified Files:
monetdb5/modules/kernel/bat5.c
sql/backends/monet5/Tests/pyapi10.stable.err
sql/backends/monet5/Tests/pyapi10.stable.out
sql/backends/monet5/Tests/pyapi25.stable.err
sql/backends/monet5/Tests/pyapi25.stable.out
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/server/rel_updates.c

sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (204 lines):

diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -1056,7 +1056,7 @@ BKCshrinkBAT(bat *ret, const bat *bid, c
BBPunfix(b->batCacheid);
throw(MAL, "bat.shrink", RUNTIME_OBJECT_MISSING);
}
-   bn= COLnew(0, b->ttype, BATcount(b) - BATcount(d) , TRANSIENT);
+   bn= COLnew(0, b->ttype, BATcount(b) - BATcount(d), b->batRole);
if (bn == NULL) {
BBPunfix(b->batCacheid);
BBPunfix(d->batCacheid);
@@ -1221,7 +1221,7 @@ BKCreuseBAT(bat *ret, const bat *bid, co
BBPunfix(b->batCacheid);
throw(MAL, "bat.reuse", RUNTIME_OBJECT_MISSING);
}
-   bn= COLnew(b->hseqbase, b->ttype, BATcount(b) - BATcount(d), TRANSIENT);
+   bn= COLnew(b->hseqbase, b->ttype, BATcount(b) - BATcount(d), 
b->batRole);
if (bn == NULL) {
BBPunfix(b->batCacheid);
BBPunfix(d->batCacheid);
diff --git a/sql/backends/monet5/Tests/pyapi10.stable.err 
b/sql/backends/monet5/Tests/pyapi10.stable.err
--- a/sql/backends/monet5/Tests/pyapi10.stable.err
+++ b/sql/backends/monet5/Tests/pyapi10.stable.err
@@ -33,7 +33,7 @@ stderr of test 'pyapi10` in directory 's
 
 MAPI  = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
 QUERY = SELECT AVG(pyapi10_error(i,j)) FROM pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Could not parse Python code
+ERROR = !Could not parse Python code
 !  
 !  1. def pyfun(i,j,_columns,_column_types,_conn):
 !> 2. return(i*j 
@@ -41,7 +41,7 @@ ERROR = !MALException:pyapi.eval:Could n
 !invalid syntax (, line 2)
 MAPI  = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
 QUERY = SELECT AVG(pyapi10_indentation_error(i,j)) FROM 
pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Could not parse Python code
+ERROR = !Could not parse Python code
 !  7. f = 6
 !  8. g = 7
 !> 9. h = 8
@@ -50,7 +50,7 @@ ERROR = !MALException:pyapi.eval:Could n
 !unexpected indent (, line 9)
 MAPI  = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
 QUERY = SELECT AVG(pyapi10_runtime_exception(i,j)) FROM 
pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Python exception
+ERROR = !Python exception
 !  4.   mydivision = 0
 !  5.   # comments
 !> 6.   hello = myint / mydivision
diff --git a/sql/backends/monet5/Tests/pyapi10.stable.out 
b/sql/backends/monet5/Tests/pyapi10.stable.out
--- a/sql/backends/monet5/Tests/pyapi10.stable.out
+++ b/sql/backends/monet5/Tests/pyapi10.stable.out
@@ -65,14 +65,14 @@ Ready.
 #return(i*j 
 #};
 #SELECT AVG(pyapi10_mult(i,j)) FROM pyapi10_random_table(5000);
-% .L3 # table_name
-% L2 # name
+% .L6 # table_name
+% L5 # name
 % double # type
 % 24 # length
 [ 2487.9556]
 #SELECT AVG(pyapi10_mult(i,j)) FROM pyapi10_random_table_nulls(5000);
-% .L3 # table_name
-% L2 # name
+% .L6 # table_name
+% L5 # name
 % double # type
 % 24 # length
 [ 5603.14638   ]
diff --git a/sql/backends/monet5/Tests/pyapi25.stable.err 
b/sql/backends/monet5/Tests/pyapi25.stable.err
--- a/sql/backends/monet5/Tests/pyapi25.stable.err
+++ b/sql/backends/monet5/Tests/pyapi25.stable.err
@@ -34,7 +34,13 @@ stderr of test 'pyapi25` in directory 's
 MAPI  = (monetdb) /var/tmp/mtest-14818/.s.monetdb.37353
 QUERY = SELECT * FROM pyapi25errortable();
 ERROR = !SELECT: no such table 'hopefullynonexistanttable'
-!SELECT: no such table 'hopefullynonexistanttable'
+!Python exception
+!
+!  1. def pyfun(_columns,_column_types,_conn):
+!> 2.   _conn.execute('SELECT * FROM HOPEFULLYNONEXISTANTTABLE;')
+!  3.   return 1
+!  4. 
+!SQL Query Failed: ParseException:SQLparser:42S02!SELECT: no such 
table 'hopefullynonexistanttable'
 
 # 12:40:01 >  
 # 12:40:01 >  "Done."
diff --git a/sql/backends/monet5/Tests/pyapi25.stable.out 
b/sql/backends/monet5/Tests/pyapi25.stable.out
--- a/sql/backends/monet5/Tests/pyapi25.stable.out
+++ b/sql/backends/monet5/Tests/pyapi25.stable.out
@@ -81,8 +81,8 @@ Great success!
 #return res['i'] * i
 #};
 #SELECT pyapi25(i) FROM pyapi25table; #multiply by 3
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % in

MonetDB: default - Merge with Dec2016 branch.

2016-11-04 Thread Sjoerd Mullender
Changeset: a98a4bd12842 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a98a4bd12842
Added Files:
sql/test/BugTracker-2016/Tests/crash.Bug-6081.sql
sql/test/BugTracker-2016/Tests/crash.Bug-6081.stable.err
sql/test/BugTracker-2016/Tests/crash.Bug-6081.stable.out
Modified Files:
clients/Tests/exports.stable.out
monetdb5/ChangeLog.Dec2016
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_instruction.h
monetdb5/mal/mal_type.c
monetdb5/mal/mal_type.h
sql/backends/monet5/sql_gencode.c
sql/common/sql_mem.c
sql/server/rel_optimizer.c
sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (291 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
@@ -2066,7 +2066,7 @@ str generatorRef;
 MALfcn getAddress(stream *out, str filename, str fcnname, int silent);
 str getArgDefault(MalBlkPtr mb, InstrPtr p, int idx);
 ptr getArgReference(MalStkPtr stk, InstrPtr pci, int k);
-int getAtomIndex(str nme, int len, int deftpe);
+int getAtomIndex(const char *nme, int len, int deftpe);
 lng getBatSpace(BAT *b);
 int getBitConstant(MalBlkPtr mb, bit val);
 int getBlockBegin(MalBlkPtr mb, int pc);
@@ -2344,7 +2344,7 @@ str projectionRef;
 str projectionpathRef;
 void promptInstruction(stream *fd, MalBlkPtr mb, MalStkPtr stk, InstrPtr p, 
int flg);
 InstrPtr pushArgument(MalBlkPtr mb, InstrPtr p, int varid);
-InstrPtr pushArgumentId(MalBlkPtr mb, InstrPtr p, str name);
+InstrPtr pushArgumentId(MalBlkPtr mb, InstrPtr p, const char *name);
 InstrPtr pushBit(MalBlkPtr mb, InstrPtr q, bit val);
 InstrPtr pushBte(MalBlkPtr mb, InstrPtr q, bte val);
 InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, dbl val);
diff --git a/monetdb5/ChangeLog.Dec2016 b/monetdb5/ChangeLog.Dec2016
--- a/monetdb5/ChangeLog.Dec2016
+++ b/monetdb5/ChangeLog.Dec2016
@@ -22,7 +22,7 @@
   where "wrd" was used.
 
 * Wed Apr  6 2016 Martin Kersten 
-- Keep a collection of full traces Each time the SQL user applies
+- Keep a collection of full traces.  Each time the SQL user applies
   the TRACE option, the full json trace is retained within the
   //sql_traces
 
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -1359,22 +1359,19 @@ pushReturn(MalBlkPtr mb, InstrPtr p, int
  * TODO */
 /* swallows name argument */
 InstrPtr
-pushArgumentId(MalBlkPtr mb, InstrPtr p, str name)
+pushArgumentId(MalBlkPtr mb, InstrPtr p, const char *name)
 {
int v;
 
-   if (p == NULL) {
-   GDKfree(name);
+   if (p == NULL)
return NULL;
-   }
v = findVariable(mb, name);
if (v < 0) {
if ((v = newVariable(mb, name, strlen(name), getAtomIndex(name, 
-1, TYPE_any))) < 0) {
freeInstruction(p);
return NULL;
}
-   } else
-   GDKfree(name);
+   }
return pushArgument(mb, p, v);
 }
 
diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h
--- a/monetdb5/mal/mal_instruction.h
+++ b/monetdb5/mal/mal_instruction.h
@@ -164,7 +164,7 @@ mal_export void pushInstruction(MalBlkPt
 mal_export InstrPtr pushArgument(MalBlkPtr mb, InstrPtr p, int varid);
 mal_export InstrPtr setArgument(MalBlkPtr mb, InstrPtr p, int idx, int varid);
 mal_export InstrPtr pushReturn(MalBlkPtr mb, InstrPtr p, int varid);
-mal_export InstrPtr pushArgumentId(MalBlkPtr mb, InstrPtr p, str name);
+mal_export InstrPtr pushArgumentId(MalBlkPtr mb, InstrPtr p, const char *name);
 mal_export void delArgument(InstrPtr p, int varid);
 mal_export void setVarType(MalBlkPtr mb, int i, int tpe);
 mal_export void clrAllTypes(MalBlkPtr mb);
diff --git a/monetdb5/mal/mal_type.c b/monetdb5/mal/mal_type.c
--- a/monetdb5/mal/mal_type.c
+++ b/monetdb5/mal/mal_type.c
@@ -101,11 +101,16 @@ getTypeIdentifier(malType tpe){
 #define qt(x) (nme[1]==x[1] && nme[2]==x[2] )
 
 int
-getAtomIndex(str nme, int len, int deftype)
+getAtomIndex(const char *nme, int len, int deftype)
 {
-   int i,k=0;
-   char old=0;
+   int i;
 
+   if (len < 0)
+   len = (int) strlen(nme);
+   if (len >= IDLENGTH) {
+   /* name too long: cannot match any atom name */
+   return deftype;
+   }
if (len == 3)
switch (*nme) {
case 'a':
@@ -157,20 +162,14 @@ getAtomIndex(str nme, int len, int defty
return TYPE_sht;
break;
}
-   if( nme[0]=='v' && qt("voi") && nme[3] == 'd')
-   return TYPE_void;
-   if( len > 0 ){
-   old=  nme[k = MIN(IDLENGTH, len)];
-   nme[k] = 0;
-   }
-   for(i= TYPE

MonetDB: default - Merge with Dec2016 branch.

2016-11-09 Thread Sjoerd Mullender
Changeset: e5451cf8596e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5451cf8596e
Modified Files:
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
monetdb5/mal/mal_instruction.c
sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.out
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_gencode.h
sql/backends/monet5/sql_scenario.c
sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out
sql/test/BugTracker-2009/Tests/explain_gives_crash.SF-2741829.stable.out

sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out

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

sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out

sql/test/BugTracker-2012/Tests/aggregate_incorrect_precision_scale.Bug-3182.stable.out

sql/test/BugTracker-2012/Tests/aggregate_incorrect_precision_scale.Bug-3182.stable.out.int128

sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.stable.out
sql/test/BugTracker-2012/Tests/algebra_find.Bug-2728.stable.out
sql/test/BugTracker-2012/Tests/any_null.Bug-2594.stable.out
sql/test/BugTracker-2012/Tests/boolean_coersion.Bug-3012.stable.out

sql/test/BugTracker-2012/Tests/case_evaluated_too_early.Bug-3186.stable.out
sql/test/BugTracker-2012/Tests/cast-tinyint-Bug-3137.stable.out

sql/test/BugTracker-2012/Tests/cast_varchar_to_double.Bug-3071.stable.out

sql/test/BugTracker-2012/Tests/correlated_groupby_in_selection.Bug-3011.stable.out
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out

sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.stable.out

sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.out
sql/test/BugTracker-2012/Tests/float-mod.Bug-3086.stable.out

sql/test/BugTracker-2012/Tests/incorrect_cast_from_double_to_int.Bug-2579.stable.out

sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.stable.out.int128

sql/test/BugTracker-2012/Tests/many-columns-truncated.Bug-3161.stable.out
sql/test/BugTracker-2012/Tests/not-equal-Bug.3139.stable.out

sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.stable.out
sql/test/BugTracker-2012/Tests/null_except_null.Bug-3040.stable.out

sql/test/BugTracker-2012/Tests/order_by_on_column_exp.Bug-3193.stable.out
sql/test/BugTracker-2012/Tests/power_priority.Bug-2291.stable.out
sql/test/BugTracker-2012/Tests/power_priority.Bug-2291.stable.out.int128

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2012/Tests/round-type-inference.Bug-2987.stable.out

sql/test/BugTracker-2012/Tests/row_number_does_not_work_in_complex_query.Bug-2805.stable.out

sql/test/BugTracker-2012/Tests/scalar_subquery_with_alias.Bug-3093.stable.out
sql/test/BugTracker-2012/Tests/server-crash.Bug-3046.stable.out
sql/test/BugTracker-2012/Tests/set_operation.Bug-3059.stable.out
sql/test/BugTracker-2012/Tests/simple_select.Bug-2988.stable.out
sql/test/BugTracker-2012/Tests/sticky-precision.Bug-2969.stable.out
sql/test/BugTracker-2012/Tests/timestamp-diff.Bug-3190.stable.out

sql/test/BugTracker-2012/Tests/tuples_INTERSECT_vs_count_intersect_differs.Bug-2659.stable.out
sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out

sql/test/BugTracker-2012/Tests/user_defined_decimal_function.Bug-2992.stable.out
sql/test/BugTracker-2012/Tests/with_and_exists.Bug-3099.stable.out
sql/test/BugTracker-2012/Tests/with_in_derived_table.Bug-3043.stable.out
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128
sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out.single
sql/test/BugTracker-2014/Tests/queueError.Bug-3604.stable.out
sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.stable.out
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out

sql/test/BugTracker-2016/Tests/CREATE_INDEX_breaks_table_queries.Bug-4053.stable.out

sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.stable.out
sql/test/BugTrack

MonetDB: default - Merge with Dec2016 branch.

2016-11-16 Thread Sjoerd Mullender
Changeset: c86217f8da15 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c86217f8da15
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/mal/pcre.c
sql/server/sql_scan.c
sql/test/pg_regress/Tests/comments.stable.err
sql/test/pg_regress/Tests/comments.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 405 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
@@ -1572,12 +1572,10 @@ int OPTvolcanoImplementation(Client cntx
 str OPTwrapper(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str PCREilike2(bit *ret, const str *s, const str *pat);
 str PCREilike3(bit *ret, const str *s, const str *pat, const str *esc);
-str PCREilike_join_pcre(bat *l, bat *r, const bat *b, const bat *pat, const 
str *esc);
 str PCREimatch(bit *ret, const str *val, const str *pat);
 str PCREindex(int *ret, const pcre *pat, const str *val);
 str PCRElike2(bit *ret, const str *s, const str *pat);
 str PCRElike3(bit *ret, const str *s, const str *pat, const str *esc);
-str PCRElike_join_pcre(bat *l, bat *r, const bat *b, const bat *pat, const str 
*esc);
 str PCRElikesubselect1(bat *ret, const bat *bid, const bat *cid, const str 
*pat, const str *esc, const bit *anti);
 str PCRElikesubselect2(bat *ret, const bat *bid, const bat *sid, const str 
*pat, const str *esc, const bit *caseignore, const bit *anti);
 str PCRElikesubselect3(bat *ret, const bat *bid, const bat *sid, const str 
*pat, const str *esc, const bit *anti);
@@ -2313,7 +2311,6 @@ str partitionRef;
 str passRef;
 str pcreRef;
 str pcre_init(void *ret);
-var_t pcre_put(Heap *h, var_t *bun, pcre *val);
 str pinRef;
 str plusRef;
 str postludeRef;
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -31,17 +31,17 @@
 #define pcre_free_study my_pcre_free
 #endif
 
+mal_export str pcre_init(void *ret);
+
 mal_export str PCREquote(str *r, const str *v);
 mal_export str PCREmatch(bit *ret, const str *val, const str *pat);
 mal_export str PCREimatch(bit *ret, const str *val, const str *pat);
 mal_export str PCREindex(int *ret, const pcre *pat, const str *val);
 mal_export str PCREpatindex(int *ret, const str *pat, const str *val);
-
 mal_export str PCREreplace_wrap(str *res, const str *or, const str *pat, const 
str *repl, const str *flags);
 mal_export str PCREreplace_bat_wrap(bat *res, const bat *or, const str *pat, 
const str *repl, const str *flags);
+mal_export str PCREsql2pcre(str *ret, const str *pat, const str *esc);
 
-mal_export var_t pcre_put(Heap *h, var_t *bun, pcre *val);
-mal_export str PCREsql2pcre(str *ret, const str *pat, const str *esc);
 mal_export str PCRElike3(bit *ret, const str *s, const str *pat, const str 
*esc);
 mal_export str PCRElike2(bit *ret, const str *s, const str *pat);
 mal_export str PCREnotlike3(bit *ret, const str *s, const str *pat, const str 
*esc);
@@ -58,15 +58,18 @@ mal_export str BATPCREilike(bat *ret, co
 mal_export str BATPCREilike2(bat *ret, const bat *b, const str *pat);
 mal_export str BATPCREnotilike(bat *ret, const bat *b, const str *pat, const 
str *esc);
 mal_export str BATPCREnotilike2(bat *ret, const bat *b, const str *pat);
-mal_export str PCRElike_join_pcre(bat *l, bat *r, const bat *b, const bat 
*pat, const str *esc);
-mal_export str PCREilike_join_pcre(bat *l, bat *r, const bat *b, const bat 
*pat, const str *esc);
-mal_export str pcre_init(void *ret);
+
 mal_export str PCRElikesubselect2(bat *ret, const bat *bid, const bat *sid, 
const str *pat, const str *esc, const bit *caseignore, const bit *anti);
 mal_export str PCRElikesubselect1(bat *ret, const bat *bid, const bat *cid, 
const str *pat, const str *esc, const bit *anti);
 mal_export str PCRElikesubselect3(bat *ret, const bat *bid, const bat *sid, 
const str *pat, const str *esc, const bit *anti);
 mal_export str PCRElikesubselect4(bat *ret, const bat *bid, const bat *cid, 
const str *pat, const bit *anti);
 mal_export str PCRElikesubselect5(bat *ret, const bat *bid, const bat *sid, 
const str *pat, const bit *anti);
 
+mal_export str LIKEsubjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, 
const str *esc, const bat *slid, const bat *srid, const bit *nil_matches, const 
lng *estimate);
+mal_export str LIKEsubjoin1(bat *r1, bat *r2, const bat *lid, const bat *rid, 
const bat *slid, const bat *srid, const bit *nil_matches, const lng *estimate);
+mal_export str ILIKEsubjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, 
const str *esc, const bat *slid, const bat *srid, const bit *nil_matches, const 
lng *estimate);
+mal_export str ILIKEsubjoin1(bat *r1, bat *r2, const bat *lid, const bat *rid, 
const bat *slid, const bat *srid, const bit *nil_matches, const lng *estimate);
+
 /* current implementation assumes simple %keyword% [ke

MonetDB: default - Merge with Dec2016 branch.

2016-11-16 Thread Sjoerd Mullender
Changeset: 2c88e2c85abb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c88e2c85abb
Modified Files:
sql/server/sql_scan.c
sql/test/pg_regress/Tests/comments.stable.err
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (47 lines):

diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -824,10 +824,11 @@ skip_c_comment(struct scanner * lc)
int depth = 1;
 
lc->started = 1;
-   while ((cur = scanner_getc(lc)) != EOF && depth > 0) {
+   while (depth > 0 && (cur = scanner_getc(lc)) != EOF) {
if (prev == '*' && cur == '/')
depth--;
else if (prev == '/' && cur == '*') {
+   /* block comments can nest */
cur = 0; /* prevent slash-star-slash from matching */
depth++;
}
@@ -835,7 +836,8 @@ skip_c_comment(struct scanner * lc)
}
lc->yysval = lc->yycur;
lc->started = started;
-   return cur;
+   /* a comment is equivalent to a newline */
+   return cur == EOF ? cur : '\n';
 }
 
 static int 
@@ -849,8 +851,7 @@ skip_sql_comment(struct scanner * lc)
;
lc->yysval = lc->yycur;
lc->started = started;
-   if (cur == '\n')
-   cur = scanner_getc(lc);
+   /* a comment is equivalent to a newline */
return cur;
 }
 
diff --git a/sql/test/pg_regress/Tests/comments.stable.err 
b/sql/test/pg_regress/Tests/comments.stable.err
--- a/sql/test/pg_regress/Tests/comments.stable.err
+++ b/sql/test/pg_regress/Tests/comments.stable.err
@@ -30,7 +30,6 @@ stderr of test 'comments` in directory '
 # 17:48:13 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-5017" "--port=30983"
 # 17:48:13 >  
 
-
 # 15:42:49 >  
 # 15:42:49 >  "Done."
 # 15:42:49 >  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-11-30 Thread Sjoerd Mullender
Changeset: 33ff11bac875 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33ff11bac875
Added Files:
sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.sql
sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.stable.err
sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.stable.out
sql/test/BugTracker-2016/Tests/nested-subquery-in-select.Bug-6125.sql

sql/test/BugTracker-2016/Tests/nested-subquery-in-select.Bug-6125.stable.err

sql/test/BugTracker-2016/Tests/nested-subquery-in-select.Bug-6125.stable.out
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.sql
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.err
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.out
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6121.sql
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6121.stable.err
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6121.stable.out
Modified Files:
configure.ag
gdk/gdk_calc_compare.h
monetdb5/extras/rapi/Tests/rapi02.stable.out
monetdb5/modules/kernel/aggr.mal
monetdb5/modules/kernel/aggr.mal.sh
sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1002 to 300 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2478,7 +2478,7 @@ AS_CASE([$enable_int128],
why_have_hge='(128-bit integer support disabled)'])
 AM_CONDITIONAL([HAVE_HGE], [test "x$have_hge" = xyes])
 
-AC_CHECK_TYPES([ptrdiff_t])
+AC_CHECK_TYPES([ptrdiff_t],,,[@%:@include ])
 AC_CHECK_TYPES([intptr_t])
 AC_CHECK_TYPES([uintptr_t])
 
@@ -2489,8 +2489,8 @@ AC_CHECK_SIZEOF([long])
 AC_CHECK_SIZEOF([void *])
 AC_CHECK_SIZEOF([size_t])
 AC_CHECK_SIZEOF([ssize_t])
-AC_CHECK_SIZEOF([ptrdiff_t])
-AC_CHECK_SIZEOF([wchar_t])
+AC_CHECK_SIZEOF([ptrdiff_t],,[@%:@include ])
+AC_CHECK_SIZEOF([wchar_t],,[@%:@include ])
 AC_CHECK_SIZEOF([long long])
 AC_CHECK_SIZEOF([__int64])
 AC_CHECK_SIZEOF([__int128])
diff --git a/gdk/gdk_calc_compare.h b/gdk/gdk_calc_compare.h
--- a/gdk/gdk_calc_compare.h
+++ b/gdk/gdk_calc_compare.h
@@ -599,10 +599,10 @@ BATcalcop(BAT *b1, BAT *b2, BAT *s)
return BATconstant(b1->hseqbase, TYPE_TPE, &res, cnt, 
TRANSIENT);
}
 
-   bn = BATcalcop_intern(b1->ttype == TYPE_void ? (void *) &b1->tseqbase : 
(void *) Tloc(b1, 0), ATOMbasetype(b1->ttype), 1,
+   bn = BATcalcop_intern(b1->ttype == TYPE_void ? (void *) &b1->tseqbase : 
(void *) Tloc(b1, 0), ATOMtype(b1->ttype) == TYPE_oid ? b1->ttype : 
ATOMbasetype(b1->ttype), 1,
  b1->tvheap ? b1->tvheap->base : NULL,
  b1->twidth,
- b2->ttype == TYPE_void ? (void *) &b2->tseqbase : 
(void *) Tloc(b2, 0), ATOMbasetype(b2->ttype), 1,
+ b2->ttype == TYPE_void ? (void *) &b2->tseqbase : 
(void *) Tloc(b2, 0), ATOMtype(b2->ttype) == TYPE_oid ? b2->ttype : 
ATOMbasetype(b2->ttype), 1,
  b2->tvheap ? b2->tvheap->base : NULL,
  b2->twidth,
  cnt, start, end, cand, candend, b1->hseqbase,
diff --git a/monetdb5/modules/kernel/aggr.mal b/monetdb5/modules/kernel/aggr.mal
--- a/monetdb5/modules/kernel/aggr.mal
+++ b/monetdb5/modules/kernel/aggr.mal
@@ -886,7 +886,7 @@ address AGGRquantile3
 comment "Grouped quantile aggregate";
 
 function quantile(b:bat[:any_1],q:bat[:dbl]) :any_1;
-   bn := subquantile(b, q, false);
+   bn := subquantile(b, q, true);
return algebra.fetch(bn, 0@0);
 end aggr.quantile;
 
diff --git a/monetdb5/modules/kernel/aggr.mal.sh 
b/monetdb5/modules/kernel/aggr.mal.sh
--- a/monetdb5/modules/kernel/aggr.mal.sh
+++ b/monetdb5/modules/kernel/aggr.mal.sh
@@ -242,7 +242,7 @@ address AGGRquantile3
 comment "Grouped quantile aggregate";
 
 function quantile(b:bat[:any_1],q:bat[:dbl]) :any_1;
-   bn := subquantile(b, q, false);
+   bn := subquantile(b, q, true);
return algebra.fetch(bn, 0@0);
 end aggr.quantile;
 
diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -61,3 +61,11 @@ assert-on-push-project-up.Bug-6077
 assert-on-project.Bug-6078
 crash.Bug-6081
 merge-table-edit.Bug-6084
+dce.Bug-6114
+dce2.Bug-6115
+semijoin.Bug-6116
+split_project.Bug-6117
+case-column-when-null-Bug-6124
+select-in-from.Bug-6119
+select-in-from.Bug-6121
+nested-subquery-in-select.Bug-6125
diff --git a/sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.sql 
b/sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.sql
@@ -0,0 +1,14 @@
+CREATE TABLE table_two (this_column INTEGER

MonetDB: default - Merge with Dec2016 branch.

2016-11-30 Thread Sjoerd Mullender
Changeset: e7f3248d0c6b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e7f3248d0c6b
Modified Files:
gdk/gdk_batop.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/UDF/pyapi/formatinput.c
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (219 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -58,10 +58,8 @@ static gdk_return
 insert_string_bat(BAT *b, BAT *n, int force)
 {
BATiter ni; /* iterator */
-   int tt; /* tail type */
size_t toff = ~(size_t) 0;  /* tail offset */
BUN p, q;   /* loop variables */
-   oid o = 0;  /* in case we're appending */
const void *tp; /* tail value pointer */
unsigned char tbv;  /* tail value-as-bte */
unsigned short tsv; /* tail value-as-sht */
@@ -71,18 +69,20 @@ insert_string_bat(BAT *b, BAT *n, int fo
var_t v;/* value */
size_t off; /* offset within n's string heap */
 
+   assert(b->ttype == TYPE_str);
+   /* only transient bats can use some other bat's string heap */
+   assert(b->batRole == TRANSIENT ||
+  b->tvheap->parentid == abs(b->batCacheid));
if (n->batCount == 0)
return GDK_SUCCEED;
ni = bat_iterator(n);
tp = NULL;
-   tt = b->ttype;
-   if (tt == TYPE_str &&
-   (!GDK_ELIMDOUBLES(b->tvheap) || b->batCount == 0) &&
+   if ((!GDK_ELIMDOUBLES(b->tvheap) || b->batCount == 0) &&
!GDK_ELIMDOUBLES(n->tvheap) &&
b->tvheap->hashash == n->tvheap->hashash &&
/* if needs to be kept unique, take slow path */
(b->tkey & BOUND2BTRUE) == 0) {
-   if (b->batRole == TRANSIENT) {
+   if (b->batRole == TRANSIENT || b->tvheap == n->tvheap) {
/* If b is in the transient farm (i.e. b will
 * never become persistent), we try some
 * clever tricks to avoid copying:
@@ -90,14 +90,16 @@ insert_string_bat(BAT *b, BAT *n, int fo
  *   string heap with n;
 * - otherwise, if b's string heap and n's
  *   string heap are the same (i.e. shared),
- *   we leave it that way;
+ *   we leave it that way (this includes the
+ *   case that b is persistent and n shares
+ *   its string heap with b);
 * - otherwise, if b shares its string heap
  *   with some other bat, we materialize it
  *   and we will have to copy strings.
 */
bat bid = b->batCacheid;
 
-   if (b->batCount == 0) {
+   if (b->batCount == 0 && b->tvheap != n->tvheap) {
if (b->tvheap->parentid != bid) {
BBPunshare(b->tvheap->parentid);
} else {
@@ -151,8 +153,8 @@ insert_string_bat(BAT *b, BAT *n, int fo
/* make sure we get alignment right */
toff = (toff + GDK_VARALIGN - 1) & 
~(GDK_VARALIGN - 1);
assert(((toff >> GDK_VARSHIFT) << GDK_VARSHIFT) 
== toff);
-   /* if in "force" mode, the heap may be shared 
when
-* memory mapped */
+   /* if in "force" mode, the heap may be
+* shared when memory mapped */
if (HEAPextend(b->tvheap, toff + 
n->tvheap->size, force) != GDK_SUCCEED) {
toff = ~(size_t) 0;
goto bunins_failed;
@@ -182,25 +184,25 @@ insert_string_bat(BAT *b, BAT *n, int fo
}
switch (b->twidth) {
case 1:
-   tt = TYPE_bte;
+   b->ttype = TYPE_bte;
tp = &tbv;
break;
case 2:
-   tt = TYPE_sht;
+   b->ttype = TYPE_sht;
tp = &tsv;
break;
 #if SIZEOF_VAR_T == 8
case 4:
-   tt = TYPE_int;
+   b->ttype = TYPE_int;
tp = &tiv;
  

MonetDB: default - Merge with Dec2016 branch.

2016-12-01 Thread Sjoerd Mullender
Changeset: 6c17dc3a1d31 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c17dc3a1d31
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
gdk/ChangeLog.Dec2016
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_calc.c
gdk/gdk_hash.h
gdk/gdk_join.c
gdk/gdk_project.c
gdk/gdk_search.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/tablet.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1027 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
@@ -599,7 +599,7 @@ Ready.
 [ "bat",   "setColumn","command 
bat.setColumn(b:bat[:any_1],t:str):void ", "BKCsetColumn;","Give a 
logical name to the tail column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command 
bat.setKey(b:bat[:any_1],mode:bit):bat[:any_1] ",  "BKCsetkey;",   "Sets 
the 'key' property of the tail column to 'mode'. In 'key' mode, \nthe 
kernel will silently block insertions that cause a duplicate \nentries 
in the head column. KNOWN BUG:when 'key' is set to TRUE, this \n\t\tfunction 
does not automatically eliminate duplicates. "  ]
+[ "bat",   "setKey",   "command 
bat.setKey(b:bat[:any_1],mode:bit):bat[:any_1] ",  "BKCsetkey;",   "Sets 
the 'key' property of the tail column to 'mode'. In 'key' mode,\nthe 
kernel will silently block insertions that cause a duplicate\nentry in 
the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1],s:str):void 
",   "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
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
@@ -705,7 +705,7 @@ Ready.
 [ "bat",   "setColumn","command 
bat.setColumn(b:bat[:any_1],t:str):void ", "BKCsetColumn;","Give a 
logical name to the tail column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command 
bat.setKey(b:bat[:any_1],mode:bit):bat[:any_1] ",  "BKCsetkey;",   "Sets 
the 'key' property of the tail column to 'mode'. In 'key' mode, \nthe 
kernel will silently block insertions that cause a duplicate \nentries 
in the head column. KNOWN BUG:when 'key' is set to TRUE, this \n\t\tfunction 
does not automatically eliminate duplicates. "  ]
+[ "bat",   "setKey",   "command 
bat.setKey(b:bat[:any_1],mode:bit):bat[:any_1] ",  "BKCsetkey;",   "Sets 
the 'key' property of the tail column to 'mode'. In 'key' mode,\nthe 
kernel will silently block insertions that cause a duplicate\nentry in 
the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1],s:str):void 
",   "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
diff --git a/gdk/ChangeLog.Dec2016 b/gdk/ChangeLog.Dec2016
--- a/gdk/ChangeLog.Dec2016
+++ b/gdk/ChangeLog.Dec2016
@@ -1,6 +1,13 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Thu Dec  1 2016 Sjoerd Mullender 
+- The tnokey values must now be 0 if it is not known whether all values
+  in a column are distinct.
+- The 2-bit tkey field in the bat descriptor has been split into two
+  single bit

MonetDB: default - Merge with Dec2016 branch.

2016-12-01 Thread Sjoerd Mullender
Changeset: 8086d2d529f2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8086d2d529f2
Modified Files:
gdk/gdk_batop.c
gdk/gdk_system.c
sql/storage/store.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (44 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -209,7 +209,8 @@ insert_string_bat(BAT *b, BAT *n, int fo
}
b->tvarsized = 0;
}
-   }
+   } else if (unshare_string_heap(b) != GDK_SUCCEED)
+   return GDK_FAIL;
if (toff == 0 && n->twidth == b->twidth) {
/* we don't need to do any translation of offset
 * values, so we can use fast memcpy */
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -420,7 +420,6 @@ pthread_sema_down(pthread_sema_t *s)
 
 #else  /* !defined(HAVE_PTHREAD_H) && defined(_MSC_VER) */
 
-#ifdef HAVE_PTHREAD_SIGMASK
 static struct posthread {
struct posthread *next;
pthread_t tid;
@@ -455,6 +454,7 @@ find_posthread(pthread_t tid)
 }
 #endif
 
+#ifdef HAVE_PTHREAD_SIGMASK
 static void
 MT_thread_sigmask(sigset_t * new_mask, sigset_t * orig_mask)
 {
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1583,7 +1583,7 @@ store_init(int debug, store_type store, 
/* get the set shared_drift_threshold
 * we will need it later in store_manager */
shared_drift_threshold = log_settings->shared_drift_threshold;
-   /* get the set shared_drift_threshold
+   /* get the set keep_persisted_log_files
 * we will need it later when calling logger_cleanup */
keep_persisted_log_files = log_settings->keep_persisted_log_files;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-02 Thread Sjoerd Mullender
Changeset: 8a709fd58db8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8a709fd58db8
Modified Files:
gdk/gdk_batop.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (45 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -420,7 +420,7 @@ BATappend(BAT *b, BAT *n, bit force)
OIDXdestroy(b);
 
/* append two void,void bats */
-   if (b->ttype == TYPE_void && BATtdense(b)) {
+   if (b->ttype == TYPE_void && BATtdense(n)) {
oid f = n->tseqbase;
 
if (n->ttype != TYPE_void)
@@ -428,7 +428,7 @@ BATappend(BAT *b, BAT *n, bit force)
 
if (BATcount(b) == 0 && f != oid_nil)
BATtseqbase(b, f);
-   if (BATtdense(n) && BATcount(b) + b->tseqbase == f) {
+   if (BATcount(b) + b->tseqbase == f) {
sz += BATcount(b);
BATsetcount(b, sz);
if (b->tunique)
@@ -443,6 +443,11 @@ BATappend(BAT *b, BAT *n, bit force)
}
}
 
+   if (b->thash == (Hash *) 1) {
+   /* don't bother first loading the hash to then
+* change it */
+   HASHdestroy(b);
+   }
/* if growing too much, remove the hash, else we maintain it */
if (BATcheckhash(b) && (2 * b->thash->mask) < (BATcount(b) + sz)) {
HASHdestroy(b);
@@ -538,11 +543,6 @@ BATappend(BAT *b, BAT *n, bit force)
return GDK_FAIL;
}
 
-   if (b->thash == (Hash *) 1) {
-   /* don't bother first loading the hash to then
-* change it */
-   HASHdestroy(b);
-   }
BATloop(n, p, q) {
const void *t = BUNtail(ni, p);
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-02 Thread Sjoerd Mullender
Changeset: 6d6c9440ee0f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d6c9440ee0f
Modified Files:
monetdb5/modules/atoms/json.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (12 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -2175,7 +2175,7 @@ JSONjsonaggr(BAT **bnp, BAT *b, BAT *g, 
freeg = 1;
if (t2->ttype == TYPE_void) {
map = NULL;
-   mapoff = b->tseqbase;
+   mapoff = t2->tseqbase;
} else {
map = (const oid *) Tloc(t2, 0);
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-03 Thread Sjoerd Mullender
Changeset: afa8d768e73a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afa8d768e73a
Modified Files:
gdk/gdk_batop.c
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
sql/test/BugTracker-2016/Tests/case-column-when-null-Bug-6124.stable.out

sql/test/BugTracker-2016/Tests/nested-subquery-in-select.Bug-6125.stable.out
sql/test/BugTracker-2016/Tests/select-in-from.Bug-6121.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1560 to 300 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -420,7 +420,7 @@ BATappend(BAT *b, BAT *n, bit force)
OIDXdestroy(b);
 
/* append two void,void bats */
-   if (b->ttype == TYPE_void && BATtdense(n)) {
+   if (b->ttype == TYPE_void && BATtdense(b)) {
oid f = n->tseqbase;
 
if (n->ttype != TYPE_void)
@@ -428,7 +428,7 @@ BATappend(BAT *b, BAT *n, bit force)
 
if (BATcount(b) == 0 && f != oid_nil)
BATtseqbase(b, f);
-   if (BATcount(b) + b->tseqbase == f) {
+   if (BATtdense(n) && BATcount(b) + b->tseqbase == f) {
sz += BATcount(b);
BATsetcount(b, sz);
if (b->tunique)
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
@@ -1895,6 +1895,7 @@ rel2bin_semijoin(backend *be, sql_rel *r
s = exp_bin(be, en->data, left, right, NULL, NULL, 
NULL, NULL);
if (!s) 
return NULL;
+   }
if (join_idx != sql->opt_stats[0])
idx = 1;
/* stop on first non equality join */
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
@@ -633,6 +633,13 @@ exp_label(sql_allocator *sa, sql_exp *e,
return e;
 }
 
+sql_exp*
+exp_label_table(sql_allocator *sa, sql_exp *e, int nr)
+{
+   e->rname = make_label(sa, nr);
+   return e;
+}
+
 void
 exp_swap( sql_exp *e ) 
 {
diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h
--- a/sql/server/rel_exp.h
+++ b/sql/server/rel_exp.h
@@ -86,6 +86,7 @@ extern void exp_setrelname(sql_allocator
 extern void noninternexp_setname(sql_allocator *sa, sql_exp *e, const char 
*rname, const char *name );
 extern char* make_label(sql_allocator *sa, int nr);
 extern sql_exp* exp_label(sql_allocator *sa, sql_exp *e, int nr);
+extern sql_exp* exp_label_table(sql_allocator *sa, sql_exp *e, int nr);
 
 extern sql_exp * exp_copy( sql_allocator *sa, sql_exp *e);
 extern list * exps_copy( sql_allocator *sa, list *exps);
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
@@ -4237,18 +4237,20 @@ rel_push_semijoin_down(int *changes, mvc
if (!right && !left)
return rel;
} 
-   nsexps = rel->exps;
-   njexps = l->exps;
+   nsexps = exps_copy(sql->sa, rel->exps);
+   njexps = exps_copy(sql->sa, l->exps);
if (right)
-   l = rel_crossproduct(sql->sa, ll, r, op);
+   l = rel_crossproduct(sql->sa, rel_dup(ll), rel_dup(r), 
op);
else
-   l = rel_crossproduct(sql->sa, lr, r, op);
+   l = rel_crossproduct(sql->sa, rel_dup(lr), rel_dup(r), 
op);
l->exps = nsexps;
if (right)
-   rel = rel_crossproduct(sql->sa, l, lr, lop);
+   l = rel_crossproduct(sql->sa, l, rel_dup(lr), lop);
else
-   rel = rel_crossproduct(sql->sa, l, ll, lop);
-   rel->exps = njexps;
+   l = rel_crossproduct(sql->sa, l, rel_dup(ll), lop);
+   l->exps = njexps;
+   rel_destroy(rel);
+   rel = l;
}
return rel;
 }
@@ -5908,34 +5910,46 @@ rel_remove_unused(mvc *sql, sql_rel *rel
return rel;
 }
 
-static void
-rel_dce_refs(mvc *sql, sql_rel *rel, list *refs) 
-{
+static list *
+merge_refs(list *l, list *r)
+{
+   node *n, *m, *np = l->h, *mp = r->h;
+   list *nl = sa_list(l->sa);
+
+   for( n = np; n; n = n->next) {
+   sql_rel *lr = n->data;
+   for (m = mp; m; m = m->next) {
+   sql_rel *rr = m->data;
+
+   if (lr == rr) {
+   for( ; np != n; np = np-

MonetDB: default - Merge with Dec2016 branch.

2016-12-05 Thread Sjoerd Mullender
Changeset: 84bc1802d33d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84bc1802d33d
Added Files:

sql/test/BugTracker-2016/Tests/column_name_lost_in_in_operator.Bug-6123.sql

sql/test/BugTracker-2016/Tests/column_name_lost_in_in_operator.Bug-6123.stable.err

sql/test/BugTracker-2016/Tests/column_name_lost_in_in_operator.Bug-6123.stable.out
Modified Files:
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_wrapper.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_optimizer.c
sql/server/rel_select.c
sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 739 to 300 lines):

diff --git a/monetdb5/optimizer/opt_multiplex.c 
b/monetdb5/optimizer/opt_multiplex.c
--- a/monetdb5/optimizer/opt_multiplex.c
+++ b/monetdb5/optimizer/opt_multiplex.c
@@ -260,7 +260,8 @@ OPTmultiplexImplementation(Client cntxt,
GDKfree(msg);
 
 /* Defense line against incorrect plans */
-if( mb->errors == 0 && actions > 0){ chkTypes(cntxt->fdout, cntxt->nspace, 
mb, FALSE);
+if( mb->errors == 0 && actions > 0){
+chkTypes(cntxt->fdout, cntxt->nspace, mb, FALSE);
 chkFlow(cntxt->fdout, mb);
 chkDeclarations(cntxt->fdout, mb);
 }
diff --git a/monetdb5/optimizer/opt_pushselect.c 
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -606,6 +606,7 @@ OPTpushselectImplementation(Client cntxt
 chkFlow(cntxt->fdout, mb);
 chkDeclarations(cntxt->fdout, mb);
 }
+wrapup:
 /* keep all actions taken as a post block comment */
 wrapup:
 snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " 
usec","pushselect",actions,GDKusec() - usec);
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -156,7 +156,8 @@ str OPTwrapper (Client cntxt, MalBlkPtr 
((sizeof( MalBlkRecord) +mb->ssize * offsetof(InstrRecord, 
argv)+ mb->vtop * sizeof(int) /* argv estimate */ +mb->vtop* sizeof(VarRecord) 
+ mb->vsize*sizeof(VarPtr)+1023)/1024),
usec);
QOTupdateStatistics(curmodnme,actions,usec);
-   addtoMalBlkHistory(mb);
+   if( actions)
+   addtoMalBlkHistory(mb);
if ( mb->errors)
throw(MAL, optimizer, PROGRAM_GENERAL ":%s.%s", modnme, fcnnme);
return MAL_SUCCEED;
diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -271,6 +271,8 @@ SQLrun(Client c, backend *be, mvc *m){
return createException(PARSE, "SQLparser", "%s", m->errstr);
// locate and inline the query template instruction
mb = copyMalBlk(c->curprg->def);
+   mb->history = c->curprg->def->history;
+   c->curprg->def->history =0;
 
/* only consider a re-optimization when we are dealing with query 
templates */
for ( i= 1; i < mb->stop;i++){
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
@@ -171,6 +171,7 @@ addOptimizers(Client c, MalBlkPtr mb, ch
if (msg){
return msg;
}
+   mb->keephistory |= be->mvc->emod & mod_debug;
if (be->mvc->no_mitosis) {
for (i = mb->stop - 1; i > 0; i--) {
q = getInstrPtr(mb, i);
@@ -200,7 +201,7 @@ SQLoptimizeFunction(Client c, MalBlkPtr 
msg = addOptimizers(c, mb, pipe, TRUE);
if (msg)
return msg;
-   mb->keephistory = be->mvc->emod & mod_debug;
+   mb->keephistory |= be->mvc->emod & mod_debug;
msg = optimizeMALBlock(c, mb);
mb->keephistory = FALSE;
return msg;
@@ -249,6 +250,7 @@ SQLoptimizeQuery(Client c, MalBlkPtr mb)
msg = addOptimizers(c, mb, pipe, FALSE);
if (msg)
return msg;
+   mb->keephistory |= be->mvc->emod & mod_debug;
msg = optimizeMALBlock(c, mb);
return msg;
 }
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
@@ -1993,16 +1993,21 @@ rel_logical_value_exp(mvc *sql, sql_rel 
dlist *dl = sc->data.lval;
symbol *lo = dl->h->data.sym;
dnode *n = dl->h->next;
-   sql_exp *l = rel_value_exp(sql, rel, lo, f, ek), *r = NULL;
-   sql_rel *left = NULL, *right = NULL;
+   sql_rel *left = NULL, *right = NULL, *outer = *rel;
+   sql_exp *l = NULL, *r = NULL;
int needproj = 0, vals_only = 1;
-   list *vals = NULL;
-
+   list *vals = NULL, *pexps 

MonetDB: default - Merge with Dec2016 branch.

2016-12-05 Thread Sjoerd Mullender
Changeset: a6d291606d9d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a6d291606d9d
Modified Files:
monetdb5/mal/mal_instruction.c
monetdb5/optimizer/opt_wrapper.c
Branch: default
Log Message:

Merge with Dec2016 branch.

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


MonetDB: default - Merge with Dec2016 branch.

2016-12-06 Thread Sjoerd Mullender
Changeset: a225de55d735 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a225de55d735
Added Files:
debian/monetdb-python2.install
Modified Files:
MonetDB.spec
buildtools/ChangeLog.Dec2016
configure.ag
debian/control
debian/monetdb5-server.install
debian/rules
monetdb5/extras/rapi/rapi.R
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (298 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -88,6 +88,15 @@
 %endif
 
 %if %{fedpkgs}
+# If the _without_pyintegration macro is not set, the MonetDB-python2
+# RPM will be created.  The macro can be set when using mock by
+# passing it the flag --without=pyintegration.
+%if %{?_without_pyintegration:0}%{!?_without_pyintegration:1}
+%define with_pyintegration 1
+%endif
+%endif
+
+%if %{fedpkgs}
 # If the _with_fits macro is set, the MonetDB-cfitsio RPM will be
 # created.  The macro can be set when using mock by passing it the
 # flag --with=fits.
@@ -146,7 +155,6 @@ BuildRequires: libuuid-devel
 BuildRequires: libxml2-devel
 BuildRequires: openssl-devel
 BuildRequires: pcre-devel >= 4.5
-BuildRequires: python-devel
 BuildRequires: readline-devel
 BuildRequires: unixODBC-devel
 # BuildRequires: uriparser-devel
@@ -154,6 +162,10 @@ BuildRequires: zlib-devel
 %if %{?with_samtools:1}%{!?with_samtools:0}
 BuildRequires: samtools-devel
 %endif
+%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
+BuildRequires: python-devel
+BuildRequires: python2-numpy
+%endif
 %if %{?with_rintegration:1}%{!?with_rintegration:0}
 BuildRequires: R-core-devel
 %endif
@@ -510,6 +522,32 @@ install it.
 %{_libdir}/monetdb5/lib_rapi.so
 %endif
 
+%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
+%package python2
+Summary: Integration of MonetDB and Python, allowing use of Python from within 
SQL
+Group: Applications/Databases
+Requires: MonetDB-SQL-server5%{?_isa} = %{version}-%{release}
+
+%description python2
+MonetDB is a database management system that is developed from a
+main-memory perspective with use of a fully decomposed storage model,
+automatic index management, extensibility of data types and search
+accelerators.  It also has an SQL frontend.
+
+This package contains the interface to use the Python language from
+within SQL queries.  This package is for Python 2.
+
+NOTE: INSTALLING THIS PACKAGE OPENS UP SECURITY ISSUES.  If you don't
+know how this package affects the security of your system, do not
+install it.
+
+%files python2
+%defattr(-,root,root)
+%{_libdir}/monetdb5/pyapi.*
+%{_libdir}/monetdb5/autoload/*_pyapi.mal
+%{_libdir}/monetdb5/lib_pyapi.so
+%endif
+
 %if %{?with_fits:1}%{!?with_fits:0}
 %package cfitsio
 Summary: MonetDB: Add on module that provides support for FITS files
@@ -538,7 +576,6 @@ Summary: MonetDB - Monet Database Manage
 Group: Applications/Databases
 Requires(pre): shadow-utils
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
-Obsoletes: MonetDB5-server-rdf
 %if (0%{?fedora} >= 22)
 Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
 %if %{bits} == 64
@@ -598,6 +635,9 @@ fi
 %if %{?with_lidar:1}%{!?with_lidar:0}
 %exclude %{_libdir}/monetdb5/lidar.mal
 %endif
+%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
+%exclude %{_libdir}/monetdb5/pyapi.mal
+%endif
 %if %{?with_rintegration:1}%{!?with_rintegration:0}
 %exclude %{_libdir}/monetdb5/rapi.mal
 %endif
@@ -614,6 +654,9 @@ fi
 %if %{?with_lidar:1}%{!?with_lidar:0}
 %exclude %{_libdir}/monetdb5/autoload/*_lidar.mal
 %endif
+%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
+%exclude %{_libdir}/monetdb5/autoload/*_pyapi.mal
+%endif
 %if %{?with_rintegration:1}%{!?with_rintegration:0}
 %exclude %{_libdir}/monetdb5/autoload/*_rapi.mal
 %endif
@@ -626,6 +669,9 @@ fi
 %if %{?with_lidar:1}%{!?with_lidar:0}
 %exclude %{_libdir}/monetdb5/lib_lidar.so
 %endif
+%if %{?with_pyintegration:1}%{!?with_pyintegration:0}
+%exclude %{_libdir}/monetdb5/lib_pyapi.so
+%endif
 %if %{?with_rintegration:1}%{!?with_rintegration:0}
 %exclude %{_libdir}/monetdb5/lib_rapi.so
 %endif
@@ -693,8 +739,6 @@ Requires: MonetDB5-server%{?_isa} = %{ve
 # RHEL >= 7, and all current Fedora
 Requires: %{_bindir}/systemd-tmpfiles
 %endif
-Obsoletes: MonetDB-SQL-devel
-Obsoletes: %{name}-SQL
 %if (0%{?fedora} >= 22)
 %if %{bits} == 64
 Recommends: %{name}-SQL-server5-hugeint%{?_isa} = %{version}-%{release}
@@ -785,7 +829,6 @@ frontend of MonetDB.
 %package testing
 Summary: MonetDB - Monet Database Management System
 Group: Applications/Databases
-Obsoletes: MonetDB-python
 
 %description testing
 MonetDB is a database management system that is developed from a
@@ -848,12 +891,12 @@ developer, but if you do want to test, t
--enable-int128=%{?with_int128:yes}%{!?with_int128:no} \
--enable-lidar=%{?with_lidar:yes}%{!?with_lidar:no} \
--enable-mapi=yes \
-   --enable-microhttpd=no \
--enable-monetdb5=yes \
--enable-netcdf=no

MonetDB: default - Merge with Dec2016 branch.

2016-12-07 Thread Sjoerd Mullender
Changeset: f96145427b68 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f96145427b68
Modified Files:
MonetDB.spec
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (34 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -87,10 +87,11 @@
 %endif
 %endif
 
-%if %{fedpkgs}
 # If the _without_pyintegration macro is not set, the MonetDB-python2
 # RPM will be created.  The macro can be set when using mock by
 # passing it the flag --without=pyintegration.
+# On RHEL 6, numpy is too old.
+%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
 %if %{?_without_pyintegration:0}%{!?_without_pyintegration:1}
 %define with_pyintegration 1
 %endif
@@ -164,7 +165,17 @@ BuildRequires: samtools-devel
 %endif
 %if %{?with_pyintegration:1}%{!?with_pyintegration:0}
 BuildRequires: python-devel
+%if %{?rhel:1}%{!?rhel:0}
+# RedHat Enterprise Linux calls it simply numpy
+BuildRequires: numpy
+%else
+%if (0%{?fedora} >= 24)
 BuildRequires: python2-numpy
+%else
+# Fedora <= 23 doesn't have python2-numpy
+BuildRequires: python-numpy
+%endif
+%endif
 %endif
 %if %{?with_rintegration:1}%{!?with_rintegration:0}
 BuildRequires: R-core-devel
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-07 Thread Sjoerd Mullender
Changeset: f50c4c6fe53d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f50c4c6fe53d
Modified Files:
MonetDB.spec
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (12 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -173,7 +173,7 @@ BuildRequires: numpy
 BuildRequires: python2-numpy
 %else
 # Fedora <= 23 doesn't have python2-numpy
-BuildRequires: python-numpy
+BuildRequires: numpy
 %endif
 %endif
 %endif
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-07 Thread Sjoerd Mullender
Changeset: ee4843caa75a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ee4843caa75a
Modified Files:
debian/control
debian/rules
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (23 lines):

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Vcs-Hg: http://dev.monetdb.org/hg/MonetD
 Build-Depends: debhelper (>= 5), autotools-dev, bison, libatomic-ops-dev,
  libbam-dev, libbz2-dev, libcurl4-gnutls-dev, libgeos-dev (>= 3.4.0),
  libgsl0-dev, libpcre3-dev, libreadline-dev, liblzma-dev,
- libssl-dev, libxml2-dev, pkg-config, python, python-numpy,
+ libssl-dev, libxml2-dev, pkg-config, python, python-dev, python-numpy,
  unixodbc-dev, uuid-dev, zlib1g-dev, liblas-c-dev (>= 1.8.0), r-base
 Standards-Version: 3.8.0
 X-Python-Version: >= 2.6
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -29,7 +29,6 @@ override_dh_auto_configure:
--enable-monetdb5=yes \
--enable-netcdf=no \
--enable-odbc=yes \
-   --enable-oid32=no \
--enable-optimize=yes \
--enable-profile=no \
--enable-pyintegration=yes \
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-08 Thread Panagiotis Koutsourakis
Changeset: 3d6f5aa78ebc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d6f5aa78ebc
Modified Files:
debian/control
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (12 lines):

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ X-Python-Version: >= 2.6
 Package: libmonetdb13
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: libmonetdb5-server-geom (< ${source:Version})
+Conflicts: libmonetdb5-server-geom (<< ${source:Version})
 Description: MonetDB core library
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch

2016-12-08 Thread Panagiotis Koutsourakis
Changeset: dc073cdfa931 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc073cdfa931
Modified Files:
debian/fix-deb.sh
sql/jdbc/tests/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch


diffs (61 lines):

diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -53,3 +53,10 @@ wheezy | jessie | precise | trusty | wil
 sed -i 's/php-cli/php5-cli/;s/, *php-sockets//' debian/control
 ;;
 esac
+
+case $SUITE in
+wheezy | precise)
+# numpy is too old
+sed -i '/pyintegration=yes/s/yes/no/' debian/rules
+;;
+esac
diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All
--- a/sql/jdbc/tests/Tests/All
+++ b/sql/jdbc/tests/Tests/All
@@ -4,31 +4,31 @@ HAVE_JDBCTESTS?Test_Clargequery
 HAVE_JDBCTESTS?Test_Cmanycon
 HAVE_JDBCTESTS?Test_Creplysize
 HAVE_JDBCTESTS?Test_Csavepoints
+#HAVE_JDBCTESTS?Test_Csendthread  # unfortunately has runtime-dependant output
 HAVE_JDBCTESTS?Test_Ctransaction
-#HAVE_JDBCTESTS?Test_Csendthread  # unfortunately has runtime-dependant output
-HAVE_JDBCTESTS&HAVE_SAMTOOLS&HAVE_NETCDF&HAVE_GEOM?Test_Dobjects
+HAVE_JDBCTESTS&HAVE_NETCDF&HAVE_GEOM?Test_Dobjects
+HAVE_JDBCTESTS?Test_FetchSize
+HAVE_JDBCTESTS&HAVE_HGE?Test_Int128
+HAVE_JDBCCLIENT_JAR?Test_JdbcClient
 HAVE_JDBCTESTS?Test_PSgeneratedkeys
-HAVE_JDBCTESTS?Test_PSsomeamount
+HAVE_JDBCTESTS?Test_PSgetObject
 HAVE_JDBCTESTS?Test_PSlargebatchval
 HAVE_JDBCTESTS?Test_PSlargeresponse
 #HAVE_JDBCTESTS?Test_PSlargeamount # scalabity test which is disabled by 
default (it takes a long time to run and does not need to be run everytime, 
only before a new release)
-HAVE_JDBCTESTS?Test_Smoreresults
+HAVE_JDBCTESTS?Test_PSmanycon
+HAVE_JDBCTESTS?Test_PSmetadata
+HAVE_JDBCTESTS?Test_PSsomeamount
+HAVE_JDBCTESTS?Test_PSsqldata
 HAVE_JDBCTESTS?Test_PStimedate
 HAVE_JDBCTESTS?Test_PStimezone
 HAVE_JDBCTESTS?Test_PStypes
-HAVE_JDBCTESTS?Test_PSgetObject
-HAVE_JDBCTESTS?Test_PSmanycon
-HAVE_JDBCTESTS?Test_PSmetadata
-HAVE_JDBCTESTS?Test_PSsqldata
 HAVE_JDBCTESTS?Test_Rbooleans
 HAVE_JDBCTESTS?Test_Rmetadata
 HAVE_JDBCTESTS?Test_Rpositioning
+HAVE_JDBCTESTS?Test_Rsqldata
 HAVE_JDBCTESTS?Test_Rtimedate
-HAVE_JDBCTESTS?Test_Rsqldata
 HAVE_JDBCTESTS?Test_Sbatching
-HAVE_JDBCTESTS&HAVE_HGE?Test_Int128
-HAVE_JDBCTESTS?Test_FetchSize
-HAVE_JDBCCLIENT_JAR?Test_JdbcClient
+HAVE_JDBCTESTS?Test_Smoreresults
 HAVE_JDBCTESTS?Test_Wrapper
 HAVE_JDBCTESTS?BugConcurrent_clients_SF_1504657
 HAVE_JDBCTESTS?BugConcurrent_sequences
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-09 Thread Sjoerd Mullender
Changeset: e35545e8b6ff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e35545e8b6ff
Modified Files:
debian/fix-deb.sh
gdk/Makefile.ag
gdk/gdk_ssort.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (105 lines):

diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -57,6 +57,9 @@ esac
 case $SUITE in
 wheezy | precise)
 # numpy is too old
+sed -i -e 's/, python-dev[^,]*//;s/, python-numpy[^,]*//' \
+   -e '/^Package:.*monetdb-python2/,/^$/d' debian/control
 sed -i '/pyintegration=yes/s/yes/no/' debian/rules
+rm debian/monetdb-python2.install
 ;;
 esac
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -12,28 +12,30 @@ lib_gdk = {
VERSION = $(GDK_VERSION)
NAME = bat
SOURCES = \
+   gdk_select.c \
+   gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
+   gdk_ssort.c gdk_ssort_impl.h \
+   gdk_aggr.c \
gdk.h gdk_cand.h gdk_atomic.h gdk_batop.c \
-   gdk_select.c \
gdk_search.c gdk_hash.c gdk_hash.h gdk_tm.c \
gdk_orderidx.c \
gdk_align.c gdk_bbp.c gdk_bbp.h \
gdk_heap.c gdk_utils.c gdk_utils.h \
gdk_atoms.c gdk_atoms.h \
-   gdk_qsort.c gdk_qsort_impl.h gdk_ssort.c gdk_ssort_impl.h \
+   gdk_qsort.c gdk_qsort_impl.h \
gdk_storage.c gdk_bat.c \
gdk_delta.c gdk_cross.c gdk_system.c gdk_value.c \
gdk_posix.c gdk_logger.c gdk_sample.c \
gdk_private.h gdk_delta.h gdk_logger.h gdk_posix.h \
gdk_system.h gdk_system_private.h gdk_tm.h gdk_storage.h \
-   gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
-   gdk_aggr.c gdk_group.c \
+   gdk_group.c \
gdk_imprints.c gdk_imprints.h \
gdk_join.c gdk_project.c \
gdk_unique.c \
gdk_interprocess.c gdk_interprocess.h \
gdk_firstn.c \
bat.feps bat1.feps bat2.feps \
-   libbat.rc 
+   libbat.rc
LIBS = ../common/options/libmoptions \
../common/stream/libstream \
../common/utils/libmutils \
diff --git a/gdk/gdk_ssort.c b/gdk/gdk_ssort.c
--- a/gdk/gdk_ssort.c
+++ b/gdk/gdk_ssort.c
@@ -58,9 +58,9 @@ typedef struct {
 
/* 'ah' and 'at' are temp storage to help with merges.  They
 * contain room for alloced[ht] entries. */
-   void **ah;
+   void *ah;
ssize_t allocedh;
-   void **at;
+   void *at;
ssize_t allocedt;
 
/* A stack of n pending runs yet to be merged.  Run #i starts
@@ -101,7 +101,7 @@ merge_freemem(MergeState *ms)
 /* Ensure enough temp memory for 'need' array slots is available.
  * Returns 0 on success and -1 if the memory can't be gotten. */
 static int
-merge_getmem(MergeState *ms, ssize_t need, void ***ap,
+merge_getmem(MergeState *ms, ssize_t need, void **ap,
 ssize_t *allocedp, int s, char *temparray)
 {
assert(ms != NULL);
@@ -177,23 +177,23 @@ merge_getmem(MergeState *ms, ssize_t nee
case 0: \
break;  \
case sizeof(bte):   \
-   for(i=0; ihttps://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-12 Thread Sjoerd Mullender
Changeset: 6bf316ae5e23 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6bf316ae5e23
Modified Files:
gdk/gdk_group.c
monetdb5/modules/kernel/algebra.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (66 lines):

diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -441,7 +441,7 @@ BATgroup_internal(BAT **groups, BAT **ex
}
if (BATordered(b) && BATordered_rev(b)) {
/* all values are equal */
-   if (g == NULL) {
+   if (g == NULL || (BATordered(g) && BATordered_rev(g))) {
/* there's only a single group: 0 */
ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT ","
  "g=%s#" BUNFMT ","
@@ -573,9 +573,9 @@ BATgroup_internal(BAT **groups, BAT **ex
}
}
 
-   if (((BATordered(b) || BATordered_rev(b)) &&
-(g == NULL || BATordered(g) || BATordered_rev(g))) ||
-   subsorted) {
+   if (subsorted ||
+   ((BATordered(b) || BATordered_rev(b)) &&
+(g == NULL || BATordered(g) || BATordered_rev(g {
/* we only need to compare each entry with the previous */
ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT ","
  "g=%s#" BUNFMT ","
@@ -935,15 +935,15 @@ BATgroup_internal(BAT **groups, BAT **ex
BATsetcount(en, (BUN) ngrp);
en->tkey = 1;
en->tsorted = 1;
-   en->trevsorted = BATcount(en) <= 1;
+   en->trevsorted = ngrp == 1;
en->tnonil = 1;
en->tnil = 0;
-   *extents = en;
+   *extents = virtualize(en);
}
if (histo) {
BATsetcount(hn, (BUN) ngrp);
-   if (BATcount(hn) <= 1) {
-   hn->tkey = 1;
+   if (ngrp == 1 || ngrp == BATcount(b)) {
+   hn->tkey = ngrp == 1;
hn->tsorted = 1;
hn->trevsorted = 1;
} else {
@@ -956,7 +956,7 @@ BATgroup_internal(BAT **groups, BAT **ex
*histo = hn;
}
gn->tkey = ngrp == BATcount(gn);
-   gn->trevsorted = BATcount(gn) <= 1;
+   gn->trevsorted = ngrp == 1 || BATcount(gn) <= 1;
gn->tnonil = 1;
gn->tnil = 0;
*groups = gn;
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
@@ -61,7 +61,7 @@ CMDgen_group(BAT **result, BAT *gids, BA
if (r == NULL)
return GDK_FAIL;
if (gids->ttype == TYPE_void) {
-   oid id = gids->hseqbase;
+   oid id = gids->tseqbase;
lng *cnt = (lng*)Tloc(cnts, 0);
for(j = 0; j < gcnt; j++) {
lng i, sz = cnt[j];
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-13 Thread Sjoerd Mullender
Changeset: 836d33c70c80 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=836d33c70c80
Added Files:
sql/test/BugTracker-2015/Tests/long_insert.Bug-3845.timeout
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (6 lines):

diff --git a/sql/test/BugTracker-2015/Tests/long_insert.Bug-3845.timeout 
b/sql/test/BugTracker-2015/Tests/long_insert.Bug-3845.timeout
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/long_insert.Bug-3845.timeout
@@ -0,0 +1,1 @@
+10
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-14 Thread Sjoerd Mullender
Changeset: dbb14e8bfafa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dbb14e8bfafa
Modified Files:
gdk/gdk_bbp.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (12 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1154,7 +1154,7 @@ BBPreadEntries(FILE *fp, int oidsize, in
needcommit = 1;
}
}
-   if (bbpversion <= GDKLIBRARY &&
+   if (bbpversion <= GDKLIBRARY_NOKEY &&
(bn->tnokey[0] != 0 || bn->tnokey[1] != 0)) {
/* we don't trust the nokey values */
bn->tnokey[0] = bn->tnokey[1] = 0;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-14 Thread Panagiotis Koutsourakis
Changeset: 67e4fa30f848 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=67e4fa30f848
Added Files:
debian/libmonetdb-stream9.install
debian/libmonetdb14.install
Removed Files:
ChangeLog.Jun2016
buildtools/ChangeLog.Jun2016
clients/ChangeLog.Jun2016
clients/mapilib/ChangeLog.Jun2016
common/stream/ChangeLog.Jun2016
debian/libmonetdb-stream8.install
debian/libmonetdb13.install
gdk/ChangeLog.Jun2016
geom/ChangeLog.Jun2016
monetdb5/ChangeLog.Jun2016
sql/ChangeLog.Jun2016
testing/ChangeLog.Jun2016
tools/merovingian/ChangeLog.Jun2016
Modified Files:
.hgtags
ChangeLog-Archive
ChangeLog.Dec2016
MonetDB.spec
buildtools/ChangeLog-Archive
buildtools/ChangeLog.Dec2016
debian/changelog
debian/control
gdk/ChangeLog-Archive
gdk/ChangeLog.Dec2016
libversions
monetdb5/ChangeLog-Archive
monetdb5/ChangeLog.Dec2016
sql/ChangeLog-Archive
sql/ChangeLog.Dec2016
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 962 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -641,3 +641,5 @@ 293b452cd1e5964d820f7d6c538e06507e575d88
 f16cdfed96bdc0f3324f8ced85a8b74c67f4dc9b Jun2016_SP2_release
 293b452cd1e5964d820f7d6c538e06507e575d88 Jun2016_SP2_release
 0027cb04877b7687f45277a81a25253a63e9f21f Dec2016_root
+ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_1
+ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_release
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,16 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Sep 22 2016 Sjoerd Mullender  - 11.25.1-20161214
+- The Perl, PHP, and Python clients, and the JDBC driver each now have
+  their own repositories and release cycles.  The Python client is
+  maintained by Gijs Molenaar on Github
+  (https://github.com/gijzelaerr/pymonetdb), the other clients are
+  maintained by CWI/MonetDB on our own server
+  (https://dev.monetdb.org/hg/monetdb-java,
+  https://dev.monetdb.org/hg/monetdb-perl,
+  https://dev.monetdb.org/hg/monetdb-php).
+
 * Fri Jul  1 2016 Sjoerd Mullender  - 11.23.5-20160704
 - Lots of memory leaks have been plugged across the whole system.
 
diff --git a/ChangeLog.Dec2016 b/ChangeLog.Dec2016
--- a/ChangeLog.Dec2016
+++ b/ChangeLog.Dec2016
@@ -1,13 +1,3 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
-* Thu Sep 22 2016 Sjoerd Mullender 
-- The Perl, PHP, and Python clients, and the JDBC driver each now have
-  their own repositories and release cycles.  The Python client is
-  maintained by Gijs Molenaar on Github
-  (https://github.com/gijzelaerr/pymonetdb), the other clients are
-  maintained by CWI/MonetDB on our own server
-  (https://dev.monetdb.org/hg/monetdb-java,
-  https://dev.monetdb.org/hg/monetdb-perl,
-  https://dev.monetdb.org/hg/monetdb-php).
-
diff --git a/ChangeLog.Jun2016 b/ChangeLog.Jun2016
deleted file mode 100644
--- a/ChangeLog.Jun2016
+++ /dev/null
@@ -1,3 +0,0 @@
-# ChangeLog file for candidate
-# This file is updated with Maddlog
-
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -124,7 +124,7 @@ Vendor: MonetDB BV 
 Group: Applications/Databases
 License: MPLv2.0
 URL: http://www.monetdb.org/
-Source: 
http://dev.monetdb.org/downloads/sources/Jun2016-SP2/%{name}-%{version}.tar.bz2
+Source: 
http://dev.monetdb.org/downloads/sources/Dec2016/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
@@ -955,6 +955,182 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Wed Dec 14 2016 Panagiotis Koutsourakis  - 
11.25.1-20161214
+- Rebuilt.
+- BZ#3357: Implement setQueryTimeout()
+- BZ#3445: Add support for database name to dotmonetdb file
+- BZ#3973: JDBC hangs
+- BZ#3976: Performance enhancement to LIKE without wildcards
+- BZ#4005: Correlated update causes incorrect null constraint violation
+- BZ#4016: merge table only optimises for point query
+- BZ#4040: sys.storage call can take a long time
+- BZ#4047: Segfault when updating a dropped table
+- BZ#4050: Database corruption when running low on inode
+- BZ#4057: missing bulk operations between constant and bat
+- BZ#4061: SIGSEGV in candscan_lng
+- BZ#4066: Deadlocked monetdbd
+- BZ#6068: Error message about incompatible BBP version should be clearer
+- BZ#6069: query with union all silently crashes
+- BZ#6070: setting negative session query timeout should not be
+  possible/allowed
+- BZ#6071: where clause with cast and floor fails to sigsegv
+- BZ#6072: Bind to UPD delta column does not get/show type information
+  in EXPLAIN
+- BZ#6073: Missing type information for constants in MAL explain
+- BZ#6074: SET ROLE com

MonetDB: default - Merge with Dec2016 branch.

2016-12-14 Thread Sjoerd Mullender
Changeset: 9d02dfed3b98 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9d02dfed3b98
Modified Files:
.hgtags
MonetDB.spec
NT/installer32/MonetDB-ODBC-Installer.vdproj
NT/installer32/MonetDB5-Geom-Module.vdproj
NT/installer32/MonetDB5-SQL-Installer.vdproj
NT/installer64/MonetDB-ODBC-Installer.vdproj
NT/installer64/MonetDB5-Geom-Module.vdproj
NT/installer64/MonetDB5-SQL-Installer.vdproj
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 Dec2016 branch.


diffs (8 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -643,3 +643,4 @@ 293b452cd1e5964d820f7d6c538e06507e575d88
 0027cb04877b7687f45277a81a25253a63e9f21f Dec2016_root
 ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_1
 ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_release
+deeebb69952f76e3377664bb97997885b283f9d1 fix-bad-merge
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-16 Thread Sjoerd Mullender
Changeset: ade667955950 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ade667955950
Added Files:
clients/Tests/exports.stable.err-noapprove
clients/Tests/malcheck.stable.err-noapprove
clients/Tests/malcheck.stable.out-noapprove
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/malcheck.stable.out
monetdb5/optimizer/optimizer.mal
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (109 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
@@ -7942,7 +7942,6 @@ Ready.
 [ "mdb",   "start","pattern mdb.start(clientid:int):void ",
"MDBstart;","Start interactive debugger on a client"]
 [ "mdb",   "start","pattern mdb.start(mod:str, fcn:str):void ",
"MDBstartFactory;", "Start interactive debugger on a running factory"   
]
 [ "mdb",   "stop", "pattern mdb.stop():void ", "MDBstop;", "Stop 
the interactive debugger" ]
-[ "mdb",   "traceOptimizer",   "command 
mdb.traceOptimizer(flg:str):void ","OPTsetDebugStr;",  "Otherwise it is 
considered a request to trace the optimizers,\nwhich requires a comma separated 
list or pipeline name."]
 [ "mdb",   "var",  "pattern mdb.var(M:str, F:str):void ",  "MDBvar3;", 
"Dump the symboltable of routine M.F on standard out."  ]
 [ "mdb",   "var",  "pattern mdb.var():void ",  "MDBvar;",  "Dump 
the symboltable of current routine on standard out."  ]
 [ "mkey",  "bulk_rotate_xor_hash", "command 
mkey.bulk_rotate_xor_hash(h:bat[:lng], nbits:int, b:bat[:any_1]):bat[:lng] ",  
"MKEYbulk_rotate_xor_hash;","pre:  h and b should be synced on head\n   
  post: [:xor=]([:rotate=](h, nbits), [hash](b))"   ]
@@ -7970,7 +7969,7 @@ Ready.
 [ "mmath", "cbrt", "command mmath.cbrt(y:flt):flt ",   
"MATHunary_CBRTflt;",   ""  ]
 [ "mmath", "ceil", "command mmath.ceil(y:dbl):dbl ",   
"MATHunary_CEILdbl;",   "The ceil(x) function rounds x upwards to the nearest 
integer." ]
 [ "mmath", "ceil", "command mmath.ceil(y:flt):flt ",   
"MATHunary_CEILflt;",   ""  ]
-[ "mmath", "cnrt", "command mmath.cnrt(y:dbl):dbl ",   
"MATHunary_CBRTdbl;",   "The cbrt(x) function returns the non-negative cube 
root of x." ]
+[ "mmath", "cnrt", "command mmath.cnrt(y:dbl):dbl ",   
"MATHunary_CBRTdbl;",   "The cbrt(x) function returns the cube root of x."  
]
 [ "mmath", "cos",  "command mmath.cos(x:dbl):dbl ",
"MATHunary_COSdbl;","The cos(x) function returns the cosine of x, where x 
is given in \nradians. The return value is between -1 and 1." ]
 [ "mmath", "cos",  "command mmath.cos(x:flt):flt ",
"MATHunary_COSflt;",""  ]
 [ "mmath", "cosh", "command mmath.cosh(x:dbl):dbl ",   
"MATHunary_COSHdbl;",   "The cosh() function  returns the hyperbolic cosine of 
x, which is \n\tdefined mathematically as (exp(x) + exp(-x)) / 2."   ]
@@ -8007,7 +8006,7 @@ Ready.
 [ "mmath", "sinh", "command mmath.sinh(x:dbl):dbl ",   
"MATHunary_SINHdbl;",   "The sinh() function  returns  the  hyperbolic sine of 
x, which \nis defined mathematically as (exp(x) - exp(-x)) / 2." ]
 [ "mmath", "sinh", "command mmath.sinh(x:flt):flt ",   
"MATHunary_SINHflt;",   ""  ]
 [ "mmath", "sqlrand",  "command mmath.sqlrand(seed:int):int ", 
"MATHsqlrandint;",  "initialize the rand() function with a seed and call 
rand()"]
-[ "mmath", "sqrt", "command mmath.sqrt(y:dbl):dbl ",   
"MATHunary_SQRTdbl;",   "The cbrt(x) function returns the non-negative cube 
root of x." ]
+[ "mmath", "sqrt", "command mmath.sqrt(y:dbl):dbl ",   
"MATHunary_SQRTdbl;",   "The sqrt(x) function returns the non-negative root of 
x."  ]
 [ "mmath", "sqrt", "command mmath.sqrt(y:flt):flt ",   
"MATHunary_SQRTflt;",   ""  ]
 [ "mmath", "srand","command mmath.srand(seed:int):void ",  
"MATHsrandint;","initialize the rand() function with a seed"]
 [ "mmath", "tan",  "command mmath.tan(x:dbl):dbl ",
"MATHunary_TANdbl;","The tan(x) function returns the tangent of x,\n
where x is given in radians"]
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
@@ -10303,7 +10303,6 @@ Ready.
 [ "mdb",   "start","pattern mdb.start(clientid:int):void ",
"MDBstart;","Start interactive debugger on a client"]
 [ "mdb",   "start","pattern mdb.start(mod:str, fcn:str):void ",
"MDBstartFactory;", "Start intera

MonetDB: default - Merge with Dec2016 branch.

2016-12-16 Thread Sjoerd Mullender
Changeset: 3bc9a0d53f85 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3bc9a0d53f85
Added Files:
debian/libmonetdb-stream8.install
sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out-noapprove
sql/test/emptydb-upgrade-chain-hge/Tests/dump.stable.err-noapprove
sql/test/emptydb-upgrade-chain-hge/Tests/dump.stable.out-noapprove
sql/test/emptydb-upgrade-chain/Tests/check.stable.out-noapprove
sql/test/emptydb-upgrade-chain/Tests/dump.stable.err-noapprove
sql/test/emptydb-upgrade-chain/Tests/dump.stable.out-noapprove
sql/test/emptydb-upgrade-hge/Tests/check.stable.out-noapprove
sql/test/emptydb-upgrade-hge/Tests/dump.stable.err-noapprove
sql/test/emptydb-upgrade-hge/Tests/dump.stable.out-noapprove
sql/test/emptydb-upgrade/Tests/check.stable.out-noapprove
sql/test/emptydb-upgrade/Tests/dump.stable.err-noapprove
sql/test/emptydb-upgrade/Tests/dump.stable.out-noapprove
sql/test/emptydb/Tests/dump.stable.err-noapprove
sql/test/emptydb/Tests/dump.stable.out-noapprove
Removed Files:
debian/libmonetdb-stream9.install
Modified Files:
debian/control
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
monetdb5/mal/Tests/tst661.stable.out
monetdb5/mal/Tests/tst903.stable.out
monetdb5/modules/mal/Tests/call00.stable.out
monetdb5/optimizer/Tests/ARexample.stable.out
monetdb5/optimizer/Tests/dataflow5.stable.out
monetdb5/optimizer/Tests/inlineFunction2.stable.out
monetdb5/optimizer/Tests/projectionchain.stable.out
monetdb5/optimizer/Tests/reorder00.stable.out
monetdb5/optimizer/Tests/tst4030.stable.out
sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.out
sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out
sql/test/BugTracker-2009/Tests/explain_gives_crash.SF-2741829.stable.out

sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out

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

sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out

sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.stable.out

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128
sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out.single
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/dump.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/dump.stable.out
sql/test/emptydb-upgrade-hge/Tests/dump.stable.out.int128
sql/test/emptydb-upgrade/Tests/dump.stable.out
sql/test/emptydb/Tests/dump.stable.out
sql/test/mapi/Tests/perl_dbi.stable.out
sql/test/mapi/Tests/sql_int128.stable.out
sql/test/mergetables/Tests/mergequery.stable.out
sql/test/remote/Tests/partition_elim.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 331 to 300 lines):

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -42,7 +42,7 @@ Description: MonetDB development files
  This package contains files needed to develop extensions to the core
  functionality of MonetDB.
 
-Package: libmonetdb-stream9
+Package: libmonetdb-stream8
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: MonetDB stream library
@@ -57,7 +57,7 @@ Description: MonetDB stream library
 Package: libmonetdb-stream-dev
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
- libmonetdb-stream9 (= ${source:Version})
+ libmonetdb-stream8 (= ${source:Version})
 Description: MonetDB stream library development files
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
@@ -65,7 +65,7 @@ Description: MonetDB stream library deve
  accelerators.  It also has an SQL frontend.
 

MonetDB: default - Merge with Dec2016 branch.

2016-12-17 Thread Sjoerd Mullender
Changeset: b7f8f4c311e6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b7f8f4c311e6
Modified Files:
sql/storage/bat/bat_table.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (70 lines):

diff --git a/sql/storage/bat/bat_table.c b/sql/storage/bat/bat_table.c
--- a/sql/storage/bat/bat_table.c
+++ b/sql/storage/bat/bat_table.c
@@ -137,38 +137,6 @@ full_destroy(sql_column *c, BAT *b)
 }
 
 static oid
-column_lookup_row(sql_trans *tr, sql_column *c, const void *value) 
-{
-   BAT *b = NULL, *s = NULL;
-   oid rid = oid_nil;
-
-   b = full_column(tr, c);
-   if (!b)
-   return oid_nil;
-
-   if (store_funcs.count_del(tr, c->t)) 
-   s = store_funcs.bind_del(tr, c->t, RD_INS);
-
-   if (BAThash(b, 0) == GDK_SUCCEED) {
-   BATiter cni = bat_iterator(b);
-   BUN p;
-
-   HASHloop(cni, cni.b->thash, p, value) {
-   oid pos = p;
-
-   if (!s || BUNfnd(s, &pos) == BUN_NONE) {
-   rid = p;
-   break;
-   }
-   }
-   }
-   if (s)
-   bat_destroy(s);
-   full_destroy(c, b);
-   return rid;
-}
-
-static oid
 column_find_row(sql_trans *tr, sql_column *c, const void *value, ...)
 {
va_list va;
@@ -177,9 +145,6 @@ column_find_row(sql_trans *tr, sql_colum
sql_column *n = NULL;
 
va_start(va, value);
-   if ((n = va_arg(va, sql_column *)) == NULL) 
-   return column_lookup_row(tr, c, value);
-
s = delta_cands(tr, c->t);
if (!s)
return oid_nil;
@@ -192,7 +157,7 @@ column_find_row(sql_trans *tr, sql_colum
bat_destroy(s);
s = r;
full_destroy(c, b);
-   do {
+   while ((n = va_arg(va, sql_column *)) != NULL) {
value = va_arg(va, void *);
c = n;
 
@@ -205,7 +170,7 @@ column_find_row(sql_trans *tr, sql_colum
bat_destroy(s);
s = r;
full_destroy(c, b);
-   } while ((n = va_arg(va, sql_column *)) != NULL); 
+   }
va_end(va);
if (BATcount(s) == 1) {
BATiter ri = bat_iterator(s);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

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

Merge with Dec2016 branch.


diffs (48 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -644,3 +644,6 @@ 0027cb04877b7687f45277a81a25253a63e9f21f
 ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_1
 ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_release
 deeebb69952f76e3377664bb97997885b283f9d1 fix-bad-merge
+afc859894553ef804cded49a83b035d9d2cda73b Dec2016_3
+ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_release
+afc859894553ef804cded49a83b035d9d2cda73b Dec2016_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -955,6 +955,9 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Sat Dec 17 2016 Sjoerd Mullender  - 11.25.3-20161217
+- Rebuilt.
+
 * Wed Dec 14 2016 Panagiotis Koutsourakis  - 
11.25.1-20161214
 - Rebuilt.
 - BZ#3357: Implement setQueryTimeout()
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+monetdb (11.25.3) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Sjoerd Mullender   Sat, 17 Dec 2016 11:58:13 +0100
+
 monetdb (11.25.1) unstable; urgency=low
 
   * Rebuilt.
diff --git a/libversions b/libversions
--- a/libversions
+++ b/libversions
@@ -36,7 +36,7 @@
 
 # version of the GDK library (subdirectory gdk; also includes
 # common/options and common/utils)
-GDK_VERSION=14:0:0
+GDK_VERSION=14:1:0
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=8:1:0
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2016-12-19 Thread Sjoerd Mullender
Changeset: 1e56d65707c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1e56d65707c3
Modified Files:
buildtools/autogen/autogen/msc.py

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
sql/backends/monet5/sql.c
sql/backends/monet5/sql_scenario.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
sql/storage/sql_storage.h
sql/storage/store.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 410 to 300 lines):

diff --git a/buildtools/autogen/autogen/msc.py 
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -334,7 +334,7 @@ def msc_dep(fd, tar, deplist, msc):
 if target == "LIB":
 d, dext = split_filename(deplist[0])
 if dext in ("c", "yy.c", "tab.c"):
-fd.write('\t$(CC) $(CFLAGS) $(%s_CFLAGS) $(GENDLL) 
-D_CRT_SECURE_NO_WARNINGS -DLIB%s -Fo"%s" -c "%s"\n' %
+fd.write('\t$(CC) $(CFLAGS) $(%s_CFLAGS) $(GENDLL) 
-D_CRT_SECURE_NO_WARNINGS -DLIB%s "-Fo%s" -c "%s"\n' %
  (split_filename(msc_basename(src))[0], name, t, src))
 if ext == 'res':
 fd.write("\t$(RC) -fo%s %s\n" % (t, src))
diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
--- 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
+++ 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
@@ -61,16 +61,16 @@ Ready.
 % .explain # table_name
 % mal # name
 % clob # type
-% 129 # length
+% 149 # length
 function user.s8_1():void;
-X_38:void := querylog.define("explain copy into ttt from 
\\'a:tmp/xyz\\';","default_pipe",10);
-X_0 := sql.mvc();
-(X_21:bat[:int],X_22:bat[:int],X_23:bat[:int]) := 
sql.copy_from(nil,"|","\\n",nil:str,"null","a:\\tmp/xyz",-1,0,0,0,nil:str);
-X_25 := sql.append(X_0,"sys","ttt","a",X_21);
-X_30 := sql.append(X_25,"sys","ttt","b",X_22);
-X_33 := sql.append(X_30,"sys","ttt","c",X_23);
-X_35 := aggr.count(X_23);
-sql.affectedRows(X_33,X_35);
+X_0:void := querylog.define("explain copy into ttt from 
\\'a:tmp/xyz\\';","default_pipe",4:int);
+X_3 := sql.mvc();
+(X_24:bat[:int],X_25:bat[:int],X_26:bat[:int]) := 
sql.copy_from(nil:ptr,"|","\\n",nil:str,"null","a:\\tmp/xyz",-1:lng,0:lng,0:int,0:int,nil:str);
+X_28 := sql.append(X_3,"sys","ttt","a",X_24);
+X_33 := sql.append(X_28,"sys","ttt","b",X_25);
+X_36 := sql.append(X_33,"sys","ttt","c",X_26);
+X_38 := aggr.count(X_26);
+sql.affectedRows(X_36,X_38);
 end user.s8_1;
 #inline   actions= 0 time=1 usec 
 #remapactions= 0 time=5 usec 
@@ -115,16 +115,16 @@ end user.s8_1;
 % .explain # table_name
 % mal # name
 % clob # type
-% 128 # length
+% 148 # length
 function user.s24_1():void;
-X_38:void := querylog.define("explain copy into ttt from 
\\'Z:/tmp/xyz\\';","user_1",10);
-X_0 := sql.mvc();
-(X_21:bat[:int],X_22:bat[:int],X_23:bat[:int]) := 
sql.copy_from(nil,"|","\\n",nil:str,"null","Z:/tmp/xyz",-1,0,0,0,nil:str);
-X_25 := sql.append(X_0,"sys","ttt","a",X_21);
-X_30 := sql.append(X_25,"sys","ttt","b",X_22);
-X_35 := aggr.count(X_23);
-X_33 := sql.append(X_30,"sys","ttt","c",X_23);
-sql.affectedRows(X_33,X_35);
+X_0:void := querylog.define("explain copy into ttt from 
\\'Z:/tmp/xyz\\';","user_1",4:int);
+X_3 := sql.mvc();
+(X_24:bat[:int],X_25:bat[:int],X_26:bat[:int]) := 
sql.copy_from(nil:ptr,"|","\\n",nil:str,"null","Z:/tmp/xyz",-1:lng,0:lng,0:int,0:int,nil:str);
+X_28 := sql.append(X_3,"sys","ttt","a",X_24);
+X_33 := sql.append(X_28,"sys","ttt","b",X_25);
+X_38 := aggr.count(X_26);
+X_36 := sql.append(X_33,"sys","ttt","c",X_26);
+sql.affectedRows(X_36,X_38);
 end user.s24_1;
 #inline   actions= 0 time=1 usec 
 #remapactions= 0 time=4 usec 
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
@@ -4800,6 +4800,7 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma
node *o;
int ordered = 0;
BUN cnt = 0;
+   BUN dcnt;
 
if ((msg = getSQLContext(cntxt, mb, &m, NULL)) != NULL)
return msg;
@@ -4841,17 +4842,17 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma
if( del == NULL)
throw(SQL, "sql.vacuum", "Can not access deletion column");
 
-   if (BATcount(del) > 0) {
+   dcnt = BATcount(del);
+   BBPunfix(del->batCacheid);
+   if (dcnt > 0) {
/* now decide on the algorithm */
-   BBPunfix(del->batCacheid);
if (ordered) {
-   if (BATcount(

MonetDB: default - Merge with Dec2016 branch.

2016-12-21 Thread Sjoerd Mullender
Changeset: a72af0ac5512 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a72af0ac5512
Removed Files:
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
Modified Files:
MonetDB.spec
debian/control
sql/storage/store.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.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.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/dump.stable.out
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/dump.stable.out
sql/test/testdb-upgrade/Tests/dump.stable.out.Windows
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 3767 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -136,6 +136,7 @@ BuildRequires: bzip2-devel
 %if %{?with_fits:1}%{!?with_fits:0}
 BuildRequires: cfitsio-devel
 %endif
+BuildRequires: gcc
 %if %{?with_geos:1}%{!?with_geos:0}
 BuildRequires: geos-devel >= 3.4.0
 %endif
@@ -389,7 +390,7 @@ Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
 %endif
 Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Requires: python-monetdb >= 1.0
+Requires: python-pymonetdb >= 1.0
 
 %description client-tests
 MonetDB is a database management system that is developed from a
@@ -864,6 +865,7 @@ Group: Applications/Databases
 Requires: %{name}-testing = %{version}-%{release}
 Requires: %{name}-client-tests = %{version}-%{release}
 Requires: python
+BuildArch: noarch
 
 %description testing-python
 MonetDB is a database management system that is developed from a
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -137,7 +137,7 @@ Depends: ${shlibs:Depends}, libmonetdb-c
  monetdb5-server (= ${source:Version}),
  libdbd-monetdb-perl (>= 1.0),
  php-monetdb (>= 1.0),
- python-monetdb (>= 1.0),
+ python-pymonetdb (>= 1.0),
  monetdb5-sql (= ${source:Version})
 Description: MonetDB client testing tools
  MonetDB is a database management system that is developed from a
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1729,12 +1729,10 @@ store_vacuum( sql_trans *tr )
for( n = s->tables.set->h; n; n = n->next) {
sql_table *t = n->data;
sql_column *c = t->columns.set->h->data;
-   int cnt = 0;
 
if (!store_funcs.count_col(tr, c, 0) && 
!store_funcs.count_upd(tr, t) && 
-   (cnt = store_funcs.count_del(tr, t)) > 128) {
-   /*printf("vacuum (%d) %s\n", cnt, t->base.name);*/
+   store_funcs.count_del(tr, t) > 128) {
table_funcs.table_vacuum(tr, t);
}
}
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
@@ -24,216 +24,10 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-create procedure sys.createorderindex(sys string, tab string, col string)
-external name sql.createorderindex;
-create procedure sys.droporderindex(sys string, tab string, col string)
-external name sql.droporderindex;
-drop function sys.zorder_decode_y;
-drop function sys.zorder_decode_x;
-drop function sys.zorder_encode;
-create function profiler.getprofilerlimit() returns integer external name 
profiler.getprofilerlimit;
-create procedure  profiler.setprofilerlimit(lim integer) external name 
profiler.setprofilerlimit;
-drop view sys.tablestoragemodel;
-drop view sys.storagemodel;
-drop function sys.storagemodel();
-drop procedure sys.storagemodelinit();
-drop function sys."storage"(string, string, string);
-drop function sys."storage"(string, string);
-drop function sys."storage"(string);
-drop view sys."storage";
-drop function sys."storage"();
-alter table sys.storagemodelinput add column "revsorted" boolean;
-alter table sys.storagemodelinput add column "unique" boolean;
-alter table sys.storagemodelinput add column "orde

MonetDB: default - Merge with Dec2016 branch.

2016-12-22 Thread Sjoerd Mullender
Changeset: e8f4830c7cc2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e8f4830c7cc2
Added Files:
monetdb5/tools/Tests/mserver5--help.stable.err.Windows
sql/test/Tests/bincopycollist-prepare.py
Removed Files:
sql/test/Tests/bincopycollist-prepare.bat
sql/test/Tests/bincopycollist-prepare.sh
sql/test/Tests/bincopyint.bin
Modified Files:
monetdb5/mal/mal_parser.c
sql/test/BugTracker-2016/Tests/All
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
sql/test/Tests/bincopycollist-prepare.stable.err
sql/test/Tests/bincopycollist-prepare.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (193 lines):

diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -949,6 +949,15 @@ static str parseModule(Client cntxt)
return "";
 }
 
+
+static int
+malLibraryEnabled(str name) {
+   if (strcmp(name, "pyapi") == 0) {
+   return GDKgetenv_istrue("embedded_py") || 
GDKgetenv_isyes("embedded_py");
+   }
+   return 1;
+}
+
 /*
  * Include statement
  * An include statement is immediately taken into effect. This
@@ -995,6 +1004,10 @@ parseInclude(Client cntxt)
}
skipToEnd(cntxt);
 
+   if (!malLibraryEnabled(modnme)) {
+   return "";
+   }
+
s = loadLibrary(modnme, FALSE);
if (s) {
parseError(cntxt, s);
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows 
b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
new file mode 100644
--- /dev/null
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
@@ -0,0 +1,43 @@
+stderr of test 'mserver5--help` in directory 'monetdb5/tools` itself:
+
+
+# 16:36:12 >  
+# 16:36:12 >  Mtimeout -timeout 300 ./mserver5--help mserver5--help 
+# 16:36:12 >  
+
+
+# 16:36:12 >  
+# 16:36:12 >  Mtimeout -timeout 60 mserver5 --config= --help
+# 16:36:12 >  
+
+Usage: mserver5.exe [options] [scripts]
+--dbpath=  Specify database location
+--dbextra= Directory for transient BATs
+--dbinit=   Execute statement at startup
+--config=Use config_file to read options from
+--daemon=yes|no   Do not read commands from standard input [no]
+--single-user Allow only one user at a time
+--readonlySafeguard database
+--set =Set configuration option
+--helpPrint this list of options
+--version Print version and compile time info
+The debug, testing & trace options:
+ --threads
+ --memory
+ --io
+ --heaps
+ --properties
+ --transactions
+ --modules
+ --algorithms
+ --performance
+ --optimizers
+ --trace
+ --forcemito
+ --recycler
+ --debug=
+
+# 10:03:11 >  
+# 10:03:11 >  Done.
+# 10:03:11 >  
+
diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -21,7 +21,7 @@ rank_rewrite.Bug-3890
 HAVE_LIBBZ2?min-max-uuid-column-wrong-results.Bug-3953
 update_crash.Bug-3954
 group_distinct_quantile.Bug-3927
-merge_project.Bug-3955
+HAVE_GEOM?merge_project.Bug-3955
 decimal_vs_integer.Bug-3941
 foreign_key.Bug-3938
 invalidcolumns.Bug-3968
@@ -57,8 +57,8 @@ cast_and_floor.Bug-6071
 union.Bug-6069
 ifthenelse-void.Bug-6075
 assert-on-table-producing-function.Bug-6076
-assert-on-push-project-up.Bug-6077
-assert-on-project.Bug-6078
+HAVE_NETCDF?assert-on-push-project-up.Bug-6077
+HAVE_SAMTOOLS?assert-on-project.Bug-6078
 crash.Bug-6081
 merge-table-edit.Bug-6084
 dce.Bug-6114
diff --git a/sql/test/Tests/bincopycollist-prepare.bat 
b/sql/test/Tests/bincopycollist-prepare.bat
deleted file mode 100755
--- a/sql/test/Tests/bincopycollist-prepare.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@prompt # $t $g
-@echo on
-
-copy "%TSTSRCDIR%\bincopyint.bin" "%TSTTRGDIR%"
diff --git a/sql/test/Tests/bincopycollist-prepare.py 
b/sql/test/Tests/bincopycollist-prepare.py
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/bincopycollist-prepare.py
@@ -0,0 +1,9 @@
+import struct
+import os
+
+f = open(os.path.join(os.getenv('TSTTRGDIR'), 'bincopyint.bin'), 'wb')
+
+for i in range(10):
+f.write(struct.pack('@i', i))
+
+f.close()
diff --git a/sql/test/Tests/bincopycollist-prepare.sh 
b/sql/test/Tests/bincopycollist-prepare.sh
deleted file mode 100755
--- a/sql/test/Tests/bincopycollist-prepare.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-Mlog -x "cp $TSTSRCDIR/bincopyint.bin $TSTTRGDIR"
diff --git a/sql/test/Tests/bincopycollist-prepare.stable.err 
b/sql/test/Tests/bincopycollist-prepare.stable.err
--- a/sql/test/Tests/bincopycollist-prepare.stable.err
+++ b/sql/test/Tests/bincopycollist-prepare.stable.err
@@ -1,17 +1,12 @@
 stderr of test 'bincopycollist-prepare` in directory 'sql/test` itself:
 
 
-# 17:0

MonetDB: default - Merge with Dec2016 branch.

2016-12-28 Thread Sjoerd Mullender
Changeset: 8202ff01e3b0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8202ff01e3b0
Added Files:
sql/test/sys-schema/Tests/All
sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.sql
sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.stable.err
sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.stable.out
sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.sql
sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.stable.err
sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.stable.out
Modified Files:
monetdb5/optimizer/opt_mergetable.c
sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 684 to 300 lines):

diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -1429,11 +1429,25 @@ mat_topn(MalBlkPtr mb, InstrPtr p, matli
 static void
 mat_sample(MalBlkPtr mb, InstrPtr p, matlist_t *ml, int m)
 {
+   /* transform
+* a := sample.subuniform(b,n);
+* into
+* t1 := sample.subuniform(b1,n);
+* t2 := sample.subuniform(b2,n);
+* ...
+* t0 := mat.pack(t1,t2,...);
+* tn := sample.subuniform(t0,n);
+* a := algebra.projection(tn,t0);
+*
+* Note that this does *not* give a uniform sample of the original
+* bat b!
+*/
+
int tpe = getArgType(mb,p,0), k, piv;
-   InstrPtr pck, q;
+   InstrPtr pck, q, r;
 
pck = newInstruction(mb,matRef,packRef);
-   getArg(pck,0) = getArg(p,0);
+   getArg(pck,0) = newTmpVariable(mb, tpe);
 
for(k=1; k< ml->v[m].mi->argc; k++) {
q = copyInstruction(p);
@@ -1448,9 +1462,16 @@ mat_sample(MalBlkPtr mb, InstrPtr p, mat
pushInstruction(mb,pck);
 
q = copyInstruction(p);
+   getArg(q,0) = newTmpVariable(mb, tpe);
getArg(q,q->retc) = getArg(pck,0);
pushInstruction(mb,q);
 
+   r = newInstruction(mb, algebraRef, projectionRef);
+   getArg(r,0) = getArg(p,0);
+   pushArgument(mb, r, getArg(q, 0));
+   pushArgument(mb, r, getArg(pck, 0));
+   pushInstruction(mb, r);
+
ml->v[piv].packed = 1;
ml->v[piv].type = mat_slc;
 }
diff --git a/sql/test/sys-schema/Tests/All b/sql/test/sys-schema/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/sys-schema/Tests/All
@@ -0,0 +1,2 @@
+check_PrimaryKey_uniqueness
+check_AlternateKey_uniqueness
diff --git a/sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.sql 
b/sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/sys-schema/Tests/check_AlternateKey_uniqueness.sql
@@ -0,0 +1,36 @@
+-- check all standard sys (and tmp) tables on Alternate Key uniqueness
+-- All queries should return NO rows (so no duplicates found).
+SELECT COUNT(*) AS duplicates, name FROM sys.schemas GROUP BY name HAVING 
COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_type_name FROM sys.table_types GROUP BY 
table_type_name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, schema_id, name FROM sys._tables GROUP BY 
schema_id, name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, schema_id, name FROM tmp._tables GROUP BY 
schema_id, name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, schema_id, name FROM sys.tables GROUP BY 
schema_id, name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM sys._columns GROUP BY 
table_id, name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM tmp._columns GROUP BY 
table_id, name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM sys.columns GROUP BY 
table_id, name HAVING COUNT(*) > 1;
+
+-- the next query returns duplicates for overloaded functions (same function 
but with different args), hence it has been disabled
+--SELECT COUNT(*) AS duplicates, schema_id, name, func, mod, language, type, 
side_effect, varres, vararg FROM sys.functions
+-- GROUP BY schema_id, name, func, mod, language, type, side_effect, varres, 
vararg HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, func_id, name FROM sys.args GROUP BY func_id, 
name HAVING COUNT(*) > 1;
+
+SELECT COUNT(*) AS duplicates, schema_id, systemname, sqlname FROM sys.types 
GROUP BY schema_id, systemname, sqlname HAVING COUNT(*) > 1;
+
+SELECT COUNT(*) AS duplicates, id, name FROM sys.objects GROUP BY id, name 
HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, id, name FROM tmp.objects GROUP BY id, name 
HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM sys.keys GROUP BY table_id, 
name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM tmp.keys GROUP BY table_id, 
name HAVING COUNT(*) > 1;
+SELECT COUNT(*) AS duplicates, table_id, name FROM sys.idxs GROUP BY table_id, 
name HAVING COUNT(*) >

MonetDB: default - Merge with Dec2016 branch.

2017-01-01 Thread Sjoerd Mullender
Changeset: 668f5608c6da for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=668f5608c6da
Added Files:

sql/test/BugTracker-2016/Tests/inner_join_cross_join.Bug-6140.stable.out.int128
Removed Files:
sql/benchmarks/wisconsin/Tests/All
sql/benchmarks/wisconsin/Tests/load.prologue5
sql/benchmarks/wisconsin/Tests/load.sql.src
sql/benchmarks/wisconsin/Tests/load.stable.err
sql/benchmarks/wisconsin/Tests/load.stable.out
sql/benchmarks/wisconsin/Tests/load.timeout
sql/benchmarks/wisconsin/Tests/wisconsin-select.reqtests
sql/benchmarks/wisconsin/Tests/wisconsin-select.sql.src
sql/benchmarks/wisconsin/Tests/wisconsin-select.stable.err
sql/benchmarks/wisconsin/Tests/wisconsin-select.stable.out
sql/benchmarks/wisconsin/Tests/wisconsin-update.reqtests
sql/benchmarks/wisconsin/Tests/wisconsin-update.sql.src
sql/benchmarks/wisconsin/Tests/wisconsin-update.stable.err
sql/benchmarks/wisconsin/Tests/wisconsin-update.stable.out
sql/benchmarks/wisconsin/load.sql
sql/benchmarks/wisconsin/wisconsin-select.sql
sql/benchmarks/wisconsin/wisconsin-update.sql
sql/benchmarks/wisconsin/wisconsin.sql
Modified Files:
gdk/gdk_bbp.c
gdk/gdk_interprocess.h
monetdb5/optimizer/opt_candidates.c
sql/backends/monet5/UDF/pyapi/50_pyapi.mal
sql/backends/monet5/UDF/pyapi/Makefile.ag
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/connection.h
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/UDF/pyapi/emit.h
sql/backends/monet5/UDF/pyapi/formatinput.c
sql/backends/monet5/UDF/pyapi/formatinput.h
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyapi.h
sql/backends/monet5/UDF/pyapi/pyapi.mal
sql/backends/monet5/UDF/pyapi/pyapi_locatepython.bat
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/backends/monet5/UDF/pyapi/pytypes.h
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/UDF/pyapi/type_conversion.h
sql/backends/monet5/UDF/pyapi/undef.h
sql/backends/monet5/UDF/pyapi/unicode.c
sql/backends/monet5/UDF/pyapi/unicode.h
sql/common/sql_list.c

sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2016/Tests/inner_join_cross_join.Bug-6140.stable.out
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.32bit
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 78053 to 300 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3174,11 +3174,15 @@ BBPrecover(int farmid)
 gdk_return
 BBPrecover_subdir(void)
 {
-   str subdirpath = GDKfilepath(0, NULL, SUBDIR, NULL);
-   DIR *dirp = opendir(subdirpath);
+   str subdirpath;
+   DIR *dirp;
struct dirent *dent;
gdk_return ret = GDK_SUCCEED;
 
+   subdirpath = GDKfilepath(0, NULL, SUBDIR, NULL);
+   if (subdirpath == NULL)
+   return GDK_FAIL;
+   dirp = opendir(subdirpath);
GDKfree(subdirpath);
if (dirp == NULL) {
return GDK_SUCCEED; /* nothing to do */
diff --git a/gdk/gdk_interprocess.h b/gdk/gdk_interprocess.h
--- a/gdk/gdk_interprocess.h
+++ b/gdk/gdk_interprocess.h
@@ -3,7 +3,7 @@
  * License, v. 2.0.  If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
- * Copyright 2008-2015 MonetDB B.V.
+ * Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
  */
 
 /*
diff --git a/monetdb5/optimizer/opt_candidates.c 
b/monetdb5/optimizer/opt_candidates.c
--- a/monetdb5/optimizer/opt_candidates.c
+++ b/monetdb5/optimizer/opt_candidates.c
@@ -27,47 +27,50 @@ OPTcandidatesImplementation(Client cntxt
(void) stk; /* to fool compilers */
for (i = 0; i < mb->stop; i++) {
p = getInstrPtr(mb,i);
-   if( p->token == ASSIGNsymbol && isVarCList(mb,getArg(p,1)))
-   setVarCList(mb,getArg(p,0));
+   if( p->token == ASSIGNsymbol) {
+   int j;
+   for (j = 0; j < p->retc && j + p->retc < p->argc; j++)
+   if (isVarCList(mb,getArg(p,p->retc + j)))
+   setVarCList(mb,getArg(p,j));
+   }
if( getModuleId(p) == sqlRef){
if(getFunctionId(p) == tidRef) 
setVarCList(mb,getArg(p,0));
-   if(getFunctionId(p) == subdeltaRef) 
+   else if(getFunc

MonetDB: default - Merge with Dec2016 branch.

2017-01-01 Thread Sjoerd Mullender
Changeset: 08862aea152a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=08862aea152a
Modified Files:
HowToStart.rst
Makefile.ag
NT/Makefile
NT/installer32/cv64-32.sh
NT/installer64/cv32-64.sh
NT/installer64/fixmsi.py
NT/monetdb_config.h.in
NT/rules.msc
NT/updatecodes.py
NT/wincompile.py
NT/winconfig.py
README
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/autogen/setup.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/mnc.c
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/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

MonetDB: default - Merge with Dec2016 branch.

2017-01-03 Thread Sjoerd Mullender
Changeset: 6ea1caeb6147 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ea1caeb6147
Added Files:
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker-2017/Tests/avggroupbysq.Bug-6178.sql
sql/test/BugTracker-2017/Tests/avggroupbysq.Bug-6178.stable.err
sql/test/BugTracker-2017/Tests/avggroupbysq.Bug-6178.stable.out
sql/test/BugTracker-2017/Tests/shutdown.Bug-6182.sql
sql/test/BugTracker-2017/Tests/shutdown.Bug-6182.stable.err
sql/test/BugTracker-2017/Tests/shutdown.Bug-6182.stable.out
Modified Files:
gdk/gdk_aggr.c
gdk/gdk_interprocess.c
gdk/gdk_interprocess.h
monetdb5/modules/mal/clients.c
monetdb5/optimizer/opt_mergetable.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/conversion.c
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/UDF/pyapi/formatinput.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyapi.h
sql/backends/monet5/UDF/pyapi/pyheader.h
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/UDF/pyapi/unicode.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 514 to 300 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -1386,7 +1386,8 @@ BATgroupavg(BAT **bnp, BAT **cntsp, BAT 
return GDK_SUCCEED;
}
 
-   if ((e == NULL ||
+   if ((!skip_nils || cntsp == NULL || b->tnonil) &&
+   (e == NULL ||
 (BATcount(e) == BATcount(b) && e->hseqbase == b->hseqbase)) &&
(BATtdense(g) || (g->tkey && g->tnonil))) {
/* trivial: singleton groups, so all results are equal
diff --git a/gdk/gdk_interprocess.c b/gdk/gdk_interprocess.c
--- a/gdk/gdk_interprocess.c
+++ b/gdk/gdk_interprocess.c
@@ -6,10 +6,11 @@
  * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
  */
 
-#include "gdk_interprocess.h"
+#include "monetdb_config.h"
 
 #ifdef HAVE_FORK
 
+#include "gdk_interprocess.h"
 #include "gdk.h"
 #include "gdk_private.h"
 
diff --git a/gdk/gdk_interprocess.h b/gdk/gdk_interprocess.h
--- a/gdk/gdk_interprocess.h
+++ b/gdk/gdk_interprocess.h
@@ -14,8 +14,6 @@
 #ifndef _GDK_INTERPROCES_H_
 #define _GDK_INTERPROCES_H_
 
-#include "monetdb_config.h"
-
 #ifdef HAVE_FORK
 #include "gdk.h"
 
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
@@ -540,7 +540,7 @@ str CLTgetUsers(Client cntxt, MalBlkPtr 
 str
 CLTshutdown(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) {
str *ret  = getArgReference_str(stk,pci,0);
-   int delay = *getArgReference_int(stk,pci,1);
+   int delay;
bit force = FALSE;
int leftover;
char buf[1024]={"safe to stop last connection"};
@@ -551,11 +551,14 @@ CLTshutdown(Client cntxt, MalBlkPtr mb, 
(void) mb;
switch( getArgType(mb,pci,1)){
case TYPE_bte:
+   delay = *getArgReference_bte(stk,pci,1);
+   break;
case TYPE_sht:
delay = *getArgReference_sht(stk,pci,1);
break;
default:
delay = *getArgReference_int(stk,pci,1);
+   break;
}
 
if ( cntxt->user != mal_clients[0].user)
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -1045,10 +1045,7 @@ mat_group_aggr(MalBlkPtr mb, InstrPtr p,
ai2 = pushArgument(mb, ai2, getArg(ai1, 0));
ai2 = pushArgument(mb, ai2, mat[g].mv);
ai2 = pushArgument(mb, ai2, mat[e].mv);
-   if (isAvg)
-   ai2 = pushBit(mb, ai2, 0); /* do not skip nils */
-   else
-   ai2 = pushBit(mb, ai2, 1); /* skip nils */
+   ai2 = pushBit(mb, ai2, 1); /* skip nils */
if (getFunctionId(p) != subminRef && getFunctionId(p) != submaxRef)
ai2 = pushBit(mb, ai2, 1);
pushInstruction(mb, ai2);
diff --git a/sql/backends/monet5/UDF/pyapi/connection.c 
b/sql/backends/monet5/UDF/pyapi/connection.c
--- a/sql/backends/monet5/UDF/pyapi/connection.c
+++ b/sql/backends/monet5/UDF/pyapi/connection.c
@@ -6,6 +6,7 @@
  * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
  */
 
+#include "monetdb_config.h"
 #include "pyapi.h"
 #include "conversion.h"
 #include "connection.h"
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
@@ -1,4 +1,5 @@
 
+#include "monetdb_config.h"
 #include "conversion.h"
 #include "convert_loops.h"
 #include "pytyp

MonetDB: default - Merge with Dec2016 branch.

2017-01-03 Thread Sjoerd Mullender
Changeset: 03af37271b38 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03af37271b38
Modified Files:
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (18 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -4232,6 +4232,14 @@ def main(argv) :
 break
 if global_timeout and start_time + global_timeout < 
time.time():
 break
+if not testweb:
+# after a directory has been tested, create
+# the index file so that we can look at test
+# results while the tests are running
+env['TSTDIR'] = ""
+env['TSTTRGDIR'] = os.path.join(TSTTRGBASE, TSTPREF)
+body = body_bad + body_good
+CreateHtmlIndex(env, *body)
 except KeyboardInterrupt:
 # if we get interrupted between directories, we still want output
 pass
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-03 Thread Sjoerd Mullender
Changeset: 040e602e3444 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=040e602e3444
Modified Files:
monetdb5/mal/mal_interpreter.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (96 lines):

diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -486,7 +486,7 @@ str runMALsequence(Client cntxt, MalBlkP
if (startpc+1 == stoppc) {
pci = getInstrPtr(mb, startpc);
if (pci->argc > 16) {
-   backup = GDKzalloc(pci->argc * sizeof(ValRecord));
+   backup = GDKmalloc(pci->argc * sizeof(ValRecord));
if( backup == NULL)
throw(MAL, "mal.interpreter", MAL_MALLOC_FAIL);
garbage = (int*)GDKzalloc(pci->argc * sizeof(int));
@@ -500,7 +500,7 @@ str runMALsequence(Client cntxt, MalBlkP
memset(garbages, 0, sizeof(garbages));
}
} else if ( mb->maxarg > 16 ){
-   backup = GDKzalloc(mb->maxarg * sizeof(ValRecord));
+   backup = GDKmalloc(mb->maxarg * sizeof(ValRecord));
if( backup == NULL)
throw(MAL, "mal.interpreter", MAL_MALLOC_FAIL);
garbage = (int*)GDKzalloc(mb->maxarg * sizeof(int));
@@ -588,25 +588,16 @@ str runMALsequence(Client cntxt, MalBlkP
 * garbage collected are identified. In the post-execution
 * phase they are removed.
 */
+   for (i = 0; i < pci->retc; i++)
+   backup[i] = stk->stk[getArg(pci, i)];
+
if (garbageControl(pci)) {
for (i = 0; i < pci->argc; i++) {
int a = getArg(pci, i);
 
-   backup[i].vtype = 0;
-   backup[i].len = 0;
-   backup[i].val.pval = 0;
garbage[i] = -1;
if (stk->stk[a].vtype == TYPE_bat && 
getEndScope(mb, a) == stkpc && isNotUsedIn(pci, i + 1, a))
garbage[i] = a;
-
-   if (i < pci->retc && stk->stk[a].vtype == 
TYPE_bat) {
-   backup[i] = stk->stk[a];
-   } else if (i < pci->retc &&
-  0 < stk->stk[a].vtype &&
-  stk->stk[a].vtype < TYPE_any 
&&
-  
ATOMextern(stk->stk[a].vtype)) {
-   backup[i] = stk->stk[a];
-   }
}
}
 
@@ -812,6 +803,16 @@ str runMALsequence(Client cntxt, MalBlkP
runtimeProfileFinish(cntxt, mb);
/* check for strong debugging after each MAL statement */
if ( pci->token != FACcall && ret== MAL_SUCCEED) {
+   for (i = 0; i < pci->retc; i++) {
+   lhs = &backup[i];
+   if (BATatoms[lhs->vtype].atomUnfix)
+   
(*BATatoms[lhs->vtype].atomUnfix)(VALget(lhs));
+   if (ATOMextern(lhs->vtype) &&
+   lhs->val.pval &&
+   lhs->val.pval != ATOMnilptr(lhs->vtype) 
&&
+   lhs->val.pval != stk->stk[getArg(pci, 
i)].val.pval)
+   GDKfree(lhs->val.pval);
+   }
if (GDKdebug & (CHECKMASK|PROPMASK) && exceptionVar < 
0) {
BAT *b;
 
@@ -841,28 +842,12 @@ str runMALsequence(Client cntxt, MalBlkP
if (isaBatType(getArgType(mb, pci, i))) 
{
bat bid = stk->stk[a].val.bval;
 
-   if (i < pci->retc && 
backup[i].val.bval != bat_nil) {
-   bat bx = 
backup[i].val.bval;
-   backup[i].val.bval = 
bat_nil;
-   BBPrelease(bx);
-   }
if (garbage[i] >= 0) {
PARDEBUG 
mnstr_printf(GDKstdout, "#GC pc=%d bid=%d %s done\n", stkpc, bid, 
getVarName(mb, garbage[i]));
bid = 
stk->stk[garbage[i]].val.bval;

stk->stk[garbage[i]].val.bval = bat_nil;

MonetDB: default - Merge with Dec2016 branch.

2017-01-04 Thread Sjoerd Mullender
Changeset: 32f47f6685cb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32f47f6685cb
Removed Files:
sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.sql
sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.err
sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out
Modified Files:
monetdb5/mal/mal.c
monetdb5/modules/atoms/inet.c
sql/test/BugTracker-2009/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 515 to 300 lines):

diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -151,6 +151,7 @@ void mserver_reset(int exit)
GDKfree(mal_clients->prompt);
GDKfree(mal_clients->username);
freeStack(mal_clients->glb);
+   freeSymbol(mal_clients->curprg);
mal_client_reset();
mal_linker_reset();
mal_resource_reset();
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -34,15 +34,30 @@
  *
  */
 typedef struct _inet {
-   unsigned char q1;
-   unsigned char q2;
-   unsigned char q3;
-   unsigned char q4;
-   unsigned char mask;
-   unsigned char filler1;
-   unsigned char filler2;
-   unsigned char isnil;
+   /* use a union to force alignment compatible with lng */
+   union {
+   struct {
+   unsigned char _q1;
+   unsigned char _q2;
+   unsigned char _q3;
+   unsigned char _q4;
+   unsigned char _mask;
+   unsigned char _filler1;
+   unsigned char _filler2;
+   unsigned char _isnil;
+   } s;
+   lng alignment;
+   } u;
 } inet;
+#define q1 u.s._q1
+#define q2 u.s._q2
+#define q3 u.s._q3
+#define q4 u.s._q4
+#define mask   u.s._mask
+#define filler1u.s._filler1
+#define filler2u.s._filler2
+#define isnil  u.s._isnil
+
 #ifdef WORDS_BIGENDIAN
 /* HACK ALERT: once upon a time, lng_nil was used as inet_nil, but on
  * big endian hardware, the byte that is not zero is on the other end;
@@ -72,7 +87,7 @@ mal_export str INET_comp_CSE(bit *retval
 mal_export str INETbroadcast(inet *retval, const inet *val);
 mal_export str INEThost(str *retval, const inet *val);
 mal_export str INETmasklen(int *retval, const inet *val);
-mal_export str INETsetmasklen(inet *retval, const inet *val, const int *mask);
+mal_export str INETsetmasklen(inet *retval, const inet *val, const int *msk);
 mal_export str INETnetmask(inet *retval, const inet *val);
 mal_export str INEThostmask(inet *retval, const inet *val);
 mal_export str INETnetwork(inet *retval, const inet *val);
@@ -82,7 +97,7 @@ mal_export str INET_inet(inet *d, const 
 mal_export str INET_fromstr(inet *ret, str *s);
 mal_export inet *INETnull(void);
 
-static inet inet_nil = {0,0,0,0,0,0,0,1};
+static inet inet_nil = {{{0,0,0,0,0,0,0,1}}};
 
 /**
  * Creates a new inet from the given string.
@@ -399,18 +414,18 @@ INET_comp_CW(bit *retval, const inet *va
 * be contained within */
*retval = 0;
} else {
-   unsigned int mask;
+   unsigned int msk;
unsigned char m[4];
 
if (val2->mask > 0)
-   mask = ~0U << (32 - val2->mask);
+   msk = ~0U << (32 - val2->mask);
else
-   mask = 0;
+   msk = 0;
 
-   m[0] = (mask >> 24) & 0xFF;
-   m[1] = (mask >> 16) & 0xFF;
-   m[2] = (mask >> 8) & 0xFF;
-   m[3] = mask & 0xFF;
+   m[0] = (msk >> 24) & 0xFF;
+   m[1] = (msk >> 16) & 0xFF;
+   m[2] = (msk >> 8) & 0xFF;
+   m[3] = msk & 0xFF;
 
/* all operations here are done byte based, to avoid byte sex
 * problems */
@@ -491,19 +506,19 @@ INETbroadcast(inet *retval, const inet *
 {
*retval = *val;
if (!in_isnil(val) && val->mask != 32) {
-   unsigned int mask;
+   unsigned int msk;
unsigned char m[4];
 
if (val->mask > 0)
-   mask = ~0U << (32 - val->mask);
+   msk = ~0U << (32 - val->mask);
else
-   mask = 0;
+   msk = 0;
 
-   mask = ~mask;   /* invert the mask */
-   m[0] = (mask >> 24) & 0xFF;
-   m[1] = (mask >> 16) & 0xFF;
-   m[2] = (mask >> 8) & 0xFF;
-   m[3] = mask & 0xFF;
+   msk = ~msk; /* invert the mask */
+   m[0] = (msk >> 24) & 0xFF;
+   m[1] = (msk >> 16) & 0xFF;
+ 

MonetDB: default - Merge with Dec2016 branch.

2017-01-05 Thread Sjoerd Mullender
Changeset: 2eb35fb7f046 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2eb35fb7f046
Modified Files:
monetdb5/mal/mal_module.c
Branch: default
Log Message:

Merge with Dec2016 branch.

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


MonetDB: default - Merge with Dec2016 branch.

2017-01-05 Thread Sjoerd Mullender
Changeset: a722eef5e949 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a722eef5e949
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
monetdb5/modules/atoms/batxml.c
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/kernel/batstr.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (50 lines):

diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.c
+++ b/monetdb5/modules/atoms/batxml.c
@@ -13,10 +13,8 @@
  * The collection of routines provided here are map operations
  * for the atom xml primitives.
  *
- * In line with the batcalc module, we assume that
- * if two bat operands are provided that they are already
- * aligned on the head. Moreover, the head of the BATs
- * are limited to :oid.
+ * In line with the batcalc module, we assume that if two bat operands
+ * are provided that they are aligned.
  *
  * The implementation is focussed on functionality. At a later stage
  * we may postpone string contstruction until it is really needed.
diff --git a/monetdb5/modules/kernel/batcolor.c 
b/monetdb5/modules/kernel/batcolor.c
--- a/monetdb5/modules/kernel/batcolor.c
+++ b/monetdb5/modules/kernel/batcolor.c
@@ -13,11 +13,8 @@
  * The collection of routines provided here are map operations
  * for the color string primitives.
  *
- * In line with the batcalc module, we assume that
- * if two bat operands are provided that they are already
- * aligned on the head. Moreover, the head of the BATs
- * are limited to :oid, which can be cheaply realized using
- * the GRPsplit operation.
+ * In line with the batcalc module, we assume that if two bat operands
+ * are provided that they are aligned.
  */
 
 #include "monetdb_config.h"
diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -13,11 +13,8 @@
  * The collection of routines provided here are map operations
  * for the atom string primitives.
  *
- * In line with the batcalc module, we assume that
- * if two bat operands are provided that they are already
- * aligned on the head. Moreover, the head of the BATs
- * are limited to :void, which can be cheaply realized using
- * the GRPsplit operation.
+ * In line with the batcalc module, we assume that if two bat operands
+ * are provided that they are aligned.
  */
 #include "monetdb_config.h"
 #include 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-05 Thread Sjoerd Mullender
Changeset: 940183ddc2a0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=940183ddc2a0
Added Files:
README.rst
Removed Files:
README
Modified Files:
HowToStart.rst
Makefile.ag
monetdb5/extras/rapi/Tests/rapi08.malC
sql/backends/monet5/vaults/bam/bam_wrapper.c
sql/server/sql_parser.y
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (220 lines):

diff --git a/HowToStart.rst b/HowToStart.rst
--- a/HowToStart.rst
+++ b/HowToStart.rst
@@ -24,7 +24,7 @@ This document assumes that you are plann
 installing MonetDB on a Unix-like system (e.g., Linux, IRIX, Solaris,
 AIX, Mac OS X/Darwin, or CYGWIN).  For compilation and installation on
 a native Windows system (NT, 2000, XP) see the instructions in the
-file `../buildtools/doc/windowsbuild.rst`__.
+file `buildtools/doc/windowsbuild.rst`__.
 
 __ http://dev.monetdb.org/downloads/
 __ Windows-Installation.html
diff --git a/Makefile.ag b/Makefile.ag
--- a/Makefile.ag
+++ b/Makefile.ag
@@ -13,7 +13,7 @@ SUBDIRS = buildtools common clients \
HAVE_TESTING?testing \
 
 EXTRA_DIST = bootstrap configure configure.ac configure.ag libversions \
-MonetDB.spec rpm.mk.in COPYING README license.txt 
HowToStart.rst
+MonetDB.spec rpm.mk.in COPYING README.rst license.txt 
HowToStart.rst
 
 EXTRA_DIST_DIR = NT debian MacOSX
 
diff --git a/README b/README
deleted file mode 100644
--- a/README
+++ /dev/null
@@ -1,26 +0,0 @@
-The MonetDB Database System
-===
-
-The MonetDB database is developed by the CWI database research group
-(see http://www.monetdb.org/).
-
-Via the MonetDB project we have brought the MonetDB system in open source,
-where it is accessible at http://www.monetdb.org/Downloads/
-
-The MonetDB database system is a high-performance database kernel for
-query-intensive applications. The MonetDB kernel works together with an
-SQL frontend that is in a separate CVS module.
-
-If you got a source distribution, please compile and install MonetDB first,
-following the instructions in the file 'HowToStart.rst' (for Unix)
-or 'buildtools/doc/windowsbuild.rst' (for Windows).
-
-
-Copyright Notice
-
-
-This Source Code Form is subject to the terms of the Mozilla Public
-License, v. 2.0.  If a copy of the MPL was not distributed with this
-file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
diff --git a/README.rst b/README.rst
new file mode 100644
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,34 @@
+The MonetDB Database System
+===
+
+The MonetDB database is developed by the CWI database research group
+(see http://www.monetdb.org/).
+
+Via the MonetDB project we have brought the MonetDB system in open source,
+where it is accessible at http://www.monetdb.org/Downloads/
+
+The MonetDB database system is a high-performance database kernel for
+query-intensive applications. The MonetDB source can be found at our `Mercurial
+server`__. There is also a `github mirror`__ that is updated once a day.
+
+.. _MonetDB: http://dev.monetdb.org/hg/MonetDB/
+__ MonetDB_
+
+.. _github: https://github.com/MonetDB/MonetDB
+__ github_
+
+If you got a source distribution, please compile and install MonetDB first,
+following the instructions in the file `HowToStart.rst`__ (for Unix)
+or `buildtools/doc/windowsbuild.rst`__ (for Windows).
+
+__ HowToStart.rst
+__ buildtools/doc/windowsbuild.rst
+
+Copyright Notice
+
+
+This Source Code Form is subject to the terms of the Mozilla Public
+License, v. 2.0.  If a copy of the MPL was not distributed with this
+file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
diff --git a/sql/backends/monet5/vaults/bam/bam_wrapper.c 
b/sql/backends/monet5/vaults/bam/bam_wrapper.c
--- a/sql/backends/monet5/vaults/bam/bam_wrapper.c
+++ b/sql/backends/monet5/vaults/bam/bam_wrapper.c
@@ -1613,13 +1613,16 @@ bam1_t2alignment(bam_wrapper * bw, lng v
a_out->cigar[1] = '\0';
} else {
uint32_t *cigar_bin = bam1_cigar(a_in);
+   uint32_t c;
int index = 0;
 
for (i = 0; i < a_in->core.n_cigar; ++i) {
+   /* work around unaligned access */
+   memcpy(&c, &cigar_bin[i], sizeof(c));
snprintf(&a_out->cigar[index],
 a_out->cigar_size - index, "%u%c",
-cigar_bin[i] >> BAM_CIGAR_SHIFT,
-bam_cigar_opchr(cigar_bin[i]));
+c >> BAM_CIGAR_SHIFT,
+bam_cigar_opchr(c));
index += strlen(&a_out->cigar[index]);
}
}
@@ -1750,25 +1753,37 @@ write_aux_bam1_t(bam_wrapper * bw, bam1_
  

MonetDB: default - Merge with Dec2016 branch.

2017-01-06 Thread Sjoerd Mullender
Changeset: 918e014c9388 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=918e014c9388
Added Files:
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.err

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out
Modified Files:
sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_string.stable.out
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/UDF/pyapi/unicode.c
sql/backends/monet5/UDF/pyapi/unicode.h
sql/test/sys-schema/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 985 to 300 lines):

diff --git a/sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_string.stable.out 
b/sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_string.stable.out
--- a/sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_string.stable.out
+++ b/sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_string.stable.out
@@ -180,8 +180,8 @@ Ready.
 #--#
 [ 0@0, 18042.895   ]
 [ 1@0, 846.9309]
-[ 2@0, 16.816929   ]
-[ 3@0, 1714637 ]
+[ 2@0, 16.816927   ]
+[ 3@0, 1714636.9   ]
 [ 4@0, nil ]
 #io.print(rstr);
 #--#
diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.c 
b/sql/backends/monet5/UDF/pyapi/type_conversion.c
--- a/sql/backends/monet5/UDF/pyapi/type_conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/type_conversion.c
@@ -24,7 +24,7 @@ bool string_copy(char * source, char* de
 for(i = 0; i < max_size; i++) {
 dest[i] = source[i];
 if (dest[i] == 0) return TRUE;
-if (!allow_unicode && (*(unsigned char*)&source[i]) >= 128) return 
FALSE;
+if (!allow_unicode && source[i] & 0x80) return FALSE;
 }
 dest[max_size] = '\0';
 return TRUE;
@@ -33,40 +33,9 @@ bool string_copy(char * source, char* de
 #ifdef HAVE_HGE
 int hge_to_string(char * str, hge x)
 {
-int i = 0;
-size_t size = 1;
-hge cpy = x > 0 ? x : -x;
-while(cpy > 0) {
-cpy /= 10;
-size++;
-}
-if (x < 0) size++;
-if (x < 0)
-{
-x *= -1;
-str[0] = '-';
-}
-str[size - 1] = '\0';
-i = size - 1;
-while(x > 0)
-{
-int v = x % 10;
-i--;
-if (i < 0) return FALSE;
-if (v == 0)   str[i] = '0';
-else if (v == 1)  str[i] = '1';
-else if (v == 2)  str[i] = '2';
-else if (v == 3)  str[i] = '3';
-else if (v == 4)  str[i] = '4';
-else if (v == 5)  str[i] = '5';
-else if (v == 6)  str[i] = '6';
-else if (v == 7)  str[i] = '7';
-else if (v == 8)  str[i] = '8';
-else if (v == 9)  str[i] = '9';
-x = x / 10;
-}
-
-return TRUE;
+   int len = 256;  /* assume str is large enough */
+   hgeToStr(&str, &len, &x);
+   return TRUE;
 }
 
 PyObject *PyLong_FromHge(hge h)
@@ -173,85 +142,121 @@ wrapup:
 return msg;
 }
 
+#define STRING_TO_NUMBER_FACTORY(tpe)  \
+str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
\
+{  \
+   int len = sizeof(tpe);  \
+   char buf[256];  \
+   if (maxsize > 0) {  \
+   if (maxsize >= sizeof(buf)) \
+   maxsize = sizeof(buf) - 1;  \
+   strncpy(buf, ptr, maxsize); \
+   buf[maxsize] = 0;   \
+   if (strlen(buf) >= sizeof(buf) - 1) \
+   return GDKstrdup("string too long to convert."); \
+   ptr = buf;  \
+   }   \
+   if (BATatoms[TYPE_##tpe].atomFromStr(ptr, &len, (void **) &value) == 0) 
\
+   return GDKstrdup("Error converting string.");   \
+   return MAL_SUCCEED; \
+}
+
 #ifndef IS_PY3K
-#define PY_TO_(type, inttpe)   
   \
-str pyobject_to_##type(PyObject **pyobj, size_t maxsize, type *value)  
   \
-{  
   \
-PyObject *ptr = *pyobj;
   \
-str retval = MAL_SUCCEED;  
   \
-(void) maxsize;

MonetDB: default - Merge with Dec2016 branch.

2017-01-06 Thread Sjoerd Mullender
Changeset: 3c8b4c3417e6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c8b4c3417e6
Modified Files:
configure.ag
gdk/gdk_system.c
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (88 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2561,6 +2561,7 @@ AC_CHECK_FUNCS([\
asctime_r \
backtrace \
cbrt \
+   clock_gettime \
ctime_r \
fabsf \
fallocate \
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -895,16 +895,36 @@ GDKusec(void)
return (lng) (((ctr.QuadPart - start.QuadPart) * 100) / 
freq.QuadPart);
}
 #endif
+#ifdef HAVE_CLOCK_GETTIME
+#if defined(CLOCK_UPTIME_FAST)
+#define CLK_ID CLOCK_UPTIME_FAST   /* FreeBSD */
+#elif defined(CLOCK_MONOTONIC_COARSE)
+#define CLK_ID CLOCK_MONOTONIC_COARSE  /* Linux >= 2.6.32 */
+#else
+#define CLK_ID CLOCK_MONOTONIC /* Posix (fallback) */
+#endif
+   {
+   static struct timespec tsbase;
+   struct timespec ts;
+   if (tsbase.tv_sec == 0) {
+   clock_gettime(CLK_ID, &tsbase);
+   return tsbase.tv_nsec / 1000;
+   }
+   if (clock_gettime(CLK_ID, &ts) == 0)
+   return (ts.tv_sec - tsbase.tv_sec) * 100 + 
ts.tv_nsec / 1000;
+   }
+#endif
 #ifdef HAVE_GETTIMEOFDAY
{
static struct timeval tpbase;   /* automatically initialized to 
0 */
struct timeval tp;
 
-   if (tpbase.tv_sec == 0)
+   if (tpbase.tv_sec == 0) {
gettimeofday(&tpbase, NULL);
+   return (lng) tpbase.tv_usec;
+   }
gettimeofday(&tp, NULL);
-   tp.tv_sec -= tpbase.tv_sec;
-   return (lng) tp.tv_sec * 100 + (lng) tp.tv_usec;
+   return (lng) (tp.tv_sec - tpbase.tv_sec) * 100 + (lng) 
tp.tv_usec;
}
 #else
 #ifdef HAVE_FTIME
@@ -912,11 +932,12 @@ GDKusec(void)
static struct timeb tbbase; /* automatically initialized to 
0 */
struct timeb tb;
 
-   if (tbbase.time == 0)
+   if (tbbase.time == 0) {
ftime(&tbbase);
+   return (lng) tbbase.millitm * 1000;
+   }
ftime(&tb);
-   tb.time -= tbbase.time;
-   return (lng) tb.time * 100 + (lng) tb.millitm * 1000;
+   return (lng) (tb.time - tbbase.time) * 100 + (lng) 
tb.millitm * 1000;
}
 #endif
 #endif
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3126,14 +3126,6 @@ def Check(command, input) :
 STDERR.write("\n")
 STDERR.flush()
 #sys.exit(1)
-if sys.platform == 'linux2':
-proc = process.Popen(['netstat', '-ap'],
- stdout = process.PIPE,
- stderr = process.PIPE,
- universal_newlines = True)
-out, err = proc.communicate()
-STDERR.write(err)
-STDOUT.write(out)
 if noErr:
 STDOUT.flush()
 STDERR.writelines(noErr)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-06 Thread Sjoerd Mullender
Changeset: 799df9dace25 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=799df9dace25
Modified Files:
gdk/gdk_system.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (12 lines):

diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -898,8 +898,6 @@ GDKusec(void)
 #ifdef HAVE_CLOCK_GETTIME
 #if defined(CLOCK_UPTIME_FAST)
 #define CLK_ID CLOCK_UPTIME_FAST   /* FreeBSD */
-#elif defined(CLOCK_MONOTONIC_COARSE)
-#define CLK_ID CLOCK_MONOTONIC_COARSE  /* Linux >= 2.6.32 */
 #else
 #define CLK_ID CLOCK_MONOTONIC /* Posix (fallback) */
 #endif
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-09 Thread Sjoerd Mullender
Changeset: c9b2bbc3e0c1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9b2bbc3e0c1
Added Files:
sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.sql
sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.stable.err
sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.stable.out
Modified Files:
sql/server/rel_optimizer.c
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2017/Tests/All

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

Merge with Dec2016 branch.


diffs (truncated from 1213 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
@@ -4354,6 +4354,8 @@ rel_push_join_down_union(int *changes, m
je && !find_prop(je->p, PROP_JOINIDX) && /* FKEY JOIN */
!rel_is_join_on_pkey(rel))) /* aligned PKEY JOIN */
return rel;
+   if (is_semi(rel->op) && is_union(l->op) && je && 
!find_prop(je->p, PROP_JOINIDX))
+   return rel;
 
ol->subquery = or->subquery = 0;
if ((is_union(l->op) && !need_distinct(l)) && !is_union(r->op)){
diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -1,2 +1,3 @@
 shutdown.Bug-6182
 avggroupbysq.Bug-6178
+semijoinunion.Bug-6150
diff --git a/sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.sql 
b/sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/semijoinunion.Bug-6150.sql
@@ -0,0 +1,1056 @@
+CREATE TABLE "test_join_right_table" ("r_c" VARCHAR(255), "d" VARCHAR(255));
+
+INSERT INTO "test_join_right_table"("r_c", "d") values ('c1', 'd1');
+INSERT INTO "test_join_right_table"("r_c", "d") values ('c2', 'd2');
+INSERT INTO "test_join_right_table"("r_c", "d") values ('c5', 'd3');
+INSERT INTO "test_join_right_table"("r_c", "d") values (null, 'd4');
+
+CREATE TABLE lineitem_denormalized_first1k
+(
+   customer_gender char(1),
+   customer_region varchar(15) NOT NULL,
+   customer_country varchar(40) NOT NULL,
+   customer_state varchar(40),
+   customer_city varchar(50) NOT NULL,
+   customer_date_of_birth date,
+   customer_id integer NOT NULL,
+   product_family varchar(20) NOT NULL,
+   product_category varchar(30) NOT NULL,
+   product_subcategory varchar(30) NOT NULL,
+   product_name varchar(50) NOT NULL,
+   product_id integer NOT NULL,
+   store_id integer NOT NULL,
+   store_longitude decimal(12, 8) NOT NULL,
+   store_latitude decimal(12, 8) NOT NULL,
+   store_name varchar(50) NOT NULL,
+   store_manager varchar(50) NOT NULL,
+   store_phone_number varchar(20) NOT NULL,
+   store_region varchar(15) NOT NULL,
+   store_country varchar(40) NOT NULL,
+   store_state varchar(40),
+   store_city varchar(50) NOT NULL,
+   order_date date NOT NULL,
+   year_begin_date date,
+   quarter_begin_date date,
+   month_begin_date date,
+   mm integer,
+   mmdd integer,
+   ddmon varchar(9),
+   line_price decimal(12, 2) NOT NULL,
+   line_cost decimal(12, 2) NOT NULL,
+   line_margin decimal(13, 2) NOT NULL,
+   line_margin_percent decimal(12,8) NOT NULL
+);
+
+copy 1000 records into lineitem_denormalized_first1k from stdin using 
delimiters ',','\n','\"';
+F,APAC,People's Republic of 
China,Sichuan,Yibin,1957-09-19,99425,Non-consumables,Clothing,Clothing,Croft & 
Barrow Velour Separates,1757,30,-3.2000,55.9500,"Edinburgh, United 
Kingdom",Melody J. Hambard,+44-875-777-1712,EUROPE,United 
Kingdom,Scotland,Edinburgh,2010-11-03,2010-01-01,2010-10-01,2010-11-01,201011,20101103,03NOV2010,482.70,354.87,127.83,26.482
+F,APAC,People's Republic of 
China,Sichuan,Yibin,1957-09-19,99425,Non-consumables,Clothing,Clothing,Men's 
Beanies,2951,30,-3.2000,55.9500,"Edinburgh, United Kingdom",Melody J. 
Hambard,+44-875-777-1712,EUROPE,United 
Kingdom,Scotland,Edinburgh,2010-11-03,2010-01-01,2010-10-01,2010-11-01,201011,20101103,03NOV2010,260.20,72.76,187.44,72.036
+F,APAC,People's Republic of 
China,Sichuan,Yibin,1957-09-19,99425,Non-consumables,Clothing,Clothing,Smartwool
 Ski Socks,3502,30,-3.2000,55.9500,"Edinburgh, United Kingdom",Melody 
J. Hambard,+44-875-777-1712,EUROPE,United 
Kingdom,Scotland,Edinburgh,2010-11-03,2010-01-01,2010-10-01,2010-11-01,201011,20101103,03NOV2010,384.87,287.16,97.71,25.387
+F,APAC,People's Republic of 
China,Sichuan,Yibin,1957-09-19,99425,Non-consumables,Electronics,Digital 
media,HP 8GB USB Flash Drive,4154,30,-3.2000,55.9500,"Edinburgh, United 
Kingdom",Melody J. Hambard,+44-875-777-1712,EUROPE,United 
Kingdom,Scotland,Edinburgh,2010-11-03,2010-01-01,2010-10-01,2010-11-0

MonetDB: default - Merge with Dec2016 branch.

2017-01-09 Thread Sjoerd Mullender
Changeset: cab6171bd6f4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cab6171bd6f4
Modified Files:
gdk/gdk_batop.c
gdk/gdk_hash.c
gdk/gdk_imprints.c
gdk/gdk_join.c
gdk/gdk_orderidx.c
gdk/gdk_project.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (237 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1065,7 +1065,9 @@ BATkeyed(BAT *b)
 int
 BATordered(BAT *b)
 {
-   lng t0 = GDKusec();
+   lng t0 = 0;
+
+   ALGODEBUG t0 = GDKusec();
 
if (b->ttype == TYPE_void)
return 1;
@@ -1151,7 +1153,9 @@ BATordered(BAT *b)
 int
 BATordered_rev(BAT *b)
 {
-   lng t0 = GDKusec();
+   lng t0 = 0;
+
+   ALGODEBUG t0 = GDKusec();
 
if (b == NULL)
return 0;
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -193,11 +193,11 @@ int
 BATcheckhash(BAT *b)
 {
int ret;
-   lng t;
+   lng t = 0;
 
-   t = GDKusec();
+   ALGODEBUG t = GDKusec();
MT_lock_set(&GDKhashLock(b->batCacheid));
-   t = GDKusec() - t;
+   ALGODEBUG t = GDKusec() - t;
if (b->thash == (Hash *) 1) {
Hash *h;
Heap *hp;
@@ -285,9 +285,11 @@ BAThashsync(void *arg)
struct hashsync *hs = arg;
Heap *hp = hs->hp;
int fd;
-   lng t0 = GDKusec();
+   lng t0 = 0;
const char *failed = " failed";
 
+   ALGODEBUG t0 = GDKusec();
+
if (HEAPsave(hp, hp->filename, NULL) == GDK_SUCCEED &&
(fd = GDKfdlocate(hp->farmid, hp->filename, "rb+", NULL)) >= 0) {
((size_t *) hp->base)[0] |= 1 << 24;
@@ -391,7 +393,7 @@ BAThash(BAT *b, BUN masksize)
p = q;
}
 
-   t0 = GDKusec();
+   ALGODEBUG t0 = GDKusec();
 
do {
BUN nslots = mask >> 3; /* 1/8 full is too full */
@@ -519,9 +521,11 @@ BAThash(BAT *b, BUN masksize)
ALGODEBUG fprintf(stderr, "#BAThash: NOT persisting 
hash %d\n", b->batCacheid);
 #endif
b->thash = h;
-   t1 = GDKusec();
-   ALGODEBUG fprintf(stderr, "#BAThash: hash construction " LLFMT 
" usec\n", t1 - t0);
-   ALGODEBUG HASHcollisions(b, b->thash);
+   ALGODEBUG {
+   t1 = GDKusec();
+   fprintf(stderr, "#BAThash: hash construction " LLFMT " 
usec\n", t1 - t0);
+   HASHcollisions(b, b->thash);
+   }
}
MT_lock_unset(&GDKhashLock(b->batCacheid));
return GDK_SUCCEED;
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -279,7 +279,7 @@ BATimprints(BAT *b)
 {
BAT *o = NULL, *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL;
Imprints *imprints;
-   lng t0 = 0, t1 = 0;
+   lng t0 = 0;
 
/* we only create imprints for types that look like types we know */
switch (ATOMbasetype(b->ttype)) {
@@ -316,7 +316,7 @@ BATimprints(BAT *b)
assert(b->timprints == NULL);
}
MT_lock_set(&GDKimprintsLock(b->batCacheid));
-   t0 = GDKusec();
+   ALGODEBUG t0 = GDKusec();
if (b->timprints == NULL) {
BUN cnt;
str nme = BBP_physical(b->batCacheid);
@@ -496,8 +496,7 @@ BATimprints(BAT *b)
b->timprints = imprints;
}
 
-   t1 = GDKusec();
-   ALGODEBUG fprintf(stderr, "#BATimprints: imprints construction " LLFMT 
" usec\n", t1 - t0);
+   ALGODEBUG fprintf(stderr, "#BATimprints: imprints construction " LLFMT 
" usec\n", GDKusec() - t0);
MT_lock_unset(&GDKimprintsLock(b->batCacheid));
 
/* BBPUnfix tries to get the imprints lock which might lead to a 
deadlock
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3821,7 +3821,8 @@ gdk_return
 BATleftjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int 
nil_matches, BUN estimate)
 {
return subleftjoin(r1p, r2p, l, r, sl, sr, nil_matches,
-  0, 0, 0, estimate, "BATleftjoin", GDKusec());
+  0, 0, 0, estimate, "BATleftjoin",
+  GDKdebug & ALGOMASK ? GDKusec() : 0);
 }
 
 /* Performs a left outer join over l and r.  Returns two new, aligned,
@@ -3833,7 +3834,8 @@ gdk_return
 BATouterjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int 
nil_matches, BUN estimate)
 {
return subleftjoin(r1p, r2p, l, r, sl, sr, nil_matches,
-  1, 0, 0, estimate, "BATouterjoin", GDKusec());
+  1, 0, 0, estimate, "BATouterjoin",
+  GDKdebug & ALGOMASK ? GDKusec() : 0);
 }
 
 /* Perform a semi-join over l and r.  Returns two new, aligned,
@@ -3844,

MonetDB: default - Merge with Dec2016 branch.

2017-01-12 Thread Sjoerd Mullender
Changeset: 933363b389f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=933363b389f7
Added Files:
sql/test/BugTracker-2017/Tests/all_dates.csv.gz
sql/test/BugTracker-2017/Tests/empty-interval.Bug-6184.sql
sql/test/BugTracker-2017/Tests/empty-interval.Bug-6184.stable.err
sql/test/BugTracker-2017/Tests/empty-interval.Bug-6184.stable.out
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.sql.in
Modified Files:
gdk/gdk_cross.c
gdk/gdk_select.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_statement.c
sql/storage/bat/bat_table.c

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 2363 to 300 lines):

diff --git a/gdk/gdk_cross.c b/gdk/gdk_cross.c
--- a/gdk/gdk_cross.c
+++ b/gdk/gdk_cross.c
@@ -9,49 +9,7 @@
 #include "monetdb_config.h"
 #include "gdk.h"
 #include "gdk_private.h"
-
-static gdk_return
-BATcross1(BAT **r1p, BAT **r2p, BAT *l, BAT *r)
-{
-   BAT *bn1, *bn2;
-   BUN i, j;
-   oid *restrict p1, *restrict p2;
-
-   bn1 = COLnew(0, TYPE_oid, BATcount(l) * BATcount(r), TRANSIENT);
-   bn2 = COLnew(0, TYPE_oid, BATcount(l) * BATcount(r), TRANSIENT);
-   if (bn1 == NULL || bn2 == NULL) {
-   BBPreclaim(bn1);
-   BBPreclaim(bn2);
-   return GDK_FAIL;
-   }
-   p1 = (oid *) Tloc(bn1, 0);
-   p2 = (oid *) Tloc(bn2, 0);
-   for (i = 0; i < BATcount(l); i++) {
-   for (j = 0; j < BATcount(r); j++) {
-   *p1++ = i + l->hseqbase;
-   *p2++ = j + r->hseqbase;
-   }
-   }
-   BATsetcount(bn1, BATcount(l) * BATcount(r));
-   BATsetcount(bn2, BATcount(l) * BATcount(r));
-   bn1->tsorted = 1;
-   bn1->trevsorted = BATcount(l) <= 1;
-   bn1->tkey = BATcount(r) <= 1;
-   bn1->tdense = bn1->tkey != 0;
-   bn1->tnil = 0;
-   bn1->tnonil = 1;
-   bn2->tsorted = BATcount(l) <= 1;
-   bn2->trevsorted = BATcount(bn2) <= 1;
-   bn2->tkey = BATcount(l) <= 1;
-   bn2->tdense = bn2->tkey != 0;
-   bn2->tnil = 0;
-   bn2->tnonil = 1;
-   BATtseqbase(bn1, l->hseqbase);
-   BATtseqbase(bn2, r->hseqbase);
-   *r1p = bn1;
-   *r2p = bn2;
-   return GDK_SUCCEED;
-}
+#include "gdk_cand.h"
 
 /* Calculate a cross product between bats l and r with optional
  * candidate lists sl for l and sr for r.
@@ -60,28 +18,75 @@ BATcross1(BAT **r1p, BAT **r2p, BAT *l, 
 gdk_return
 BATsubcross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr)
 {
-   BAT *bn1, *bn2, *t;
+   BAT *bn1, *bn2;
+   BUN start1, start2;
+   BUN end1, end2;
+   BUN cnt1, cnt2;
+   const oid *restrict lcand, *restrict rcand;
+   const oid *lcandend, *rcandend;
+   oid seq;
+   oid *restrict p;
+   BUN i, j;
 
-   if (BATcross1(&bn1, &bn2, sl ? sl : l, sr ? sr : r) != GDK_SUCCEED)
+   CANDINIT(l, sl, start1, end1, cnt1, lcand, lcandend);
+   CANDINIT(r, sr, start2, end2, cnt2, rcand, rcandend);
+   if (lcand)
+   cnt1 = lcandend - lcand;
+   if (rcand)
+   cnt2 = rcandend - rcand;
+
+   bn1 = COLnew(0, TYPE_oid, cnt1 * cnt2, TRANSIENT);
+   if (bn1 == NULL)
return GDK_FAIL;
-   if (sl) {
-   t = BATproject(bn1, sl);
-   BBPunfix(bn1->batCacheid);
-   if (t == NULL) {
-   BBPunfix(bn2->batCacheid);
-   return GDK_FAIL;
-   }
-   bn1 = t;
+   BATsetcount(bn1, cnt1 * cnt2);
+   bn1->tsorted = 1;
+   bn1->trevsorted = cnt1 <= 1;
+   bn1->tkey = cnt2 <= 1;
+   bn1->tnil = 0;
+   bn1->tnonil = 1;
+   p = (oid *) Tloc(bn1, 0);
+   if (lcand) {
+   for (i = 0; i < cnt1; i++)
+   for (j = 0; j < cnt2; j++)
+   *p++ = lcand[i];
+   bn1->tdense = 0;
+   } else {
+   seq = l->hseqbase + start1;
+   for (i = 0; i < cnt1; i++)
+   for (j = 0; j < cnt2; j++)
+   *p++ = i + seq;
+   bn1->tdense = bn1->tkey != 0;
+   if (bn1->tdense)
+   BATtseqbase(bn1, seq);
}
-   if (sr) {
-   t = BATproject(bn2, sr);
-   BBPunfix(bn2->batCacheid);
-   if (t == NULL) {
-   BBPunfix(bn1->batCacheid);
-   return GDK_FAIL;
-   }
-   bn2 = t;
+
+   bn2 = COLnew(0, TYPE_oid, cnt1 * cnt2, TRANSIENT);
+   if (bn2 == NULL) {
+ 

MonetDB: default - Merge with Dec2016 branch.

2017-01-13 Thread Panagiotis Koutsourakis
Changeset: 2b220f90b233 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b220f90b233
Added Files:
debian/libmonetdb13.install
Removed Files:
debian/libmonetdb14.install
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
debian/control
libversions
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (111 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -647,3 +647,5 @@ deeebb69952f76e3377664bb97997885b283f9d1
 afc859894553ef804cded49a83b035d9d2cda73b Dec2016_3
 ea0fe76e0095771bccca626b39e3e839a90ba320 Dec2016_release
 afc859894553ef804cded49a83b035d9d2cda73b Dec2016_release
+bf4b58d202645774b75c7f508c84b30e3be78a49 Dec2016_5
+bf4b58d202645774b75c7f508c84b30e3be78a49 Dec2016_SP1_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -124,7 +124,7 @@ Vendor: MonetDB BV 
 Group: Applications/Databases
 License: MPLv2.0
 URL: http://www.monetdb.org/
-Source: 
http://dev.monetdb.org/downloads/sources/Dec2016/%{name}-%{version}.tar.bz2
+Source: 
http://dev.monetdb.org/downloads/sources/Dec2016-SP1/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
@@ -957,6 +957,21 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Fri Jan 13 2017 Panagiotis Koutsourakis  - 
11.25.5-20170113
+- Rebuilt.
+- BZ#4039: Slow mserver5 start after drop of tables (> 1 hour)
+- BZ#4048: Segfault on vacuum with parallel updates
+- BZ#6079: pushselect optimizer bug on MAL snippet
+- BZ#6140: INNER JOIN gives the results of a CROSS JOIN
+- BZ#6150: Query giving wrong results, extra records are appearing
+- BZ#6175: The program can't start because python27.dll is missing from
+  your computer.
+- BZ#6178: AVG + GROUP BY returns NULL for some records that should
+  have results
+- BZ#6179: mergetable optimizer messes up sample
+- BZ#6182: sys.shutdown triggers assertion in clients.c
+- BZ#6184: Incorrect result set - Extra records in result set
+
 * Sat Dec 17 2016 Sjoerd Mullender  - 11.25.3-20161217
 - Rebuilt.
 
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+monetdb (11.25.5) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#4039: Slow mserver5 start after drop of tables (> 1 hour)
+  * BZ#4048: Segfault on vacuum with parallel updates
+  * BZ#6079: pushselect optimizer bug on MAL snippet
+  * BZ#6140: INNER JOIN gives the results of a CROSS JOIN
+  * BZ#6150: Query giving wrong results, extra records are appearing
+  * BZ#6175: The program can't start because python27.dll is missing from
+your computer.
+  * BZ#6178: AVG + GROUP BY returns NULL for some records that should
+have results
+  * BZ#6179: mergetable optimizer messes up sample
+  * BZ#6182: sys.shutdown triggers assertion in clients.c
+  * BZ#6184: Incorrect result set - Extra records in result set
+
+ -- Panagiotis Koutsourakis   Fri, 13 Jan 2017 
11:15:52 +0100
+
 monetdb (11.25.3) unstable; urgency=low
 
   * Rebuilt.
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,7 @@ Build-Depends: debhelper (>= 5), autotoo
 Standards-Version: 3.8.0
 X-Python-Version: >= 2.6
 
-Package: libmonetdb14
+Package: libmonetdb13
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Conflicts: libmonetdb5-server-geom (<< ${source:Version})
@@ -32,7 +32,7 @@ Description: MonetDB core library
 Package: libmonetdb-dev
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, libatomic-ops-dev,
- libmonetdb14, libmonetdb-stream-dev
+ libmonetdb13, libmonetdb-stream-dev
 Description: MonetDB development files
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
diff --git a/debian/libmonetdb14.install b/debian/libmonetdb13.install
rename from debian/libmonetdb14.install
rename to debian/libmonetdb13.install
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=14:1:0
+GDK_VERSION=14:1:1
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=8:1:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras)
-MONETDB5_VERSION=22:0:0
+MONETDB5_VERSION=22:0:1
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=9:0:1
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-19 Thread Sjoerd Mullender
Changeset: 241249759ced for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=241249759ced
Modified Files:
gdk/gdk_unique.c
sql/backends/monet5/sql_result.c

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (64 lines):

diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c
--- a/gdk/gdk_unique.c
+++ b/gdk/gdk_unique.c
@@ -172,7 +172,7 @@ BATunique(BAT *b, BAT *s)
  s ? BATgetId(s) : "NULL",
  s ? BATcount(s) : 0);
assert(vars == NULL);
-   seen = GDKzalloc(256 / 16);
+   seen = GDKzalloc((256 / 16) * sizeof(seen[0]));
if (seen == NULL)
goto bunins_failed;
for (;;) {
@@ -209,7 +209,7 @@ BATunique(BAT *b, BAT *s)
  s ? BATgetId(s) : "NULL",
  s ? BATcount(s) : 0);
assert(vars == NULL);
-   seen = GDKzalloc(65536 / 16);
+   seen = GDKzalloc((65536 / 16) * sizeof(seen[0]));
if (seen == NULL)
goto bunins_failed;
for (;;) {
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -1758,21 +1758,16 @@ mvc_export_head(backend *b, stream *s, i
for (i = 0; i < t->nr_cols; i++) {
res_col *c = t->cols + i;
 
-   if (strchr(c->name, ',') || strchr(c->name, ' ') || 
strchr(c->name , '\t') || strchr(c->name, '#')) {
+   if (strpbrk(c->name, ", \t#\"\\")) {
+   char *p;
if (mnstr_write(s, "\"", 1, 1) != 1)
return -1;
-   if (strchr(c->name, '"')) {
-   char *p;
-   for (p = c->name; *p; p++) {
-   if (*p == '"') {
-   if (mnstr_write(s, "\\", 1, 1) 
!= 1)
-   return -1;
-   }
-   if (mnstr_write(s, p, 1, 1) != 1)
+   for (p = c->name; *p; p++) {
+   if (*p == '"' || *p == '\\') {
+   if (mnstr_write(s, "\\", 1, 1) != 1)
return -1;
}
-   } else {
-   if (mnstr_write(s, c->name, strlen(c->name), 1) 
!= 1)
+   if (mnstr_write(s, p, 1, 1) != 1)
return -1;
}
if (mnstr_write(s, "\"", 1, 1) != 1)
diff --git 
a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql 
b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql
--- 
a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql
+++ 
b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql
@@ -3,7 +3,7 @@ set optimizer='sequential_pipe';
 
 start transaction;
 
--- only explain output because not like's give to many rows.
+-- only explain output because not like's give too many rows.
 explain select name,func from functions where name like '%optimizers%';
 explain select name,func from functions where name not like '%optimizers%';
 explain select name,func from functions where name ilike '%optimizers%';
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-23 Thread Sjoerd Mullender
Changeset: 1a922c962466 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a922c962466
Added Files:
sql/backends/monet5/Tests/pyapi33.sql
sql/backends/monet5/Tests/pyapi33.stable.err
sql/backends/monet5/Tests/pyapi33.stable.out
Modified Files:
gdk/gdk_storage.c
sql/backends/monet5/Tests/All
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/server/rel_select.c
tools/merovingian/daemon/controlrunner.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (250 lines):

diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -637,6 +637,7 @@ DESCclean(BAT *b)
 #define MSYNC_BACKGROUND
 
 #ifndef DISABLE_MSYNC
+#ifndef MS_ASYNC
 struct msync {
bat id;
Heap *h;
@@ -646,26 +647,24 @@ static void
 BATmsyncImplementation(void *arg)
 {
Heap *h = ((struct msync *) arg)->h;
-   char *adr;
-   size_t len;
-   size_t offset;
 
-   adr = h->base;
-   offset = ((size_t) adr % MT_pagesize());
-   len = MT_pagesize() * (1 + ((h->base + h->free - adr) / MT_pagesize()));
-   if (offset)
-   adr -= MT_pagesize() - offset;
-   if (len)
-   (void) MT_msync(adr, len);
+   (void) MT_msync(h->base, h->size);
BBPunfix(((struct msync *) arg)->id);
GDKfree(arg);
 }
 #endif
+#endif
 
 void
 BATmsync(BAT *b)
 {
 #ifndef DISABLE_MSYNC
+#ifdef MS_ASYNC
+   if (b->theap.storage == STORE_MMAP)
+   (void) msync(b->theap.base, b->theap.free, MS_ASYNC);
+   if (b->tvheap && b->tvheap->storage == STORE_MMAP)
+   (void) msync(b->tvheap->base, b->tvheap->free, MS_ASYNC);
+#else
 #ifdef MSYNC_BACKGROUND
MT_Id tid;
 #endif
@@ -703,6 +702,7 @@ BATmsync(BAT *b)
BATmsyncImplementation(arg);
 #endif
}
+#endif
 #else
(void) b;
 #endif /* DISABLE_MSYNC */
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -52,6 +52,7 @@ HAVE_LIBPY?pyapi28
 HAVE_LIBPY?pyapi29
 HAVE_LIBPY?pyapi30
 HAVE_LIBPY?pyapi32
+HAVE_LIBPY?pyapi33
 
 HAVE_LIBPY?pyloader01
 HAVE_LIBPY?pyloader02
diff --git a/sql/backends/monet5/Tests/pyapi33.sql 
b/sql/backends/monet5/Tests/pyapi33.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/pyapi33.sql
@@ -0,0 +1,8 @@
+
+START TRANSACTION;
+
+CREATE FUNCTION pyapi33() RETURNS STRING LANGUAGE PYTHON { return 'hello'; };
+
+SELECT pyapi33();
+
+ROLLBACK;
diff --git a/sql/backends/monet5/Tests/pyapi33.stable.err 
b/sql/backends/monet5/Tests/pyapi33.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/pyapi33.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'pyapi33` in directory 'sql/backends/monet5` itself:
+
+
+# 14:44:15 >  
+# 14:44:15 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34589" "--set" 
"mapi_usock=/var/tmp/mtest-6105/.s.monetdb.34589" "--set" "monet_prompt=" 
"--forcemito" "--dbpath=/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5" 
"--set" "embedded_py=true"
+# 14:44:15 >  
+
+# builtin opt  gdk_dbpath = /Users/myth/opt/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 34589
+# cmdline opt  mapi_usock = /var/tmp/mtest-6105/.s.monetdb.34589
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5
+# cmdline opt  embedded_py = true
+# cmdline opt  gdk_debug = 536870922
+
+# 14:44:15 >  
+# 14:44:15 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-6105" "--port=34589"
+# 14:44:15 >  
+
+
+# 14:44:16 >  
+# 14:44:16 >  "Done."
+# 14:44:16 >  
+
diff --git a/sql/backends/monet5/Tests/pyapi33.stable.out 
b/sql/backends/monet5/Tests/pyapi33.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/pyapi33.stable.out
@@ -0,0 +1,75 @@
+stdout of test 'pyapi33` in directory 'sql/backends/monet5` itself:
+
+
+# 14:44:15 >  
+# 14:44:15 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34589" "--set" 
"mapi_usock=/var/tmp/mtest-6105/.s.monetdb.34589" "--set" "monet_prompt=" 
"--forcemito" "--dbpath=/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5" 
"--set" "embedded_py=true"
+# 14:44:15 >  
+
+# MonetDB 5 server v11.25.6
+# This is an unreleased version
+# Serving database 'mTests_sql_backends_monet5', using 4 threads
+# Compiled for x86_64-apple-darwin15.6.0/64bit with 128bit integers
+# Found 8.000 GiB available main

MonetDB: default - Merge with Dec2016 branch.

2017-01-24 Thread Sjoerd Mullender
Changeset: 03e7818da0ec for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03e7818da0ec
Added Files:
sql/test/BugTracker-2017/Tests/too-large-decimals.Bug-6192.sql
sql/test/BugTracker-2017/Tests/too-large-decimals.Bug-6192.stable.err
sql/test/BugTracker-2017/Tests/too-large-decimals.Bug-6192.stable.out
Modified Files:
.hgignore
monetdb5/mal/mal.h
monetdb5/optimizer/opt_evaluate.c
sql/backends/monet5/sql_cast_impl_down_from_int.h
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 327 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -61,21 +61,10 @@ lex.yy.c
 *.lib
 # notwithstanding clients/odbc/winsetup/winredist/*.dll:
 *.dll
-# ruby:
-*.gem
-# java:
-*.jar
-java/build
-java/target
-java/bin
-java/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java
-# python:
-dist
 
 # other files we don't want
 TAGS
 tags
-*.elc
 *.pyo
 *.rej
 *.orig
@@ -99,11 +88,3 @@ NT/unistd.h
 # package building on Mac OS X
 MacOSX/build
 MacOSX/usr
-
-# Build directory
-BUILD
-
-syntax: regexp
-^java/build$
-syntax: regexp
-^java/target$
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -163,7 +163,7 @@ typedef struct VARRECORD {
  */
 
 typedef struct {
-   bit token;  /* instruction type */
+   bte token;  /* instruction type */
bit barrier;/* flow of control modifier 
takes:
   BARRIER, 
LEAVE, REDO, EXIT, CATCH, RAISE */
bit typechk;/* type check status */
diff --git a/monetdb5/optimizer/opt_evaluate.c 
b/monetdb5/optimizer/opt_evaluate.c
--- a/monetdb5/optimizer/opt_evaluate.c
+++ b/monetdb5/optimizer/opt_evaluate.c
@@ -164,7 +164,7 @@ OPTevaluateImplementation(Client cntxt, 
for (i = 1; i < limit && cntxt->mode != FINISHCLIENT; i++) {
p = getInstrPtr(mb, i);
// to avoid management of duplicate assignments over multiple 
blocks
-   // we limit ourselfs to evaluation of the first assignment only.
+   // we limit ourselves to evaluation of the first assignment 
only.
use = assigned[getArg(p,0)] == 1 && !(p->argc == p->retc && 
blockExit(p));
for (k = p->retc; k < p->argc; k++)
if (alias[getArg(p, k)])
diff --git a/sql/backends/monet5/sql_cast_impl_down_from_int.h 
b/sql/backends/monet5/sql_cast_impl_down_from_int.h
--- a/sql/backends/monet5/sql_cast_impl_down_from_int.h
+++ b/sql/backends/monet5/sql_cast_impl_down_from_int.h
@@ -28,7 +28,7 @@ str
 FUN(,TP1,_dec2_,TP2) (TP2 *res, const int *s1, const TP1 *v)
 {
int scale = *s1;
-   lng val = *v, h = 0;
+   TP1 val = *v, h = 0;
 
/* shortcut nil */
if (*v == NIL(TP1)) {
@@ -39,12 +39,17 @@ FUN(,TP1,_dec2_,TP2) (TP2 *res, const in
if (scale)
val = (val + h * scales[scale - 1]) / scales[scale];
/* see if the number fits in the data type */
-   if (val > (lng) GDKmin(TP2) && val <= GDKmax(TP2)
+   if (val > (TP1) GDKmin(TP2) && val <= (TP1) GDKmax(TP2)
) {
*res = (TP2) val;
return MAL_SUCCEED;
} else {
-   throw(SQL, "convert", "22003!value (" LLFMT ") exceeds limits 
of type "STRNG(TP2), val);
+   char *buf = NULL, *msg;
+   int len = 0;
+   BATatoms[TPE(TP1)].atomToStr(&buf, &len, &val);
+   msg = createException(SQL, "convert", "22003!value (%s) exceeds 
limits of type "STRNG(TP2), buf);
+   GDKfree(buf);
+   return msg;
}
 }
 
@@ -52,7 +57,7 @@ str
 FUN(,TP1,_dec2dec_,TP2) (TP2 *res, const int *S1, const TP1 *v, const int *d2, 
const int *S2)
 {
int p = *d2, inlen = 1;
-   lng val = *v, cpyval = val, h = (val < 0) ? -5 : 5;
+   TP1 val = *v, cpyval = val, h = (val < 0) ? -5 : 5;
int s1 = *S1, s2 = *S2;
 
/* shortcut nil */
@@ -76,12 +81,17 @@ FUN(,TP1,_dec2dec_,TP2) (TP2 *res, const
val = (val + h * scales[s1 - s2 - 1]) / scales[s1 - s2];
 
/* see if the number fits in the data type */
-   if (val > (lng) GDKmin(TP2) && val <= GDKmax(TP2)
+   if (val > (TP1) GDKmin(TP2) && val <= (TP1) GDKmax(TP2)
) {
*res = (TP2) val;
return MAL_SUCCEED;
} else {
-   throw(SQL, "convert", "22003!value (" LLFMT ") exceeds limits 
of type "STRNG(TP2), val);
+   char *buf = NULL, *msg;
+   int len = 0;
+   BATatoms[TPE(TP1)].atomToStr(&buf, &len, &val);
+   msg = createException(SQL, "convert", "22003!value (%s) exceeds 
limits of type "STR

MonetDB: default - Merge with Dec2016 branch.

2017-01-27 Thread Sjoerd Mullender
Changeset: 43db749925a8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43db749925a8
Added Files:
sql/backends/monet5/sql_cast_impl_int.h
sql/test/BugTracker-2017/Tests/round-or-truncate.Bug-6193.sql
sql/test/BugTracker-2017/Tests/round-or-truncate.Bug-6193.stable.err
sql/test/BugTracker-2017/Tests/round-or-truncate.Bug-6193.stable.out
Removed Files:
sql/backends/monet5/sql_cast_impl_down_from_int.h
sql/backends/monet5/sql_cast_impl_up_to_int.h

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out.int128
Modified Files:
gdk/gdk_calc.c
geom/BugTracker/Tests/All
geom/BugTracker/Tests/X_crash.SF-1971632.sql
monetdb5/extras/mal_optimizer_template/Tests/All
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql
monetdb5/optimizer/opt_pipes.c
sql/backends/monet5/Makefile.ag
sql/backends/monet5/generator/Tests/generator04.sql
sql/backends/monet5/generator/Tests/generator04.stable.err
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cast.c
sql/backends/monet5/sql_cast_impl_down_from_flt.h
sql/backends/monet5/sql_cast_impl_up_to_flt.h
sql/jdbc/tests/Tests/All
sql/server/sql_atom.c
sql/test/ADT2006/Tests/bram.stable.out
sql/test/BugTracker-2009/Tests/All

sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.sql
sql/test/BugTracker-2015/Tests/cast_to_num.Bug-3744.stable.out
sql/test/BugTracker-2016/Tests/All
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
sql/test/BugTracker-2017/Tests/All
sql/test/VOC/Tests/VOC.stable.out
sql/test/mergetables/Tests/forex.stable.out
sql/test/mergetables/Tests/forex.stable.out.int128
sql/test/pg_regress/Tests/All
sql/test/pg_regress/Tests/int8.sql
sql/test/pg_regress/Tests/numeric.sql
sql/test/pg_regress/Tests/numeric.stable.err
sql/test/pg_regress/Tests/numeric.stable.out
sql/test/pg_regress/Tests/numerology.stable.out
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql

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

Merge with Dec2016 branch.


diffs (truncated from 5597 to 300 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -13447,6 +13447,13 @@ convert_##TYPE1##_##TYPE2(const TYPE1 *s
 /* Special version of the above for converting from floating point.
  * The final assignment rounds the value which can still come out to
  * the NIL representation, so we need to check for that. */
+#ifdef TRUNCATE_NUMBERS
+#define roundflt(x)(x)
+#define rounddbl(x)(x)
+#else
+#define roundflt(x)roundf(x)
+#define rounddbl(x)round(x)
+#endif
 #define convertimpl_reduce_float(TYPE1, TYPE2) \
 static BUN \
 convert_##TYPE1##_##TYPE2(const TYPE1 *src, TYPE2 *restrict dst, BUN cnt, \
@@ -13468,7 +13475,7 @@ convert_##TYPE1##_##TYPE2(const TYPE1 *s
CONV_OVERFLOW(TYPE1, #TYPE2, src[i]);   \
dst[i] = TYPE2##_nil;   \
nils++; \
-   } else if ((dst[i] = (TYPE2) src[i]) == TYPE2##_nil &&  \
+   } else if ((dst[i] = (TYPE2) round##TYPE1(src[i])) == 
TYPE2##_nil && \
   abort_on_error)  \
CONV_OVERFLOW(TYPE1, #TYPE2, src[i]);   \
}   \
@@ -13575,6 +13582,9 @@ convertimpl_reduce_float(dbl, lng)
 #ifdef HAVE_HGE
 convertimpl_reduce_float(dbl, hge)
 #endif
+#undef rounddbl
+/* no rounding here */
+#define rounddbl(x)(x)
 convertimpl_reduce_float(dbl, flt)
 convertimpl_copy(dbl)
 
diff --git a/geom/BugTracker/Tests/All b/geom/BugTracker/Tests/All
--- a/geom/BugTracker/Tests/All
+++ b/geom/BugTracker/Tests/All
@@ -1,7 +1,7 @@
 # tests related to bug reports:
 # .SF-[.]
 
-HAVE_GEOM&THREADS=1?X_crash.SF-1971632
+HAVE_GEOM?X_crash.SF-1971632
 HAVE_GEOM?copy_into_crash.SF-1975402
 HAVE_GEOM?copy_into_mbr.3492
 
diff --git a/geom/BugTracker/Tests/X_crash.SF-1971632.sql 
b/geom/BugTracker/Tests/X_crash.SF-1971632.sql
--- a/geom/BugTracker/Tests/X_crash.SF-1971632.sql
+++ b/geom/BugTracker/Tests/X_crash.SF-1971632.sql
@@ -1,3 +1,5 @@
+set optimizer = 'sequential_pipe'; -- to get predictable errors
+
 CREATE TABLE geoms (id INTEGER, g GEOMETRY);
 INSERT INTO geoms values (1, 'POINT(10 10)');
 INSERT INTO geo

MonetDB: default - Merge with Dec2016 branch.

2017-01-27 Thread Sjoerd Mullender
Changeset: 2ab3006100c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2ab3006100c3
Added Files:
sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.sql

sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.stable.err

sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.stable.out
Modified Files:
geom/BugTracker/Tests/X_crash.SF-1971632.stable.out
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows

sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (253 lines):

diff --git a/geom/BugTracker/Tests/X_crash.SF-1971632.stable.out 
b/geom/BugTracker/Tests/X_crash.SF-1971632.stable.out
--- a/geom/BugTracker/Tests/X_crash.SF-1971632.stable.out
+++ b/geom/BugTracker/Tests/X_crash.SF-1971632.stable.out
@@ -29,8 +29,8 @@ Ready.
 [ 1]
 [ 1]
 #select count(*) from geoms;
-% sys.L1 # table_name
-% L1 # name
+% sys.L4 # table_name
+% L3 # name
 % bigint # type
 % 1 # length
 [ 4]
diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
--- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
+++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
@@ -49,21 +49,21 @@ Ready.
 % .L2 # table_name
 % L2 # name
 % varchar # type
-% 12 # length
-[ "default_pipe"   ]
+% 15 # length
+[ "sequential_pipe"]
 #select def from optimizers() where name = optimizer;
 % .L1 # table_name
 % def # name
 % clob # type
-% 544 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mitosis();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.dataflow();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.garbageCollector();"
   ]
+% 503 # length
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.reorder();optimizer.deadcode();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.garbageCollector();"
]
 #explain copy into ttt from '/tmp/xyz';
 % .explain # table_name
 % mal # name
 % clob # type
 % 158 # length
-function user.s8_1():void;
-X_1:void := querylog.define("explain copy into ttt from \\'/tmp/xyz\\';", 
"default_pipe", 21:int);
+function user.s10_1():void;
+X_1:void := querylog.define("explain copy into ttt from \\'/tmp/xyz\\';", 
"sequential_pipe", 21:int);
 X_4 := sql.mvc();
 (X_25:bat[:int], X_26:bat[:int], X_27:bat[:int]) := sql.copy_from(nil:ptr, 
"|", "\\n", nil:str, "null", "/tmp/xyz", -1:lng, 0:lng, 0:int, 0:int, nil:str);
 X_29 := sql.append(X_4, "sys", "ttt", "a", X_25);
@@ -71,7 +71,7 @@ function user.s8_1():void;
 X_37 := sql.append(X_34, "sys", "ttt", "c", X_27);
 X_39 := aggr.count(X_27);
 sql.affectedRows(X_37, X_39);
-end user.s8_1;
+end user.s10_1;
 #inline   actions= 0 time=1 usec 
 #candidates   actions= 1 time=14 usec 
 #remapactions= 0 time=3 usec 
@@ -114,14 +114,14 @@ end user.s8_1;
 % .L1 # table_name
 % def # name
 % clob # type
-% 567 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mitosis();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.dataflow();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.sql_append();optimizer.garbageCollector();"
]
+% 526 # length
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.reorder();optimizer.deadcode();optimizer.matpack();optimizer.querylog();optimizer.multiplex(

MonetDB: default - Merge with Dec2016 branch.

2017-01-30 Thread Sjoerd Mullender
Changeset: 55cd1907ad24 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55cd1907ad24
Modified Files:
monetdb5/modules/mal/tablet.c
sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (78 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -959,6 +959,9 @@ SQLworker_column(READERtask *task, int c
int i;
Column *fmt = task->as->format;
 
+   if (fmt[col].c == NULL)
+   return 0;
+
/* watch out for concurrent threads */
MT_lock_set(&mal_copyLock);
if (!fmt[col].skip && BATcapacity(fmt[col].c) < BATcount(fmt[col].c) + 
task->next) {
@@ -1617,6 +1620,7 @@ SQLload_file(Client cntxt, Tablet *as, b
BUN cnt = 0, cntstart = 0, leftover = 0;
int res = 0;/* < 0: error, > 0: success, == 0: continue 
processing */
int j;
+   BUN firstcol;
BUN i, attr;
READERtask *task = (READERtask *) GDKzalloc(sizeof(READERtask));
READERtask ptask[MAXWORKERS];
@@ -1762,10 +1766,13 @@ SQLload_file(Client cntxt, Tablet *as, b
 #ifdef MLOCK_TST
mlock(task->b->buf, task->b->size);
 #endif
+   for (firstcol = 0; firstcol < task->as->nr_attrs; firstcol++)
+   if (task->as->format[firstcol].c != NULL)
+   break;
while (res == 0 && cnt < task->maxrow) {
 
// track how many elements are in the aggregated BATs
-   cntstart = BATcount(task->as->format[0].c);
+   cntstart = BATcount(task->as->format[firstcol].c);
/* block until the producer has data available */
MT_sema_down(&task->consumer);
cnt += task->top[task->cur];
@@ -1857,9 +1864,9 @@ SQLload_file(Client cntxt, Tablet *as, b
 
 #ifdef _DEBUG_TABLET_
mnstr_printf(GDKout, "#Trim bbest %d table size " BUNFMT " rows 
found so far " BUNFMT "\n",
-best, BATcount(as->format[0].c), 
task->cnt);
+best, 
BATcount(as->format[firstcol].c), task->cnt);
 #endif
-   if (best && BATcount(as->format[0].c)) {
+   if (best && BATcount(as->format[firstcol].c)) {
BUN limit;
int width;
 
@@ -1920,7 +1927,7 @@ SQLload_file(Client cntxt, Tablet *as, b
 task->ateof, res);
 #endif
 
-   cnt = BATcount(task->as->format[0].c);
+   cnt = BATcount(task->as->format[firstcol].c);
if (GDKdebug & GRPalgorithms) {
mnstr_printf(GDKout, "#COPY reader time " LLFMT " line break " 
LLFMT " io " LLFMT "\n",
 total, lio, iototal);
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
@@ -483,7 +483,7 @@ sql_update_geom(Client c, mvc *sql, int 
 }
 
 static str
-sql_update_default(Client c, mvc *sql)
+sql_update_dec2016(Client c, mvc *sql)
 {
size_t bufsize = 12240, pos = 0;
char *buf = GDKmalloc(bufsize), *err = NULL;
@@ -1284,7 +1284,7 @@ SQLupgrades(Client c, mvc *m)
 
sql_find_subtype(&tp, "clob", 0, 0);
if (!sql_bind_func3(m->sa, s, "createorderindex", &tp, &tp, &tp, 
F_PROC)) {
-   if ((err = sql_update_default(c, m)) != NULL) {
+   if ((err = sql_update_dec2016(c, m)) != NULL) {
fprintf(stderr, "!%s\n", err);
GDKfree(err);
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-30 Thread Sjoerd Mullender
Changeset: 76e085af5b55 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76e085af5b55
Modified Files:
gdk/gdk_calc.c
sql/backends/monet5/sql_cast.c
sql/backends/monet5/sql_cast_impl_int.h
sql/backends/monet5/sql_fround.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (82 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -13454,6 +13454,20 @@ convert_##TYPE1##_##TYPE2(const TYPE1 *s
 #define roundflt(x)roundf(x)
 #define rounddbl(x)round(x)
 #endif
+
+#ifndef HAVE_ROUND
+static inline double
+round(double val)
+{
+   /* round to nearest integer, away from zero */
+   if (val < 0)
+   return -floor(-val + 0.5);
+   else
+   return floor(val + 0.5);
+}
+#define roundf(x)  ((float)round((double)(x)))
+#endif
+
 #define convertimpl_reduce_float(TYPE1, TYPE2) \
 static BUN \
 convert_##TYPE1##_##TYPE2(const TYPE1 *src, TYPE2 *restrict dst, BUN cnt, \
diff --git a/sql/backends/monet5/sql_cast.c b/sql/backends/monet5/sql_cast.c
--- a/sql/backends/monet5/sql_cast.c
+++ b/sql/backends/monet5/sql_cast.c
@@ -465,6 +465,19 @@ SQLbatstr_cast(Client cntxt, MalBlkPtr m
return msg;
 }
 
+#ifndef HAVE_ROUND
+static inline double
+round(double val)
+{
+   /* round to nearest integer, away from zero */
+   if (val < 0)
+   return -floor(-val + 0.5);
+   else
+   return floor(val + 0.5);
+}
+#define roundf(x)  ((float)round((double)(x)))
+#endif
+
 /* up casting */
 
 #define TP1 bte
diff --git a/sql/backends/monet5/sql_cast_impl_int.h 
b/sql/backends/monet5/sql_cast_impl_int.h
--- a/sql/backends/monet5/sql_cast_impl_int.h
+++ b/sql/backends/monet5/sql_cast_impl_int.h
@@ -48,7 +48,7 @@ FUN(do_,TP1,_dec2dec_,TP2) (TP2 *restric
GDKfree(buf);
return msg;
}
-   val *= scales[s2 - s1];
+   val *= (TP1) scales[s2 - s1];
} else if (s2 < s1) {
if (val / scales[s1 - s2] <= GDKmin(TP2) ||
val / scales[s1 - s2] > GDKmax(TP2)) {
@@ -75,9 +75,9 @@ FUN(do_,TP1,_dec2dec_,TP2) (TP2 *restric
*res = (TP2) val;
 #else
if (s2 > s1) {
-   r *= scales[s2 - s1];
+   r *= (TP2) scales[s2 - s1];
} else if (s2 < s1) {
-   r = (TP1) ((r
+   r = (TP2) ((r
 #ifndef TRUNCATE_NUMBERS
  + (val < 0 ? -5 : 5) * scales[s1 - s2 - 1]
 #endif
diff --git a/sql/backends/monet5/sql_fround.c b/sql/backends/monet5/sql_fround.c
--- a/sql/backends/monet5/sql_fround.c
+++ b/sql/backends/monet5/sql_fround.c
@@ -22,7 +22,6 @@
 #include "clients.h"
 #include "mal_instruction.h"
 
-/* Windows doesn't have round or trunc, but it does have floor and ceil */
 #ifndef HAVE_ROUND
 static inline double
 round(double val)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-01-31 Thread Sjoerd Mullender
Changeset: 7b3b0b6185df for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b3b0b6185df
Removed Files:
sql/test/Tests/setoptimizer.stable.out.Windows
Modified Files:

monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
monetdb5/mal/mal_client.c
monetdb5/mal/mal_import.c
monetdb5/mal/mal_session.c
monetdb5/modules/atoms/mtime.c
sql/test/Tests/setoptimizer.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (235 lines):

diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
--- 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
+++ 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
@@ -49,21 +49,21 @@ Ready.
 % .L2 # table_name
 % L2 # name
 % varchar # type
-% 12 # length
-[ "default_pipe"   ]
+% 15 # length
+[ "sequential_pipe"]
 #select def from optimizers() where name = optimizer;
 % .L1 # table_name
 % def # name
 % clob # type
-% 579 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mitosis();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.reduce();optimizer.matpack();optimizer.dataflow();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.jit();optimizer.garbageCollector();"
]
+% 538 # length
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.reorder();optimizer.deadcode();optimizer.reduce();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.jit();optimizer.garbageCollector();"
 ]
 #explain copy into ttt from 'a:\tmp/xyz';
 % .explain # table_name
 % mal # name
 % clob # type
 % 149 # length
-function user.s8_1():void;
-X_0:void := querylog.define("explain copy into ttt from 
\\'a:tmp/xyz\\';","default_pipe",4:int);
+function user.s10_1():void;
+X_0:void := querylog.define("explain copy into ttt from 
\\'a:tmp/xyz\\';","sequential_pipe",4:int);
 X_3 := sql.mvc();
 (X_24:bat[:int],X_25:bat[:int],X_26:bat[:int]) := 
sql.copy_from(nil:ptr,"|","\\n",nil:str,"null","a:\\tmp/xyz",-1:lng,0:lng,0:int,0:int,nil:str);
 X_28 := sql.append(X_3,"sys","ttt","a",X_24);
@@ -109,14 +109,14 @@ end user.s10_1;
 % .L1 # table_name
 % def # name
 % clob # type
-% 602 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mitosis();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.reduce();optimizer.matpack();optimizer.dataflow();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.jit();optimizer.sql_append();optimizer.garbageCollector();"
 ]
+% 561 # length
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.reorder();optimizer.deadcode();optimizer.reduce();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.jit();optimizer.sql_append();optimizer.garbageCollector();"
  ]
 #explain copy into ttt from 'Z:/tmp/xyz';
 % .explain # table_name
 % mal # name
 % clob # type
 % 148 # length
-function user.s24_1():void;
+function user.s26_1():void;
 X_0:void := querylog.define("explain copy into ttt from 
\\'Z:/tmp/xyz\\';","user_1",4:int);
 X_3 := sql.mvc();
 (X_24:bat[:int],X_25:bat[:int],X_26:bat[:int]) := 
sql.copy_from(nil:ptr,"|","\\n",nil:str,"null","Z:/tmp/xyz",-1:lng,0:lng,0:int,0:int,nil:str);
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -110,7 +110,7 @@ MCpopClientInput(Client c)
ClientInput *x = c->bak;
if (c->fdin) {
/* missing protection against closing stdin stream */

MonetDB: default - Merge with Dec2016 branch.

2017-02-01 Thread Sjoerd Mullender
Changeset: 47bb3cb873ea for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=47bb3cb873ea
Added Files:
sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.sql
sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.stable.err
sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.stable.out
sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.sql
sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.stable.err
sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.stable.out
sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.sql
sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.stable.err
sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.stable.out
sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.sql
sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.stable.err
sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.stable.out
sql/test/BugTracker-2017/Tests/union_func_crash.Bug-6196.sql
sql/test/BugTracker-2017/Tests/union_func_crash.Bug-6196.stable.err
sql/test/BugTracker-2017/Tests/union_func_crash.Bug-6196.stable.out
Modified Files:
monetdb5/modules/atoms/str.c
monetdb5/modules/kernel/mmath.mal
monetdb5/optimizer/opt_support.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/server/rel_optimizer.c
sql/server/rel_select.c
sql/server/sql_mvc.h
sql/test/BugTracker-2014/Tests/too_general_errmsg.Bug-3605.stable.err
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 741 to 300 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
@@ -1863,11 +1863,11 @@ STRsplitpart(str *res, str *haystack, st
}

if (p == 0) {
-   len = UTF8_strlen(s);
+   len = strlen(s);
} else if ((p = strstr(s, s2)) != 0) {
len = (int) (p - s);
} else {
-   len = UTF8_strlen(s);
+   len = strlen(s);
}
 
if (len == int_nil || len == 0) {
diff --git a/monetdb5/modules/kernel/mmath.mal 
b/monetdb5/modules/kernel/mmath.mal
--- a/monetdb5/modules/kernel/mmath.mal
+++ b/monetdb5/modules/kernel/mmath.mal
@@ -194,7 +194,7 @@ unsafe command rand () :int
 address MATHrandint
 comment "return a random number";
 
-command rand (v:int) :int 
+unsafe command rand (v:int) :int 
 address MATHrandintarg
 comment "return a random number";
 
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
@@ -277,7 +277,7 @@ isUnsafeFunction(InstrPtr q)
 }
 
 /*
- * Instructions are unsafe is one of the arguments is also mentioned
+ * Instructions are unsafe if one of the arguments is also mentioned
  * in the result list. Alternatively, the 'unsafe' property is set
  * for the function call itself.
  */
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
@@ -591,6 +591,15 @@ alter_table(Client cntxt, mvc *sql, char
sql_column *nc = mvc_bind_column(sql, nt, c->base.name);
 
if (c->null != nc->null && isTable(nt)) {
+   if (c->null && nt->pkey) { /* check for primary keys 
based on this column */
+   node *m;
+   for(m = nt->pkey->k.columns->h; m; m = m->next) 
{
+   sql_kc *kc = m->data;
+
+   if (kc->c->base.id == c->base.id)
+   return sql_message("4!NOT 
NULL CONSTRAINT: cannot change NOT NULL CONSTRAINT for column '%s' as its part 
of the PRIMARY KEY\n", c->base.name);
+   }
+   }
mvc_null(sql, nc, c->null);
/* for non empty check for nulls */
if (c->null == 0) {
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
@@ -3961,7 +3961,7 @@ rel_push_select_down(int *changes, mvc *
pl = r->l;
/* introduce selects under the project (if needed) */
set_processed(pl);
-   if (!is_select(pl->op))
+   if (!is_select(pl->op) || rel_is_ref(pl))
r->l = pl = rel_select(sql->sa, pl, NULL);
 
/* for each exp check if we can rename it */
@@ -4586,7 +4586,7 @@ rel_push_select_down_union(int *changes,
if (u->op == op_project)
u = u->l;
 
-   if (!u || !is_union(u->o

MonetDB: default - Merge with Dec2016 branch.

2017-02-02 Thread Sjoerd Mullender
Changeset: caa628bc505f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=caa628bc505f
Added Files:
sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.sql
sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.stable.err
sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.stable.out
sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.sql
sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.stable.err
sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.stable.out
Modified Files:
monetdb5/mal/Makefile.ag
monetdb5/modules/atoms/str.c
monetdb5/modules/mal/orderidx.c
monetdb5/modules/mal/pcre.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/server/rel_optimizer.c
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 467 to 300 lines):

diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -54,10 +54,18 @@ headers_h = {
HEADERS = h
SOURCES = \
mal.h \
+   mal_client.h \
mal_errors.h \
mal_exception.h \
+   mal_factory.h \
+   mal_function.h \
mal_instruction.h \
+   mal_interpreter.h \
+   mal_listing.h \
+   mal_module.h \
mal_namespace.h \
+   mal_profiler.h \
+   mal_resolve.h \
mal_stack.h \
mal_type.h
 }
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
@@ -1831,8 +1831,8 @@ STRReverseStrSearch(int *res, const str 
 str
 STRsplitpart(str *res, str *haystack, str *needle, int *field)
 {
-   size_t slen;
-   int len, f = *field;
+   size_t len;
+   int f = *field;
char *p;
const char *s = *haystack;
const char *s2 = *needle;
@@ -1848,10 +1848,10 @@ STRsplitpart(str *res, str *haystack, st
throw(MAL, "str.splitpart", "field position must be greater 
than zero");
}
 
-   slen = strlen(s2);
+   len = strlen(s2);
 
while ((p = strstr(s, s2)) != 0 && f > 1) {
-   s = p + slen;
+   s = p + len;
f--;
}
 
@@ -1861,16 +1861,16 @@ STRsplitpart(str *res, str *haystack, st
throw(MAL, "str.splitpart", MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
-   
+
if (p == 0) {
len = strlen(s);
} else if ((p = strstr(s, s2)) != 0) {
-   len = (int) (p - s);
+   len = (size_t) (p - s);
} else {
len = strlen(s);
}
 
-   if (len == int_nil || len == 0) {
+   if (len == 0) {
*res = GDKstrdup("");
if (*res == NULL)
throw(MAL, "str.splitpart", MAL_MALLOC_FAIL);
diff --git a/monetdb5/modules/mal/orderidx.c b/monetdb5/modules/mal/orderidx.c
--- a/monetdb5/modules/mal/orderidx.c
+++ b/monetdb5/modules/mal/orderidx.c
@@ -47,6 +47,25 @@ OIDXcreateImplementation(Client cntxt, i
if (b->torderidx)
return MAL_SUCCEED;
 
+   switch (ATOMbasetype(b->ttype)) {
+   case TYPE_bte:
+   case TYPE_sht:
+   case TYPE_int:
+   case TYPE_lng:
+#ifdef HAVE_HGE
+   case TYPE_hge:
+#endif
+   case TYPE_flt:
+   case TYPE_dbl:
+   break;
+   case TYPE_str:
+   /* TODO: support strings etc. */
+   case TYPE_void:
+   case TYPE_ptr:
+   default:
+   throw(MAL, "bat.orderidx", TYPE_NOT_SUPPORTED);
+   }
+
if( pieces < 0 ){
if (GDKnr_threads <= 1) {
pieces = 1;
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
@@ -642,8 +642,13 @@ alter_table(Client cntxt, mvc *sql, char
if (i->type == ordered_idx) {
sql_kc *ic = i->columns->h->data;
BAT *b = mvc_bind(sql, nt->s->base.name, 
nt->base.name, ic->c->base.name, 0);
-   OIDXcreateImplementation(cntxt, 
newBatType(b->ttype), b, -1);
+   char *msg = OIDXcreateImplementation(cntxt, 
newBatType(b->ttype), b, -1);
BBPunfix(b->batCacheid);
+   if (msg != MAL_SUCCEED) {
+   char *smsg = sql_message("40002!CREATE 
ORDERED INDEX: %s", msg);
+   freeException(msg);
+   return smsg;
+   }

MonetDB: default - Merge with Dec2016 branch.

2017-02-03 Thread Sjoerd Mullender
Changeset: 26dde113491f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=26dde113491f
Added Files:
sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.sql

sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.stable.err

sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.stable.out
sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.sql
sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.err
sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out
sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.sql

sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.stable.err

sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.stable.out
Modified Files:
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.int128
gdk/gdk.h
gdk/gdk_atoms.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_upgrades.c
sql/benchmarks/ATIS/Tests/select_group.stable.out
sql/benchmarks/ATIS/Tests/select_group.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/01.stable.out
sql/benchmarks/tpch/LOCKED/Tests/01.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/03.stable.out
sql/benchmarks/tpch/LOCKED/Tests/03.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/04.stable.out
sql/benchmarks/tpch/LOCKED/Tests/05.stable.out
sql/benchmarks/tpch/LOCKED/Tests/05.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/06.stable.out
sql/benchmarks/tpch/LOCKED/Tests/06.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/07.stable.out
sql/benchmarks/tpch/LOCKED/Tests/07.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/08.stable.out
sql/benchmarks/tpch/LOCKED/Tests/08.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/09.stable.out
sql/benchmarks/tpch/LOCKED/Tests/09.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/10.stable.out
sql/benchmarks/tpch/LOCKED/Tests/10.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/11.stable.out
sql/benchmarks/tpch/LOCKED/Tests/11.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/12.stable.out
sql/benchmarks/tpch/LOCKED/Tests/12.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/13.stable.out
sql/benchmarks/tpch/LOCKED/Tests/14.stable.out
sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/15.stable.out
sql/benchmarks/tpch/LOCKED/Tests/15.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/16.stable.out
sql/benchmarks/tpch/LOCKED/Tests/17.stable.out
sql/benchmarks/tpch/LOCKED/Tests/17.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/18.stable.out
sql/benchmarks/tpch/LOCKED/Tests/18.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/19.stable.out
sql/benchmarks/tpch/LOCKED/Tests/19.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/21.stable.out
sql/benchmarks/tpch/LOCKED/Tests/21.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/22.stable.out
sql/benchmarks/tpch/LOCKED/Tests/22.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/check1.stable.out
sql/benchmarks/tpch/LOCKED/Tests/check2.stable.out
sql/benchmarks/tpch/LOCKED/Tests/load.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/Tests/01.stable.out
sql/benchmarks/tpch/Tests/01.stable.out.int128
sql/benchmarks/tpch/Tests/03.stable.out
sql/benchmarks/tpch/Tests/03.stable.out.int128
sql/benchmarks/tpch/Tests/05.stable.out
sql/benchmarks/tpch/Tests/05.stable.out.int128
sql/benchmarks/tpch/Tests/06.stable.out
sql/benchmarks/tpch/Tests/06.stable.out.int128
sql/benchmarks/tpch/Tests/07.stable.out
sql/benchmarks/tpch/Tests/07.stable.out.int128
sql/benchmarks/tpch/Tests/08.stable.out
sql/benchmarks/tpch/Tests/08.stable.out.int128
sql/benchmarks/tpch/Tests/09.stable.out
sql/benchmarks/tpch/Tests/09.stable.out.int128
sql/benchmarks/tpch/Tests/10.stable.out
sql/benchmarks/tpch/Tests/10.stable.out.int128
sql/benchmarks/tpch/Tests/11.stable.out
sql/benchmarks/tpch/Tests/11.stable.out.int128
sql/benchmarks/tpch/Tests/14.stable.out
sql/benchmarks/tpch/Tests/14.stable.out.int128
sql/benchmarks/tpch/Tests/15.stable.out
sql/benchmarks/tpch/Tests/15.stable.out.int128
sql/benchmarks/tpch/Tests/17.stable.out
sql/ben

MonetDB: default - Merge with Dec2016 branch.

2017-02-08 Thread Sjoerd Mullender
Changeset: c2339c56c478 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c2339c56c478
Added Files:
monetdb5/extras/rapi/Tests/rapi02.stable.out.int128
sql/backends/monet5/Tests/int_notation_1e5.stable.out.int128
sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_huge.stable.out.int128
sql/jdbc/tests/Tests/Test_Int128.stable.out.int128

sql/test/BugTracker-2015/Tests/hugeint-wrong-value.Bug-3849.stable.out.int128

sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128

sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.stable.out.int128
sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.sql
sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.stable.err
sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.stable.out
sql/test/mapi/Tests/mal_int128.stable.out.int128
sql/test/mapi/Tests/perl_dec38.stable.out.int128
sql/test/mapi/Tests/perl_int128.stable.out.int128
sql/test/mapi/Tests/php_dec38.stable.out.int128
sql/test/mapi/Tests/php_int128.stable.out.int128
sql/test/mapi/Tests/python2_dec38.stable.out.int128
sql/test/mapi/Tests/python2_int128.stable.out.int128
sql/test/mapi/Tests/python3_dec38.stable.out.int128
sql/test/mapi/Tests/python3_int128.stable.out.int128
sql/test/mapi/Tests/sql_dec38.stable.out.int128
sql/test/mapi/Tests/sql_int128.stable.out.int128
sql/test/pg_regress/Tests/numeric.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/package.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/unpackage.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/dump.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/unpackage.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb/Tests/testdb-package-hge.stable.out.int128
Removed Files:
gdk/bat.feps
gdk/bat.png
gdk/bat1.feps
gdk/bat1.png
gdk/bat2.feps
gdk/bat2.png
monetdb5/extras/rapi/Tests/rapi02.stable.out
sql/backends/monet5/Tests/int_notation_1e5.stable.out
sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_huge.stable.out
sql/jdbc/tests/Tests/Test_Int128.stable.out
sql/test/BugTracker-2015/Tests/hugeint-wrong-value.Bug-3849.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out

sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.stable.out
sql/test/mapi/Tests/mal_int128.stable.out
sql/test/mapi/Tests/perl_dec38.stable.out
sql/test/mapi/Tests/perl_int128.stable.out
sql/test/mapi/Tests/php_dec38.stable.out
sql/test/mapi/Tests/php_int128.stable.out
sql/test/mapi/Tests/python2_dec38.stable.out
sql/test/mapi/Tests/python2_int128.stable.out
sql/test/mapi/Tests/python3_dec38.stable.out
sql/test/mapi/Tests/python3_int128.stable.out
sql/test/mapi/Tests/sql_dec38.stable.out
sql/test/mapi/Tests/sql_int128.stable.out
sql/test/pg_regress/Tests/numeric.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/package.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/unpackage.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
sql/test/testdb-upgrade-hge/Tests/dump.stable.out
sql/test/testdb-upgrade-hge/Tests/unpackage.stable.out
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
sql/test/testdb/Tests/testdb-package-hge.stable.out
Modified Files:
gdk/gdk_join.c
monetdb5/extras/rapi/rapi.c
monetdb5/modules/mal/sysmon.c
sql/backends/monet5/sql_round_impl.h
sql/benchmarks/ssbm/Tests/01-13.stable.out
sql/benchmarks/ssbm/Tests/01-13.stable.out.int128
sql/benchmarks/ssbm/Tests/01.stable.out
sql/benchmarks/ssbm/Tests/01.stable.out.int128
sql/benchmarks/ssbm/Tests/02.stable.out
sql/benchmarks/ssbm/Tests/02.stable.out.int128
sql/benchmarks/ssbm/Tests/03.stable.out
sql/benchmarks/ssbm/Tests/03.stable.out.int128
sql/common/sql_types.c
sql/server/rel_psm.c
sql/server/rel_select.c
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out

sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.out

sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.out.int128
sql/test/BugTracker-2017/Tests/A

MonetDB: default - Merge with Dec2016 branch.

2017-02-09 Thread Sjoerd Mullender
Changeset: 06e7ddcdd814 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06e7ddcdd814
Added Files:

sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out.int128
sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.sql

sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.stable.err

sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.stable.out
Removed Files:
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out.single
sql/test/BugTracker-2014/Tests/querylog.Bug-3607.stable.err.single
sql/test/BugTracker-2014/Tests/querylog.Bug-3607.stable.out.single
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out.single
Modified Files:
gdk/Makefile.ag
monetdb5/optimizer/opt_support.c
sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.out
sql/backends/monet5/rel_bin.c
sql/test/BugTracker-2009/Tests/explain_gives_crash.SF-2741829.stable.out

sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out

sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out

sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out.32bit
sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2013/Tests/between.Bug-3259.sql
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out
sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.sql
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
sql/test/BugTracker-2014/Tests/querylog.Bug-3607.sql
sql/test/BugTracker-2014/Tests/querylog.Bug-3607.stable.out
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.sql
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.err
sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/mergetables/Tests/mergequery.stable.out
sql/test/pg_regress/Tests/float8.stable.err.Windows
sql/test/remote/Tests/partition_elim.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 2434 to 300 lines):

diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -34,7 +34,6 @@ lib_gdk = {
gdk_unique.c \
gdk_interprocess.c gdk_interprocess.h \
gdk_firstn.c \
-   bat.feps bat1.feps bat2.feps \
libbat.rc
LIBS = ../common/options/libmoptions \
../common/stream/libstream \
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
@@ -398,6 +398,10 @@ hasSideEffects(InstrPtr p, int strict)
 {
if( getFunctionId(p) == NULL) return FALSE;
 
+   /* update instructions have side effects */
+   if (isUpdateInstruction(p))
+   return TRUE;
+
if ( (getModuleId(p) == batRef || getModuleId(p)==sqlRef) &&
 (getFunctionId(p) == setAccessRef ||
  getFunctionId(p) == setWriteModeRef ||
@@ -442,10 +446,6 @@ hasSideEffects(InstrPtr p, int strict)
if (getFunctionId(p) == zero_or_oneRef) return FALSE;
if (getFunctionId(p) == mvcRef) return FALSE;
if (getFunctionId(p) == singleRef) return FALSE;
-   /* the update instructions for SQL has side effects.
-  whether this is relevant should be explicitly checked
-  in the environment of the call */
-   if (isUpdateInstruction(p)) return TRUE;
return TRUE;
}
if( getModuleId(p) == languageRef){
diff --git a/sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out 
b/sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
--- a/sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
+++ b/sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
@@ -172,15 +172,10 @@ end user.s8_1;
 function user.s16_1():void;
 X_1:void := querylog.define("explain select fuse(a,b) from udf_fuse;", 
"sequential_pipe", 27:int);
 X_29 := bat.new(nil:

MonetDB: default - Merge with Dec2016 branch.

2017-02-10 Thread Sjoerd Mullender
Changeset: 2572e6750e46 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2572e6750e46
Added Files:
sql/test/emptydb/Tests/check.SQL.py
Removed Files:
clients/Tests/SQL-dump.SQL.py
clients/Tests/SQL-dump.stable.err
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.int128
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
sql/test/emptydb/Tests/check.SQL.py.src
Modified Files:
clients/Tests/All
monetdb5/optimizer/opt_reorder.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/sql_upgrades.c
sql/test/bugs/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/check.SQL.py.src
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/All
sql/test/emptydb-upgrade-chain/Tests/check.SQL.py.src
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-hge/Tests/All
sql/test/emptydb-upgrade-hge/Tests/check.SQL.py.src
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/All
sql/test/emptydb-upgrade/Tests/check.SQL.py.src
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb/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-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 16138 to 300 lines):

diff --git a/clients/Tests/All b/clients/Tests/All
--- a/clients/Tests/All
+++ b/clients/Tests/All
@@ -1,4 +1,3 @@
 exports
 
HAVE_FITS&HAVE_GEOM&HAVE_GSL&HAVE_LIBPY&HAVE_LIBR&HAVE_LIDAR&HAVE_NETCDF&HAVE_SAMTOOLS&HAVE_SHP&HAVE_SPHINXCLIENT?MAL-signatures
-!BITS32&HAVE_FITS&HAVE_GEOM&HAVE_GSL&HAVE_LIDAR&HAVE_NETCDF&HAVE_PCRE&HAVE_SHP&HAVE_SAMTOOLS?SQL-dump
 MERCURIAL?malcheck
diff --git a/clients/Tests/SQL-dump.stable.err 
b/clients/Tests/SQL-dump.stable.err
deleted file mode 100644
--- a/clients/Tests/SQL-dump.stable.err
+++ /dev/null
@@ -1,36 +0,0 @@
-stderr of test 'SQL-dump` in directory 'clients` itself:
-
-
-# 15:01:36 >  
-# 15:01:36 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34237" "--set" 
"mapi_usock=/var/tmp/mtest-13451/.s.monetdb.34237" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_clients" "--set" 
"mal_listing=0"
-# 15:01:36 >  
-
-# builtin opt  gdk_dbpath = 
/ufs/sjoerd/Monet-candidate/var/monetdb5/dbfarm/demo
-# builtin opt  gdk_debug = 0
-# builtin opt  gdk_vmtrim = yes
-# builtin opt  monet_prompt = >
-# builtin opt  monet_daemon = no
-# builtin opt  mapi_port = 5
-# builtin opt  mapi_open = false
-# builtin opt  mapi_autosense = false
-# builtin opt  sql_optimizer = default_pipe
-# builtin opt  sql_debug = 0
-# cmdline opt  gdk_nr_threads = 0
-# cmdline opt  mapi_open = true
-# cmdline opt  mapi_port = 34237
-# cmdline opt  mapi_usock = /var/tmp/mtest-13451/.s.monetdb.34237
-# cmdline opt  monet_prompt = 
-# cmdline opt  mal_listing = 2
-# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_clients
-# cmdline opt  mal_listing = 0
-
-# 15:01:36 >  
-# 15:01:36 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-13451" "--port=34237"
-# 15:01:36 >  
-
-
-
-# 15:01:41 >  
-# 15:01:41 >  "Done."
-# 15:01:41 >  
-
diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
deleted file mode 100644
--- a/clients/Tests/SQL-dump.stable.out
+++ /dev/null
@@ -1,7586 +0,0 @@
-stdout of test 'SQL-dump` in directory 'clients` itself:
-
-
-# 15:01:36 >  
-# 15:01:36 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34237" "--set" 
"mapi_usock=/var/tmp/mtest-13451/.s.monetdb.34237" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_clients" "--set" 
"mal_listing=0"
-# 15:01:36 >  
-
-# MonetDB 5 server v11.17.0 (hg id: 51cced809df4)
-# This is an unreleased version
-# Serving database 'mTests_clients', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Found 15.591 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://madrid.ins.cwi.nl:34237/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-13451/.s.monetdb.34237
-# MonetDB/GIS module loaded
-# MonetDB/JAQL modu

MonetDB: default - Merge with Dec2016 branch.

2017-02-13 Thread Sjoerd Mullender
Changeset: c162fb78322f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=3Dchangeset;node=3Dc162fb78322f
Modified Files:
MonetDB.spec
geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err
monetdb5/modules/mal/mkey.c
sql/backends/monet5/sql.c

sql/test/BugDay_2005-11-09_2.9.3/Tests/hang_on_copy_into.SF-1100504.stable=
.err
sql/test/BugTracker-2008/Tests/copy-format.SF-2468513.stable.err
sql/test/BugTracker-2008/Tests/varchar.SF-2471371.stable.err

sql/test/BugTracker-2009/Tests/copy_into_error_off_by_one.SF-2833696.stabl=
e.err

sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.stable.e=
rr
sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err

sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err

sql/test/BugTracker-2015/Tests/backslash_predecing_separator.Bug-3775.stab=
le.err
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker/Tests/copy_decimal.SF-1582957.stable.err
sql/test/BugTracker/Tests/copy_overflow_null_bug.SF-1842550.stable.err
sql/test/copy/Tests/columns.stable.err
sql/test/copy/Tests/int_parse.stable.err
sql/test/copy/Tests/load_stdin_incorrect_line_nr.stable.err
sql/test/copy/Tests/null_as_string_errors.stable.err
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 315 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -201,6 +201,7 @@ package, and most likely also %{name}-SQ
 more client packages.
=20
 %files
+%license COPYING
 %defattr(-,root,root)
 %{_libdir}/libbat.so.*
=20
@@ -242,6 +243,7 @@ This package contains a shared library (
 various other components.
=20
 %files stream
+%license COPYING
 %defattr(-,root,root)
 %{_libdir}/libstream.so.*
=20
@@ -289,6 +291,7 @@ SQL database so that it can be loaded ba
 MonetDB, you will very likely need this package.
=20
 %files client
+%license COPYING
 %defattr(-,root,root)
 %{_bindir}/mclient
 %{_bindir}/msqldump
@@ -375,6 +378,7 @@ odbcinst -u -d -n MonetDB
 fi
=20
 %files client-odbc
+%license COPYING
 %defattr(-,root,root)
 %{_libdir}/libMonetODBC.so
 %{_libdir}/libMonetODBCs.so
@@ -853,6 +857,7 @@ MonetDB packages.  You probably don't ne
 developer.  If you do want to test, install %{name}-testing-python.
=20
 %files testing
+%license COPYING
 %defattr(-,root,root)
 %{_bindir}/Mdiff
 %{_bindir}/MkillUsers
diff --git a/geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err b/=
geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err
--- a/geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err
+++ b/geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err
@@ -13,7 +13,7 @@ stderr of test 'copy_into_crash.SF-19754
 MAPI  =3D (monetdb) /var/tmp/mtest-27003/.s.monetdb.30235
 QUERY =3D COPY 1 RECORDS INTO nodes from STDIN USING DELIMITERS ',', '\n';
 45111956, 'POINT(52.0697 4.3723)'
-ERROR =3D !Failed to import table line 1 field p 'geometry(4)' expected in=
 ' 'POINT(52.0697 4.3723)''
+ERROR =3D !Failed to import table 'nodes', line 1 field p 'geometry(4)' ex=
pected in ' 'POINT(52.0697 4.3723)''
=20
 # 13:33:18 > =20
 # 13:33:18 >  Done.
diff --git a/monetdb5/modules/mal/mkey.c b/monetdb5/modules/mal/mkey.c
--- a/monetdb5/modules/mal/mkey.c
+++ b/monetdb5/modules/mal/mkey.c
@@ -50,6 +50,11 @@ MKEYhash(Client cntxt, MalBlkPtr mb, Mal
res=3D getArgReference_lng(stk,p,0);
val=3D getArgReference(stk,p,1);
switch (ATOMstorage(tpe)) {
+   case TYPE_void:
+   case TYPE_bat:
+   case TYPE_ptr:
+   // illegal types, avoid falling into the default case.
+   assert(0);
case TYPE_bte:
*res =3D MKEYHASH_bte(val);
break;
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
@@ -2507,7 +2507,7 @@ mvc_import_table_wrap(Client cntxt, MalB
if (fname && s =3D=3D NULL)
throw(IO, "bstreams.create", "Failed to create block stream");
if (b =3D=3D NULL)
-   throw(SQL, "importTable", "Failed to import table %s", 
be->mvc->errstr);
+   throw(SQL, "importTable", "Failed to import table '%s', %s", 
t->base.nam=
e, be->mvc->errstr);
bat2return(stk, pci, b);
GDKfree(b);
return msg;
diff --git a/sql/test/BugDay_2005-11-09_2.9.3/Tests/hang_on_copy_into.SF-11=
00504.stable.err b/sql/test/BugDay_2005-11-09_2.9.3/Tests/hang_on_copy_into=
.SF-1100504.stable.err
--- a/sql/test/BugDay_2005-11-09_2.9.3/Tests/hang_on_copy_into.SF-1100504.s=
table.err
+++ b/sql/test/BugDay_2005-11-09_2.9.3/Tests/hang_on_copy_into.SF-1100504.s=
table.err
@@ -88,9 +88,7 @@ QUERY =3D COPY 1 RECORDS INTO "news" FROM=20
 allemaal nogal lang duurt, maar in principe is het nog
 maar een uurtje of 6 werk om het goed te krijgen.

MonetDB: default - Merge with Dec2016 branch.

2017-02-14 Thread Sjoerd Mullender
Changeset: 771b92d1b410 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=771b92d1b410
Modified Files:
monetdb5/mal/mal_function.c
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (75 lines):

diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -924,7 +924,7 @@ showFlowDetails(MalBlkPtr mb, MalStkPtr 
 {
(void) mb; /* fool the compiler */
(void) stk; /* fool the compiler */
-   mnstr_printf(f, "n%d [fontsize=8, shape=box, label=\"%s\"]\n", pc, 
getFunctionId(p));
+   mnstr_printf(f, "n%d [fontsize=8, shape=box, label=\"%s\"]\n", pc, 
getFunctionId(p) ? getFunctionId(p) : "");
 }
 
 /* Produce a file with the flow graph in dot format.
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
@@ -171,6 +171,34 @@
 }  
  \
 }  
  \
 } }
+#define NP_COL_BAT_LOOPF(bat, mtpe_to, mtpe_from,index) {  
  \
+if (mask == NULL)  
  \
+{  
  \
+for (iu = 0; iu < ret->count; iu++)
  \
+{  
  \
+if (isnan(((mtpe_from*)data)[index_offset * ret->count + iu])) {   
  \
+   bat->tnil = 1;  
 \
+((mtpe_to*) Tloc(bat, 0))[index + iu] = mtpe_to##_nil; 
  \
+} else {   
  \
+((mtpe_to*) Tloc(bat, 0))[index + iu] = 
(mtpe_to)((mtpe_from*)data)[index_offset * ret->count + iu];
 \
+}  
  \
+}  
  \
+}  
  \
+else   
  \
+{  
  \
+for (iu = 0; iu < ret->count; iu++)
  \
+{  
  \
+if (mask[index_offset * ret->count + iu] == TRUE || 
isnan(((mtpe_from*)data)[index_offset * ret->count + iu]))  
 \
+{  
  \
+bat->tnil = 1; 
\
+((mtpe_to*) Tloc(bat, 0))[index + iu] = mtpe_to##_nil; 
  \
+}  
  \
+else   
  \
+{  
   

MonetDB: default - Merge with Dec2016 branch.

2017-02-15 Thread Sjoerd Mullender
Changeset: b0b48be77b7d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b0b48be77b7d
Modified Files:
gdk/gdk_batop.c
sql/test/BugTracker-2016/Tests/All
sql/test/emptydb/updatetests
sql/test/lateral/Tests/lateral.sql
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (107 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1729,6 +1729,8 @@ BATcount_no_nil(BAT *b)
return cnt;
 }
 
+/* create a new, dense candidate list with values from `first' up to,
+ * but not including, `last' */
 static BAT *
 newdensecand(oid first, oid last)
 {
@@ -1738,7 +1740,7 @@ newdensecand(oid first, oid last)
return NULL;
if (last < first)
first = last = 0; /* empty range */
-   BATsetcount(bn, last - first + 1);
+   BATsetcount(bn, last - first);
BATtseqbase(bn, first);
return bn;
 }
@@ -1790,19 +1792,19 @@ BATmergecand(BAT *a, BAT *b)
if (af <= bf && bf <= al + 1) {
/* partial overlap starting with a, or b is
 * smack bang after a */
-   return newdensecand(af, al < bl ? bl : al);
+   return newdensecand(af, al < bl ? bl + 1 : al + 1);
}
if (bf <= af && af <= bl + 1) {
/* partial overlap starting with b, or a is
 * smack bang after b */
-   return newdensecand(bf, al < bl ? bl : al);
+   return newdensecand(bf, al < bl ? bl + 1 : al + 1);
}
}
if (ad && af <= bf && al >= bl) {
-   return newdensecand(af, al);
+   return newdensecand(af, al + 1);
}
if (bd && bf <= af && bl >= al) {
-   return newdensecand(bf, bl);
+   return newdensecand(bf, bl + 1);
}
 
bn = COLnew(0, TYPE_oid, BATcount(a) + BATcount(b), TRANSIENT);
@@ -1912,7 +1914,7 @@ BATintersectcand(BAT *a, BAT *b)
 
if ((af + BATcount(a) - 1 == al) && (bf + BATcount(b) - 1 == bl)) {
/* both lists are VOID */
-   return newdensecand(MAX(af, bf), MIN(al, bl));
+   return newdensecand(MAX(af, bf), MIN(al, bl) + 1);
}
 
bn = COLnew(0, TYPE_oid, MIN(BATcount(a), BATcount(b)), TRANSIENT);
diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -57,7 +57,7 @@ cast_and_floor.Bug-6071
 union.Bug-6069
 ifthenelse-void.Bug-6075
 assert-on-table-producing-function.Bug-6076
-HAVE_NETCDF?assert-on-push-project-up.Bug-6077
+HAVE_NETCDF&HAVE_SAMTOOLS?assert-on-push-project-up.Bug-6077
 HAVE_SAMTOOLS?assert-on-project.Bug-6078
 crash.Bug-6081
 merge-table-edit.Bug-6084
diff --git a/sql/test/emptydb/updatetests b/sql/test/emptydb/updatetests
--- a/sql/test/emptydb/updatetests
+++ b/sql/test/emptydb/updatetests
@@ -3,7 +3,7 @@
 
 case $# in
 1)
-if [ -d "$1" ] && [ -f "$1"/Tests/load.sql ] && [ -f 
"$1"/Tests/check.SQL.py.src ]; then
+if [ -d "$1" ] && [ -f "$1"/Tests/load.sql ] && [ -f 
"$1"/Tests/check.SQL.py ]; then
cd "$1" || exit 1
 else
echo "bad argument"
@@ -14,7 +14,7 @@ 0)
 case $0 in
 */*) cd ${0%/*};;
 esac
-if [ -f Tests/load.sql ] && [ -f Tests/check.SQL.py.src ]; then
+if [ -f Tests/load.sql ] && [ -f Tests/check.SQL.py ]; then
:
 else
echo "bad directory"
diff --git a/sql/test/lateral/Tests/lateral.sql 
b/sql/test/lateral/Tests/lateral.sql
--- a/sql/test/lateral/Tests/lateral.sql
+++ b/sql/test/lateral/Tests/lateral.sql
@@ -36,12 +36,12 @@ INSERT INTO employees VALUES (7566,'JONE
 INSERT INTO employees VALUES 
(7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-'),1250,1400,30);
 INSERT INTO employees VALUES 
(7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-'),2850,NULL,30);
 INSERT INTO employees VALUES 
(7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-'),2450,NULL,10);
---INSERT INTO employees VALUES 
(7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87','dd-mm-rr')-85,3000,NULL,20);
-INSERT INTO employees VALUES 
(7788,'SCOTT','ANALYST',7566,to_date('13-6-87','dd-mm-rr')-85,3000,NULL,20);
+--INSERT INTO employees VALUES 
(7788,'SCOTT','ANALYST',7566,to_date('13-JUL-1987','dd-mm-rr')-85,3000,NULL,20);
+INSERT INTO employees VALUES 
(7788,'SCOTT','ANALYST',7566,to_date('13-6-1987','dd-mm-rr')-85,3000,NULL,20);
 INSERT INTO employees VALUES 
(7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-'),5000,NULL,10);
 INSERT INTO employees VALUES 
(7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-'),1500,0,30);
---INSERT INTO employees VALUES (7876,'ADAMS','CLERK',7788,to_date('13-JUL-87', 
'dd-mm-rr')-51,1100,NULL,20);
-INSERT INTO employees VALUES (7876,'ADAMS','CLERK',7788

MonetDB: default - Merge with Dec2016 branch.

2017-02-16 Thread Panagiotis Koutsourakis
Changeset: 4a10daae5a7d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a10daae5a7d
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
libversions
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (143 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -649,3 +649,5 @@ ea0fe76e0095771bccca626b39e3e839a90ba320
 afc859894553ef804cded49a83b035d9d2cda73b Dec2016_release
 bf4b58d202645774b75c7f508c84b30e3be78a49 Dec2016_5
 bf4b58d202645774b75c7f508c84b30e3be78a49 Dec2016_SP1_release
+3968ed7fb6dab04a2530c6c3e1a5ffd6d649298b Dec2016_7
+3968ed7fb6dab04a2530c6c3e1a5ffd6d649298b Dec2016_SP2_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -124,7 +124,7 @@ Vendor: MonetDB BV 
 Group: Applications/Databases
 License: MPLv2.0
 URL: http://www.monetdb.org/
-Source: 
http://dev.monetdb.org/downloads/sources/Dec2016-SP1/%{name}-%{version}.tar.bz2
+Source: 
http://dev.monetdb.org/downloads/sources/Dec2016-SP2/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
@@ -962,6 +962,49 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Thu Feb 16 2017 Panagiotis Koutsourakis  - 
11.25.7-20170216
+- Rebuilt.
+- BZ#4034: argnames array in rapi.c has fixed length (that was too short)
+- BZ#6080: mserver5: rel_bin.c:2391: rel2bin_project: Assertion `0'
+  failed.
+- BZ#6081: Segmentation fault (core dumped)
+- BZ#6082: group.subgroup is undefined if group by is used on an
+  expression involving only constants
+- BZ#6111: Maximum number of digits for hge decimal is listed as 39 in
+  sys.types. Should be 38 as DECIMAL(39) is not supported.
+- BZ#6112: Crash upgrading Jul2015->Jun2016
+- BZ#6130: Query rewriter crashes on a NULL pointer when having a
+  correlated subquery
+- BZ#6133: A crash occurs when preparing an INSERT on joined tables
+  during the query semantic phase
+- BZ#6141: Getting an error message regarding a non-GROUP-BY column
+  rather than an unknown identifier
+- BZ#6177: Server crashes
+- BZ#6186: Null casting causes no results (silent server crash?)
+- BZ#6189: Removing a NOT NULL constraint from a PKey column should NOT
+  be allowed
+- BZ#6190: CASE query crashes database
+- BZ#6191: MT_msync failed with "Cannot allocate memory"
+- BZ#6192: Numeric column stores wrong values after adding large numbers
+- BZ#6193: converting to a smaller precision (fewer or no decimals after
+  decimal point) should round/truncate consistently
+- BZ#6194: splitpart returns truncated last part if it contains non
+  ascii caracters
+- BZ#6195: Cast from huge decimal type to smaller returns wrong results
+- BZ#6196: Database crashes after generate_series query
+- BZ#6198: COALESCE could be more optimized
+- BZ#6201: MonetDB completely giving up on certain queries - no error
+  and no result
+- BZ#6202: querying a table with an ordered index on string/varchar
+  column crashes server and makes server unrestartable!
+- BZ#6203: copy into: Failed to import table Leftover data 'False'
+- BZ#6205: Integer addition overflow
+- BZ#6206: casting strings with more than one trailing zero ('0') to
+  decimal goes wrong
+- BZ#6209: Aggregation over complex OR expressions produce wrong results
+- BZ#6210: Upgrading a database from Jun2015 or older crashes the server
+- BZ#6213: SQLsmith causes server to crash
+
 * Fri Jan 13 2017 Panagiotis Koutsourakis  - 
11.25.5-20170113
 - Rebuilt.
 - BZ#4039: Slow mserver5 start after drop of tables (> 1 hour)
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,49 @@
+monetdb (11.25.7) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#4034: argnames array in rapi.c has fixed length (that was too short)
+  * BZ#6080: mserver5: rel_bin.c:2391: rel2bin_project: Assertion `0'
+failed.
+  * BZ#6081: Segmentation fault (core dumped)
+  * BZ#6082: group.subgroup is undefined if group by is used on an
+expression involving only constants
+  * BZ#6111: Maximum number of digits for hge decimal is listed as 39 in
+sys.types. Should be 38 as DECIMAL(39) is not supported.
+  * BZ#6112: Crash upgrading Jul2015->Jun2016
+  * BZ#6130: Query rewriter crashes on a NULL pointer when having a
+correlated subquery
+  * BZ#6133: A crash occurs when preparing an INSERT on joined tables
+during the query semantic phase
+  * BZ#6141: Getting an error message regarding a non-GROUP-BY column
+rather than an unknown identifier
+  * BZ#6177: Server crashes
+  * BZ#6186: Null casting causes no results (silent server crash?)
+  * BZ#6189: Removing a NOT NULL constraint from a PKey column should NOT
+be allowed
+  * BZ#6190: CASE query crashes database
+  * BZ#6191: MT_msync failed with "Cannot allocate memory"
+  * BZ#6192: Numeric column stores wrong values after adding large numbers
+  * BZ#6193: converting to a smaller pre

MonetDB: default - Merge with Dec2016 branch.

2017-02-16 Thread Sjoerd Mullender
Changeset: 1542e2ce8126 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1542e2ce8126
Added Files:
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Windows
Removed Files:
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.32bit
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.int128
Modified Files:
monetdb5/mal/mal_resource.h
sql/backends/monet5/sql.c
sql/test/BugTracker-2016/Tests/storagemodel.sql
sql/test/BugTracker-2016/Tests/storagemodel.stable.err
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 470 to 300 lines):

diff --git a/monetdb5/mal/mal_resource.h b/monetdb5/mal/mal_resource.h
--- a/monetdb5/mal/mal_resource.h
+++ b/monetdb5/mal/mal_resource.h
@@ -18,7 +18,7 @@
 
 //#define heapinfo(X,Id)   (((X) && (X)->base && ((X)->parentid == 0 || 
(X)->parentid == Id)) ? (X)->free : 0)
 #define heapinfo(X,Id) (((X) && (X)->base ) ? (X)->free : 0)
-#define hashinfo(X,Id) ( (X)? heapinfo((X)->heap, Id):0)
+#define hashinfo(X,Id) ((X) && (X) != (Hash *) 1 ? heapinfo((X)->heap, Id) : 0)
 
 #define USE_MAL_ADMISSION
 #ifdef USE_MAL_ADMISSION
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
@@ -4038,7 +4038,7 @@ sql_storage(Client cntxt, MalBlkPtr mb, 
bitval 
= bit_nil;
BUNappend(key, 
&bitval, FALSE);
 
-   sz = 
bn->torderidx ? bn->torderidx->free : 0;
+   sz = 
bn->torderidx && bn->torderidx != (Heap *) 1 ? bn->torderidx->free : 0;
BUNappend(oidx, 
&sz, FALSE);

BBPunfix(bn->batCacheid);
}
@@ -4126,7 +4126,7 @@ sql_storage(Client cntxt, MalBlkPtr mb, 
if 
(!bitval && bn->tnokey[0] == 0 && bn->tnokey[1] == 0)

bitval = bit_nil;

BUNappend(key, &bitval, FALSE);
-   sz = 
bn->torderidx ? bn->torderidx->free : 0;
+   sz = 
bn->torderidx && bn->torderidx != (Heap *) 1 ? bn->torderidx->free : 0;

BUNappend(oidx, &sz, FALSE);

BBPunfix(bn->batCacheid);
}
diff --git a/sql/test/BugTracker-2016/Tests/storagemodel.sql 
b/sql/test/BugTracker-2016/Tests/storagemodel.sql
--- a/sql/test/BugTracker-2016/Tests/storagemodel.sql
+++ b/sql/test/BugTracker-2016/Tests/storagemodel.sql
@@ -12,17 +12,19 @@ select * from storagemodel() where "tabl
 
 drop table bug3923;
 
-crate schema bug3923schema;
+
+create schema bug3923schema;
+set schema bug3923schema;
 create table bug3923(i integer);
 
 -- skip columns location, count, columnsize.
-select "schema", "table", "column", "type", "mode", typewidth, hashes, phash, 
imprints, sorted from storage('sys','_tables');
+select "schema", "table", "column", "type", "mode", typewidth, hashes, phash, 
imprints, sorted from sys.storage('sys','_tables');
 
-call storagemodelinit();
-update storagemodelinput set "count" =1 where "table" ='bug3923';
-update storagemodelinput set "distinct" =10 where "table" ='bug3923' and 
"column" ='i';
+call sys.storagemodelinit();
+update sys.storagemodelinput set "count" =1 where "table" ='bug3923';
+update sys.storagemodelinput set "distinct" =10 where "table" ='bug3923' and 
"column" ='i';
 
-select * from storagemodel() where "table" = 'bug3923';
+select * from sys.storagemodel() where "table" = 'bug3923';
 
 drop table bug3923;
 
diff --git a/sql/test/BugTracker-2016/Tests/storagemodel.stable.err 
b/sql/test/BugTracker-2016/Tests/storagemodel.stable.err
--- a/sql/test/BugTracker-2016/Tests/storagemodel.stable.err
+++ b/sql/test/BugTracker-2016/Tests/storagemodel.stable.err
@@ -28,9 +28,6 @@ stderr of test 'storagemodel` in directo
 # 23:38:44 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21747" "--port=30783"
 # 23:38:44 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-545/.s.monetdb.36257
-QUERY = crate schema bug3923schema;
-ERROR = !syntax error, unexpected IDENT in: "crate"
 
 # 23:38:44 >  
 # 23:38:44 >  "Done."
diff --git a/sql/test/BugTracker-2016/Tests/storagem

MonetDB: default - Merge with Dec2016 branch.

2017-02-17 Thread Sjoerd Mullender
Changeset: ec2096728c7a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec2096728c7a
Modified Files:
gdk/gdk_aggr.c
gdk/gdk_imprints.c
gdk/gdk_interprocess.c
gdk/gdk_logger.c
gdk/gdk_search.c
gdk/gdk_select.c
gdk/gdk_utils.c
tools/merovingian/daemon/connections.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (263 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2416,9 +2416,13 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
/* there is a candidate list, replace b (and g, if
 * given) with just the values we're interested in */
b = BATproject(s, b);
+   if (b == NULL)
+   return NULL;
freeb = 1;
if (g) {
g = BATproject(s, g);
+   if (g == NULL)
+   goto bunins_failed;
freeg = 1;
}
}
@@ -2436,7 +2440,8 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
BBPunfix(g->batCacheid);
return bn;
}
-   BATsort(&t1, &t2, NULL, g, NULL, NULL, 0, 0);
+   if (BATsort(&t1, &t2, NULL, g, NULL, NULL, 0, 0) != GDK_SUCCEED)
+   goto bunins_failed;
if (freeg)
BBPunfix(g->batCacheid);
g = t1;
@@ -2444,7 +2449,11 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
} else {
t2 = NULL;
}
-   BATsort(&t1, NULL, NULL, b, t2, g, 0, 0);
+   if (BATsort(&t1, NULL, NULL, b, t2, g, 0, 0) != GDK_SUCCEED) {
+   if (t2)
+   BBPunfix(t2->batCacheid);
+   goto bunins_failed;
+   }
if (freeb)
BBPunfix(b->batCacheid);
b = t1;
@@ -2454,7 +2463,7 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
 
bn = COLnew(g ? min : 0, b->ttype, ngrp, TRANSIENT);
if (bn == NULL)
-   return NULL;
+   goto bunins_failed;
 
bi = bat_iterator(b);
nil = ATOMnilptr(b->ttype);
@@ -2511,7 +2520,8 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
}
index = (BUN) (r + (p-r-1) * quantile);
v = BUNtail(bi, index);
-   BUNappend(bn, v, FALSE);
+   if (BUNappend(bn, v, FALSE) != GDK_SUCCEED)
+   goto bunins_failed;
nils += (*atomcmp)(v, nil) == 0;
}
 
@@ -2532,7 +2542,8 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
BBPunfix(b->batCacheid);
if (freeg)
BBPunfix(g->batCacheid);
-   BBPunfix(bn->batCacheid);
+   if (bn)
+   BBPunfix(bn->batCacheid);
return NULL;
 }
 
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -309,6 +309,7 @@ BATimprints(BAT *b)
bat p = VIEWtparent(b);
o = b;
b = BATdescriptor(p);
+   assert(b);
if (BATcheckimprints(b)) {
BBPunfix(b->batCacheid);
return GDK_SUCCEED;
diff --git a/gdk/gdk_interprocess.c b/gdk/gdk_interprocess.c
--- a/gdk/gdk_interprocess.c
+++ b/gdk/gdk_interprocess.c
@@ -81,6 +81,9 @@ GDKinitmmap(size_t id, size_t size, void
int fd;
int mod = MMAP_READ | MMAP_WRITE | MMAP_SEQUENTIAL | MMAP_SYNC | 
MAP_SHARED;
char *path = NULL;
+
+   assert(return_ptr != NULL);
+
GDKmmapfile(address, 100, id);
 
/* round up to multiple of GDK_mmap_pagesize with a
@@ -109,9 +112,7 @@ GDKinitmmap(size_t id, size_t size, void
goto cleanup;
}
GDKfree(path);
-   if (return_ptr != NULL) {
-   *return_ptr = ptr;
-   }
+   *return_ptr = ptr;
if (return_size != NULL) {
*return_size = size;
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1128,6 +1128,9 @@ bm_tids(BAT *b, BAT *d)
BUN sz = BATcount(b);
BAT *tids = COLnew(0, TYPE_void, 0, TRANSIENT);
 
+   if (tids == NULL)
+   return NULL;
+
BATtseqbase(tids, 0);
BATsetcount(tids, sz);
tids->trevsorted = 0;
@@ -1217,11 +1220,23 @@ bm_subcommit(logger *lg, BAT *list_bid, 
n[i++] = catalog_bid->batCacheid;
n[i++] = catalog_nme->batCacheid;
n[i++] = dcatalog->batCacheid;
-   if (BATcount(dcatalog) > (BATcount(catalog_nme)/2) && catalog_bid == 
list_bid && catalog_nme == list_nme && lg->catalog_bid == catalog_bid) {
-   BAT *bids, *nmes, *tids = bm_tids(catalog_bid, dcatalog);
+   if (BATcount(dcatalog) > (BATcount(catalog_nme)/2) &&
+   catalog_bid == list_bid &&
+   catalog_nme

MonetDB: default - Merge with Dec2016 branch.

2017-02-17 Thread Sjoerd Mullender
Changeset: 7157f1299a6b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7157f1299a6b
Added Files:
sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.sql
sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.err
sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out
Modified Files:
gdk/gdk_aggr.c
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (206 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2482,24 +2482,22 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
assert(r < p);
if ( p == q || grps[p] != prev) {
BUN qindex;
-   if (skip_nils) {
+   if (skip_nils && !b->tnonil) {
while (r < p && (*atomcmp)(BUNtail(bi, 
r), nil) == 0)
r++;
-   if (r == p)
-   break;
}
-   while (BATcount(bn) < prev - min) {
-   bunfastapp_nocheck(bn, BUNlast(bn),
-  nil, Tsize(bn));
+   if (r == p) {
+   v = nil;
nils++;
+   } else {
+   qindex = (BUN) (r + (p-r-1) * quantile);
+   /* be a little paranoid about the index 
*/
+   assert(qindex >= r);
+   assert(qindex <  p);
+   v = BUNtail(bi, qindex);
+   nils += (*atomcmp)(v, nil) == 0;
}
-   qindex = (BUN) (r + (p-r-1) * quantile);
-   /* be a little paranoid about the index */
-   assert(qindex >= r);
-   assert(qindex <  p);
-   v = BUNtail(bi, qindex);
bunfastapp_nocheck(bn, BUNlast(bn), v, 
Tsize(bn));
-   nils += (*atomcmp)(v, nil) == 0;
 
r = p;
if (p < q)
diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -26,3 +26,4 @@ sqlsmith03
 sqlsmith04
 nested_with.Bug-6187
 prepare.Bug-6133
+null-quantile.Bug-6218
diff --git a/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.sql 
b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.sql
@@ -0,0 +1,15 @@
+start transaction;
+
+create table bug6218 (i int, j int);
+copy 8 records into bug6218 from stdin;
+0|0
+1|0
+NULL|1
+NULL|1
+0|2
+1|2
+2|0
+2|2
+select quantile(i,0.5),j from bug6218 group by j order by j;
+
+rollback;
diff --git a/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.err 
b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.err
@@ -0,0 +1,36 @@
+stderr of test 'null-quantile.Bug-6218` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 12:42:35 >  
+# 12:42:35 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34225" "--set" 
"mapi_usock=/var/tmp/mtest-8842/.s.monetdb.34225" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2017" 
"--set" "embedded_r=yes" "--set" "embedded_py=true"
+# 12:42:35 >  
+
+# builtin opt  gdk_dbpath = /ufs/sjoerd/Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 34225
+# cmdline opt  mapi_usock = /var/tmp/mtest-8842/.s.monetdb.34225
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2017
+# cmdline opt  embedded_r = yes
+# cmdline opt  embedded_py = true
+# cmdline opt  gdk_debug = 536870922
+
+# 12:42:36 >  
+# 12:42:36 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-8842" "--port=34

MonetDB: default - Merge with Dec2016 branch.

2017-02-20 Thread Sjoerd Mullender
Changeset: 1f48e877596d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1f48e877596d
Modified Files:
gdk/gdk_logger.c
gdk/gdk_project.c
geom/monetdb5/geom.c
geom/monetdb5/geomBulk.c
geom/monetdb5/geom_upgrade.c
monetdb5/mal/mal_authorize.c
monetdb5/modules/kernel/aggr.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_statistics.c
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/storage/bat/bat_storage.c
sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
sql/test/emptydb-upgrade/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.32bit
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1238 to 300 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1227,18 +1227,27 @@ bm_subcommit(logger *lg, BAT *list_bid, 
BAT *bids, *nmes, *tids;
 
tids = bm_tids(catalog_bid, dcatalog);
-   bids = logbat_new(TYPE_int, BATSIZE, PERSISTENT);
-   nmes = logbat_new(TYPE_str, BATSIZE, PERSISTENT);
-   if (tids == NULL || bids == NULL || nmes == NULL) {
-   if (tids)
-   BBPunfix(tids->batCacheid);
-   BBPreclaim(bids);
-   BBPreclaim(nmes);
+   if (tids == NULL) {
GDKfree(n);
return GDK_FAIL;
}
-   BATappend(bids, catalog_bid, tids, TRUE);
-   BATappend(nmes, catalog_nme, tids, TRUE);
+   bids = logbat_new(TYPE_int, BATcount(tids), PERSISTENT);
+   nmes = logbat_new(TYPE_str, BATcount(tids), PERSISTENT);
+   if (bids == NULL || nmes == NULL) {
+   logbat_destroy(tids);
+   logbat_destroy(bids);
+   logbat_destroy(nmes);
+   GDKfree(n);
+   return GDK_FAIL;
+   }
+   if (BATappend(bids, catalog_bid, tids, TRUE) != GDK_SUCCEED ||
+   BATappend(nmes, catalog_nme, tids, TRUE) != GDK_SUCCEED) {
+   logbat_destroy(tids);
+   logbat_destroy(bids);
+   logbat_destroy(nmes);
+   GDKfree(n);
+   return GDK_FAIL;
+   }
logbat_destroy(tids);
BATclear(dcatalog, TRUE);
 
diff --git a/gdk/gdk_project.c b/gdk/gdk_project.c
--- a/gdk/gdk_project.c
+++ b/gdk/gdk_project.c
@@ -747,6 +747,7 @@ BATprojectchain(BAT **bats)
return bn;
 
   bunins_failed:
+   GDKfree(ba);
BBPreclaim(bn);
return NULL;
 }
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -464,7 +464,7 @@ wkbTransform(wkb **transformedWKB, wkb *
ret = createException(MAL, "geom.Transform", "Unknown geometry 
type");
}
 
-   if (transformedGeosGeometry) {
+   if (ret == MAL_SUCCEED && transformedGeosGeometry) {
/* set the new srid */
GEOSSetSRID(transformedGeosGeometry, *srid_dst);
/* get the wkb */
@@ -2670,7 +2670,7 @@ wkbMLineStringToPolygon(wkb **geomWKB, s
}
 
//all remaining should be internal
-   internalGeometries = GDKmalloc((itemsNum - 1) * sizeof(GEOSGeom 
*));
+   internalGeometries = GDKmalloc((itemsNum - 1) * 
sizeof(GEOSGeom));
if (internalGeometries == NULL) {
GEOSGeom_destroy(linearRingExternalGeometry);
ret = createException(MAL, "geom.MLineStringToPolygon", 
MAL_MALLOC_FAIL);
@@ -2730,8 +2730,8 @@ wkbMLineStringToPolygon(wkb **geomWKB, s
 
GEOSGeom_destroy(finalGeometry);
 
-   throw(MAL, "geom.MLineStringToPolygon", "The provided 
MultiLineString does not create a valid Polygon");
-
+   ret = createException(MAL, "geom.MLineStringToPolygon", 
"The provided MultiLineString does not create a valid Polygon");
+   goto bailout;
}
 
GEOSSetSRID(finalGeometry, *srid);
@@ -3047,6 +3047,7 @@ wkbMakePolygon(wkb **out, wkb **external
GEOSGeom geosGeometry, externalGeometry, linearRingGeometry;
bit closed = 0;
GEOSCoordSeq coordSeq_copy;
+   str err;
 
if (wkb_isnil(*external) || *srid == int_nil) {
if ((*out = wkbNULLcopy()) == NULL)
@@ -3065,7 +3066,10 @@ wkbMakePolygon(wkb **out, wkb **external
throw(MAL, "geom.Polygon", "Geometries should be LineString");
}
//check whether the linestring is closed
-   wkbIsClosed(&closed, external);
+   if ((err = wkbIsClosed(&clos

MonetDB: default - Merge with Dec2016 branch.

2017-02-22 Thread Sjoerd Mullender
Changeset: 9c8d67da017d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c8d67da017d
Added Files:
monetdb5/modules/kernel/Tests/select.malC
monetdb5/modules/kernel/Tests/select.stable.err
monetdb5/modules/kernel/Tests/select.stable.out
Modified Files:
gdk/gdk_logger.c
gdk/gdk_select.c
monetdb5/modules/kernel/Tests/All
monetdb5/modules/mal/Tests/orderidx01.malC
monetdb5/modules/mal/Tests/orderidx02.malC
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/backends/monet5/generator/generator.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/vaults/netcdf/netcdf.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_utils.c
sql/storage/bat/res_table.c

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 3631 to 300 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1598,6 +1598,8 @@ logger_load(int debug, const char *fn, c
logger_fatal("Logger_new: inconsistent 
database, snapshots_tid does not exist", 0, 0, 0);
} else {
lg->dsnapshots = logbat_new(TYPE_oid, 1, PERSISTENT);
+   if (lg->dsnapshots == NULL)
+   logger_fatal("Logger_new: cannot create 
dsnapshot bat", 0, 0, 0);
snprintf(bak, sizeof(bak), "%s_dsnapshots", fn);
if (BBPrename(lg->dsnapshots->batCacheid, bak) < 0)
logger_fatal("Logger_new: BBPrename to %s 
failed", bak, 0, 0);
@@ -2513,6 +2515,9 @@ bm_commit(logger *lg)
BAT *n = logbat_new(TYPE_str, BATcount(lg->freed), TRANSIENT);
gdk_return res;
 
+   if (n == NULL)
+   return LOG_ERR;
+
/* subcommit the freed bats */
if (BATcount(lg->freed)) {
 
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1275,14 +1275,13 @@ BATselect(BAT *b, BAT *s, const void *tl
equi = th == NULL || (lval && ATOMcmp(t, tl, th) == 0); /* point 
select? */
if (equi) {
assert(lval);
-   hi = li;
+   if (th == NULL)
+   hi = li;
th = tl;
hval = 1;
} else {
hval = ATOMcmp(t, th, nil) != 0;
}
-   if (!equi && !lval && !hval && lnil) 
-   anti = !anti;
if (anti) {
if (lval != hval) {
/* one of the end points is nil and the other
@@ -1857,7 +1856,7 @@ BATthetaselect(BAT *b, BAT *s, const voi
nil = ATOMnilptr(b->ttype);
if (ATOMcmp(b->ttype, val, nil) == 0)
return newempty();
-   if (op[0] == '=' && ((op[1] == '=' && op[2] == 0) || op[2] == 0)) {
+   if (op[0] == '=' && ((op[1] == '=' && op[2] == 0) || op[1] == 0)) {
/* "=" or "==" */
return BATselect(b, s, val, NULL, 1, 1, 0);
}
diff --git a/monetdb5/modules/kernel/Tests/All 
b/monetdb5/modules/kernel/Tests/All
--- a/monetdb5/modules/kernel/Tests/All
+++ b/monetdb5/modules/kernel/Tests/All
@@ -2,3 +2,4 @@ time01
 TriBool
 batstr
 math
+select
diff --git a/monetdb5/modules/kernel/Tests/select.malC 
b/monetdb5/modules/kernel/Tests/select.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/kernel/Tests/select.malC
@@ -0,0 +1,1010 @@
+b := bat.new(:int);
+bat.append(b, 7);
+bat.append(b, 6);
+bat.append(b, 8);
+bat.append(b, nil:int);
+bat.append(b, 9);
+bat.append(b, 5);
+bat.append(b, 0);
+bat.append(b, 3);
+bat.append(b, 2);
+bat.append(b, 1);
+bat.append(b, 4);
+s := algebra.sort(b, false, true);
+r := algebra.sort(b, true, true);
+bat.setAccess(b, "r");
+bat.setAccess(s, "r");
+bat.setAccess(r, "r");
+
+# if tl and th are both nil, and li and hi are both true,
+# algebra.select translates th to NULL
+
+x := algebra.select(b, nil:int, nil:int, true, true, false);
+z := algebra.projection(x, b);
+z := algebra.sort(z, false, true);
+io.print(z);# nil
+io.print("nil");
+x := algebra.select(b, nil:int, nil:int, true, false, false);
+z := algebra.projection(x, b);
+z := algebra.sort(z, false, true);
+io.print(z);# 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
+x := algebra.select(b, nil:int, nil:int, false, true, false);
+z := algebra.projection(x, b);
+z := algebra.sort(z, false, true);
+io.print(z);

MonetDB: default - Merge with Dec2016 branch.

2017-02-22 Thread Sjoerd Mullender
Changeset: 0ab7a2e3483f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ab7a2e3483f
Modified Files:
monetdb5/mal/mal_import.c
monetdb5/tools/Tests/mserver5--help.stable.err
monetdb5/tools/Tests/mserver5--help.stable.err.Windows
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/common/sql_hash.c
sql/common/sql_list.c
sql/server/rel_exp.c
sql/storage/sql_catalog.c
tools/mserver/mserver5.c
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 414 to 300 lines):

diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -222,7 +222,7 @@ malInclude(Client c, str name, int listi
parseMAL(c, c->curprg, 1);
bstream_destroy(c->fdin);
} else {
-   GDKfree(s); // not interested in error here
+   freeException(s); // not interested in error 
here
s = MAL_SUCCEED;
}
if (p)
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err 
b/monetdb5/tools/Tests/mserver5--help.stable.err
--- a/monetdb5/tools/Tests/mserver5--help.stable.err
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err
@@ -34,7 +34,6 @@ The debug, testing & trace options:
  --optimizers
  --trace
  --forcemito
- --recycler
  --debug=
 
 # 10:03:11 >  
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows 
b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
--- a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
@@ -29,7 +29,6 @@ The debug, testing & trace options:
  --optimizers
  --trace
  --forcemito
- --recycler
  --debug=
 
 # 10:03:11 >  
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
@@ -64,12 +64,19 @@ list_find_column(backend *be, list *l, c
MT_lock_set(&l->ht_lock);
if (!l->ht && list_length(l) > HASH_MIN_SIZE) {
l->ht = hash_new(l->sa, MAX(list_length(l), l->expected_cnt), 
(fkeyvalue)&stmt_key);
+   if (l->ht == NULL) {
+   MT_lock_unset(&l->ht_lock);
+   return NULL;
+   }
 
for (n = l->h; n; n = n->next) {
const char *nme = column_name(be->mvc->sa, n->data);
int key = hash_key(nme);
 
-   hash_add(l->ht, key, n->data);
+   if (hash_add(l->ht, key, n->data) == NULL) {
+   MT_lock_unset(&l->ht_lock);
+   return NULL;
+   }
}
}
if (l->ht) {
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -2863,84 +2863,92 @@ stmt_alias(backend *be, stmt *op1, const
 sql_subtype *
 tail_type(stmt *st)
 {
-   switch (st->type) {
-   case st_const:
-   return tail_type(st->op2);
-
-   case st_uselect:
-   case st_uselect2:
-   case st_limit:
-   case st_limit2:
-   case st_sample:
-   case st_tunion:
-   case st_tdiff:
-   case st_tinter:
-   case st_append:
-   case st_alias:
-   case st_gen_group:
-   case st_order:
-   return tail_type(st->op1);
-
-   case st_list:
-   return tail_type(st->op4.lval->h->data);
-
-   case st_bat:
-   return &st->op4.cval->type;
-   case st_idxbat:
-   if (hash_index(st->op4.idxval->type)) {
+   for (;;) {
+   switch (st->type) {
+   case st_const:
+   st = st->op2;
+   continue;
+
+   case st_uselect:
+   case st_uselect2:
+   case st_limit:
+   case st_limit2:
+   case st_sample:
+   case st_tunion:
+   case st_tdiff:
+   case st_tinter:
+   case st_append:
+   case st_alias:
+   case st_gen_group:
+   case st_order:
+   st = st->op1;
+   continue;
+
+   case st_list:
+   st = st->op4.lval->h->data;
+   continue;
+
+   case st_bat:
+   return &st->op4.cval->type;
+   case st_idxbat:
+   if (hash_index(st->op4.idxval->type)) {
+   return sql_bind_localtype("lng");
+   } else if (st->op4.idxval->type == join

MonetDB: default - Merge with Dec2016 branch.

2017-02-24 Thread Sjoerd Mullender
Changeset: f287b734e603 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f287b734e603
Added Files:
sql/test/BugTracker-2017/Tests/real-power.Bug-6228.sql
sql/test/BugTracker-2017/Tests/real-power.Bug-6228.stable.err
sql/test/BugTracker-2017/Tests/real-power.Bug-6228.stable.out
Modified Files:
monetdb5/optimizer/opt_support.c
sql/backends/monet5/Tests/All
sql/backends/monet5/Tests/pyloader06.stable.out
sql/backends/monet5/Tests/pyloader07.stable.out
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/sql_scenario.c
sql/server/rel_exp.c
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (251 lines):

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
@@ -143,8 +143,10 @@ optimizeMALBlock(Client cntxt, MalBlkPtr
msg = (str) (*p->fcn) (cntxt, mb, 0, p);
if (msg) {
str place = getExceptionPlace(msg);
-   msg= 
createException(getExceptionType(msg), place, "%s", getExceptionMessage(msg));
+   str nmsg= 
createException(getExceptionType(msg), place, "%s", getExceptionMessage(msg));
GDKfree(place);
+   GDKfree(msg);
+   msg = nmsg;
goto wrapup;
}
if (cntxt->mode == FINISHCLIENT)
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -61,6 +61,7 @@ HAVE_LIBPY?pyloader04
 HAVE_LIBPY?pyloader05
 HAVE_LIBPY?pyloader06
 HAVE_LIBPY?pyloader07
+HAVE_LIBPY?pyloader08
 
 HAVE_LIBPY?createorreplace
 
diff --git a/sql/backends/monet5/Tests/pyloader06.stable.out 
b/sql/backends/monet5/Tests/pyloader06.stable.out
--- a/sql/backends/monet5/Tests/pyloader06.stable.out
+++ b/sql/backends/monet5/Tests/pyloader06.stable.out
@@ -73,7 +73,7 @@ Ready.
 #SELECT * FROM pyloader06table;
 % sys.pyloader06table, sys.pyloader06table,sys.pyloader06table # table_name
 % a,   c,  b # name
-% int, int,int # type
+% bigint,  bigint, bigint # type
 % 1,   1,  1 # length
 [ 1,   3,  2   ]
 #ROLLBACK;
diff --git a/sql/backends/monet5/Tests/pyloader07.stable.out 
b/sql/backends/monet5/Tests/pyloader07.stable.out
--- a/sql/backends/monet5/Tests/pyloader07.stable.out
+++ b/sql/backends/monet5/Tests/pyloader07.stable.out
@@ -69,7 +69,7 @@ Ready.
 #SELECT * FROM pyloader07table;
 % sys.pyloader07table, sys.pyloader07table # table_name
 % s,   t # name
-% int, int # type
+% bigint,  bigint # type
 % 2,   2 # length
 [ 33,  42  ]
 #DROP TABLE pyloader07table;
diff --git a/sql/backends/monet5/UDF/pyapi/emit.c 
b/sql/backends/monet5/UDF/pyapi/emit.c
--- a/sql/backends/monet5/UDF/pyapi/emit.c
+++ b/sql/backends/monet5/UDF/pyapi/emit.c
@@ -142,7 +142,22 @@ PyEmit_Emit(PyEmitObject *self, PyObject
 }
 if (!found) {
 // unrecognized column, create the column in the table
-self->cols[self->ncols].b = COLnew(0, TYPE_int, 0, TRANSIENT);
+// first infer the type from the value
+// we use NumPy for this by creating an array from the object
+// without specifying the type
+PyObject* value = PyDict_GetItem(args, key);
+PyObject* array = PyArray_FromAny(value, NULL, 0, 0, 
NPY_ARRAY_CARRAY | NPY_ARRAY_FORCECAST, NULL);
+PyArray_Descr* array_type = NULL;
+int bat_type = TYPE_int;
+if (!array) {
+PyErr_Format(PyExc_TypeError, "Failed to create NumPy 
array.");
+return NULL;
+}
+array_type = (PyArray_Descr*) 
PyArray_DESCR((PyArrayObject*)array);
+bat_type = PyType_ToBat(array_type->type_num);
+Py_DECREF(array);
+
+self->cols[self->ncols].b = COLnew(0, bat_type, 0, TRANSIENT);
 self->cols[self->ncols].name = GDKstrdup(val);
 if (self->nvals > 0) {
 // insert NULL values up until the current entry
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
@@ -1146,7 +1146,7 @@ SQLparser(Client c)
 
/* in case we had produced a non-cachable plan, the optimizer 
should be called */
if (opt ) {
-   str msg = SQLoptimizeQuery(c, c->curprg->def);
+   msg = SQLoptimizeQuery

MonetDB: default - Merge with Dec2016 branch.

2017-02-27 Thread Panagiotis Koutsourakis
Changeset: 78b7b9f8a0b9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78b7b9f8a0b9
Modified Files:
.hgtags
MonetDB.spec
debian/changelog
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (44 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -651,3 +651,6 @@ bf4b58d202645774b75c7f508c84b30e3be78a49
 bf4b58d202645774b75c7f508c84b30e3be78a49 Dec2016_SP1_release
 3968ed7fb6dab04a2530c6c3e1a5ffd6d649298b Dec2016_7
 3968ed7fb6dab04a2530c6c3e1a5ffd6d649298b Dec2016_SP2_release
+615229dc6f3c7dc89bbd9cc5923ad307b4c93cb1 Dec2016_9
+3968ed7fb6dab04a2530c6c3e1a5ffd6d649298b Dec2016_SP2_release
+615229dc6f3c7dc89bbd9cc5923ad307b4c93cb1 Dec2016_SP2_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -944,6 +944,13 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Mon Feb 27 2017 Panagiotis Koutsourakis  - 
11.25.9-20170227
+- Rebuilt.
+- BZ#6217: Segfault in rel_optimizer (sqlsmith)
+- BZ#6218: grouped quantiles with all null group causes following groups
+  to return null
+- BZ#6224: mal_parser: cannot refer to types containing an underscore
+
 * Thu Feb 16 2017 Panagiotis Koutsourakis  - 
11.25.7-20170216
 - Rebuilt.
 - BZ#4034: argnames array in rapi.c has fixed length (that was too short)
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+monetdb (11.25.9) unstable; urgency=low
+
+  * Rebuilt.
+  * BZ#6217: Segfault in rel_optimizer (sqlsmith)
+  * BZ#6218: grouped quantiles with all null group causes following groups
+to return null
+  * BZ#6224: mal_parser: cannot refer to types containing an underscore
+
+ -- Panagiotis Koutsourakis   Mon, 27 Feb 2017 
11:15:08 +0100
+
 monetdb (11.25.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 Dec2016 branch.

2017-03-01 Thread Sjoerd Mullender
Changeset: f054b7310be7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f054b7310be7
Added Files:
monetdb5/modules/atoms/Tests/strappend.malC
monetdb5/modules/atoms/Tests/strappend.stable.err
monetdb5/modules/atoms/Tests/strappend.stable.out
Modified Files:
gdk/ChangeLog.Dec2016
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_join.c
monetdb5/mal/mal_client.c
monetdb5/modules/atoms/Tests/All
monetdb5/optimizer/opt_pipes.c
sql/backends/monet5/sql_statistics.c
Branch: default
Log Message:

Merge with Dec2016 branch.

NOTE: YOUR DATABASES THAT YOU CREATED IN THE DEFAULT BRANCH CANNOT BE
USED.

In the Dec2016 branch the BBP version number was increased in order to
fix a bug where the empty string might occur with different offsets in
a duplicate-eliminated string heap.  This conflicts with a version
number increase that had been done in the default branch.  This means
that your default databases are now incompatible with the current
code.  Dump before you build, and restore after (or simply throw them
away).


diffs (truncated from 627 to 300 lines):

diff --git a/gdk/ChangeLog.Dec2016 b/gdk/ChangeLog.Dec2016
--- a/gdk/ChangeLog.Dec2016
+++ b/gdk/ChangeLog.Dec2016
@@ -1,3 +1,12 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Tue Feb 28 2017 Sjoerd Mullender 
+- Fixed a bug when appending string bats that are fully duplicate
+  eliminated.  It could happend that the to-be-appended bat had an empty
+  string at an offset and at that same offset in the to-be-appended-to bat
+  there happened to be a (sequence of) NULL(s).  Then this offset would be
+  used, even though it might nog be the right offset for the empty string
+  in the to-be-appended-to bat.  This would result in multiple offsets for
+  the empty string, breaking the promise of being duplicate eliminated.
+
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -854,8 +854,9 @@ typedef struct {
 #define GDKLIBRARY_INSERTED061032  /* inserted and deleted in BBP.dir */
 #define GDKLIBRARY_HEADED  061033  /* head properties are stored */
 #define GDKLIBRARY_NOKEY   061034  /* nokey values can't be trusted */
-#define GDKLIBRARY_TALIGN  061035  /* talign field in BBP.dir */
-#define GDKLIBRARY 061036
+#define GDKLIBRARY_BADEMPTY061035  /* possibility of duplicate empty str */
+#define GDKLIBRARY_TALIGN  061036  /* talign field in BBP.dir */
+#define GDKLIBRARY 061037
 
 typedef struct BAT {
/* static bat properties */
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -301,10 +301,13 @@ insert_string_bat(BAT *b, BAT *n, BAT *s
}
bunfastapp(b, tp);
}
-   } else if (b->tvheap->free < n->tvheap->free / 2) {
+   } else if (b->tvheap->free < n->tvheap->free / 2 ||
+  GDK_ELIMDOUBLES(b->tvheap)) {
/* if b's string heap is much smaller than n's string
 * heap, don't bother checking whether n's string
-* values occur in b's string heap */
+* values occur in b's string heap; also, if b is
+* (still) fully double eliminated, we must continue
+* to use the double elimination mechanism */
r = BUNlast(b);
if (cand) {
oid hseq = n->hseqbase;
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -629,6 +629,287 @@ fixwkbheap(void)
 }
 #endif
 
+#ifdef GDKLIBRARY_BADEMPTY
+/* There was a bug (fixed in changeset 1f5498568a24) which could
+ * result in empty strings not being double-eliminated.  This code
+ * fixes the affected bats.
+ * Note that we only fix BATs whose string heap is still fully double
+ * eliminated. */
+static inline int
+offsearch(const int *restrict offsets, int noffsets, int val)
+{
+   /* binary search on offsets for val, return whether present */
+   int lo = 0, hi = noffsets - 1, mid;
+
+   while (hi > lo) {
+   mid = (lo + hi) / 2;
+   if (offsets[mid] == val)
+   return 1;
+   if (offsets[mid] < val)
+   lo = mid + 1;
+   else
+   hi = mid - 1;
+   }
+   return offsets[lo] == val;
+}
+
+static void
+fixstroffheap(BAT *b, int *restrict offsets)
+{
+   long_str filename;
+   Heap h1;/* old offset heap */
+   Heap h2;/* new string heap */
+   Heap h3;/* new offset heap */
+   Heap *h;/* string heap */
+   int noffsets = 0;
+   const size_t extralen = b->tvheap->hashash ? EXTRALEN : 0;
+   size_t pos;
+   var_t emptyoff = 0;
+   const char *nme, *bnme;
+   char *srcdir;
+   BUN i;
+   int 

MonetDB: default - Merge with Dec2016 branch.

2017-03-03 Thread Sjoerd Mullender
Changeset: 163ba1769943 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=163ba1769943
Modified Files:
sql/server/rel_select.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.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-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (132 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
@@ -4885,7 +4885,7 @@ rel_query(mvc *sql, sql_rel *rel, symbol
/* reset error */
sql->session->status = 0;
sql->errstr[0] = 0;
-   if (used)
+   if (used && rel)
rel = rel_dup(rel);
if (!used && (!sn->lateral && !lateral) && rel) 
{
sql_rel *o = rel;
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
@@ -24,11 +24,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-update sys.types set digits = 38 where sqlname = 'decimal' and digits = 39;
-update sys.args set type_digits = 38 where type = 'decimal' and type_digits = 
39;
-set schema "sys";
 
 # 15:26:18 >  
 # 15:26:18 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21187" "--port=38946"
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
@@ -24,11 +24,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-update sys.types set digits = 18 where sqlname = 'decimal' and digits = 19;
-update sys.args set type_digits = 18 where type = 'decimal' and type_digits = 
19;
-set schema "sys";
 
 # 15:41:19 >  
 # 15:41:19 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7576" "--port=32696"
diff --git a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -24,11 +24,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-update sys.types set digits = 38 where sqlname = 'decimal' and digits = 39;
-update sys.args set type_digits = 38 where type = 'decimal' and type_digits = 
39;
-set schema "sys";
 
 # 15:26:18 >  
 # 15:26:18 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21187" "--port=38946"
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
@@ -24,11 +24,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-update sys.types set digits = 18 where sqlname = 'decimal' and digits = 19;
-update sys.args set type_digits = 18 where type = 'decimal' and type_digits = 
19;
-set schema "sys";
 
 # 15:41:18 >  
 # 15:41:18 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7576" "--port=32696"
diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -22,11 +22,6 @@ stdout of test 'upgrade` in directory 's
 # MonetDB/R   module loaded
 
 Ready.
-Running database upgrade commands:
-set schema "sys";
-update sys.types set digits = 38 where sqlname = 'decimal' and digits = 39;
-update sys.args set type_digits = 38 where type = 'decimal' and type_digits = 
39;
-set schema "testschema";
 
 # 15:26:22 >  
 # 15:26:22 >  "/usr/bin/python2" "upgrade.SQL.py" "upgrade"
d

MonetDB: default - Merge with Dec2016 branch.

2017-03-03 Thread Sjoerd Mullender
Changeset: 0a81b81505c9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a81b81505c9
Added Files:
sql/backends/monet5/Tests/pyloader06.stable.out.Windows
sql/backends/monet5/Tests/pyloader07.stable.out.Windows
Modified Files:
sql/server/rel_select.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/dump.SQL.py
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/dump.SQL.py
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-hge/Tests/dump.SQL.py
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/dump.SQL.py
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb/Tests/testdb-dump.SQL.py
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (276 lines):

diff --git a/sql/backends/monet5/Tests/pyloader06.stable.out.Windows 
b/sql/backends/monet5/Tests/pyloader06.stable.out.Windows
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/pyloader06.stable.out.Windows
@@ -0,0 +1,89 @@
+stdout of test 'pyloader06` in directory 'sql/backends/monet5` itself:
+
+
+# 15:10:43 >  
+# 15:10:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39055" "--set" 
"mapi_usock=/var/tmp/mtest-23860/.s.monetdb.39055" "--set" "monet_prompt=" 
"--forcemito" "--dbpath=/Users/myth/opt/var/MonetDB/mTests_sql_backends_monet5" 
"--set" "embedded_r=yes" "--set" "embedded_py=true"
+# 15:10:43 >  
+
+# MonetDB 5 server v11.24.0
+# This is an unreleased version
+# Serving database 'mTests_sql_backends_monet5', using 4 threads
+# Compiled for x86_64-apple-darwin15.6.0/64bit with 128bit integers
+# Found 8.000 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2016 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on 
mapi:monetdb://dhcp-154.eduroam.cwi.nl:39055/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-23860/.s.monetdb.39055
+# MonetDB/SQL module loaded
+# MonetDB/Python module loaded
+# MonetDB/R   module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 18_index.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_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: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+
+# 15:10:44 >  
+# 15:10:44 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-23860" "--port=39055"
+# 15:10:44 >  
+
+#START TRANSACTION;
+#CREATE LOADER pyloader06() LANGUAGE PYTHON {
+#  return
+#};
+#ROLLBACK;
+#START TRANSACTION;
+#CREATE LOADER pyloader06() LANGUAGE PYTHON {
+#  return {'a': 1, 'b': 2, 'c': 3}
+#};
+#SELECT * FROM pyloader06table;
+% sys.pyloader06table, sys.pyloader06table,sys.pyloader06table # table_name
+% a,   c,  b # name
+% int, int,int # type
+% 1,   1,  1 # length
+[ 1,   3,  2   ]
+#ROLLBACK;
+#START TRANSACTION;
+#CREATE LOADER pyloader06() LANGUAGE PYTHON {
+#  return 3
+#};
+#ROLLBACK;
+
+# 15:10:44 >  
+# 15:10:44 >  "Done."
+# 15:10:44 >  
+
diff --git a/sql/backends/monet5/Tests/pyloader07.stable.out.Windows 
b/sql/backends/monet5/Tests/pyloader07.stable.out.Windows
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/pyloader07.stable.out.Windows
@@ -0,0 +1,82 @@
+stdout of test 'pyloader07` in directory 'sql/backends/mon

MonetDB: default - Merge with Dec2016 branch.

2017-03-09 Thread Sjoerd Mullender
Changeset: 100fc99826b9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=100fc99826b9
Added Files:
sql/jdbc/tests/Tests/BugResultSetMetaData_Bug_6183.SQL.bat
sql/jdbc/tests/Tests/BugResultSetMetaData_Bug_6183.SQL.sh
sql/jdbc/tests/Tests/BugResultSetMetaData_Bug_6183.stable.err
sql/jdbc/tests/Tests/BugResultSetMetaData_Bug_6183.stable.out
sql/test/BugTracker-2017/Tests/insert_self_ref_FK.Bug-6131.sql
sql/test/BugTracker-2017/Tests/insert_self_ref_FK.Bug-6131.stable.err
sql/test/BugTracker-2017/Tests/insert_self_ref_FK.Bug-6131.stable.out
sql/test/BugTracker-2017/Tests/unknown_col_in_order_by.Bug-3535.sql

sql/test/BugTracker-2017/Tests/unknown_col_in_order_by.Bug-3535.stable.err

sql/test/BugTracker-2017/Tests/unknown_col_in_order_by.Bug-3535.stable.out
sql/test/testdb-upgrade-chain-hge/Tests/dump.SQL.py.src
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.SQL.py.src
sql/test/testdb-upgrade-chain/Tests/dump.SQL.py.src
sql/test/testdb-upgrade-chain/Tests/upgrade.SQL.py.src
sql/test/testdb-upgrade-hge/Tests/dump.SQL.py.src
sql/test/testdb-upgrade-hge/Tests/upgrade.SQL.py.src
sql/test/testdb-upgrade/Tests/dump.SQL.py.src
Removed Files:
sql/test/testdb-upgrade-chain-hge/Tests/dump.SQL.py
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.SQL.py
sql/test/testdb-upgrade-chain/Tests/dump.SQL.py
sql/test/testdb-upgrade-chain/Tests/upgrade.SQL.py
sql/test/testdb-upgrade-hge/Tests/dump.SQL.py
sql/test/testdb-upgrade-hge/Tests/upgrade.SQL.py
sql/test/testdb-upgrade/Tests/dump.SQL.py
Modified Files:
clients/R/Tests/copy_into_fwf.stable.out
clients/R/Tests/dbapply.stable.out
clients/R/Tests/dbi.R
clients/R/Tests/dbi.stable.out
clients/R/Tests/deps-test.R
clients/R/Tests/dplyr-flights.R
clients/R/Tests/dplyr-flights.stable.out
clients/R/Tests/dplyr.R
clients/R/Tests/dplyr.stable.err
clients/R/Tests/dplyr.stable.out
gdk/gdk_orderidx.c
monetdb5/modules/mal/querylog.c
sql/jdbc/tests/Tests/All
sql/jdbc/tests/Tests/BugDecimalRound_Bug_3561.stable.out
sql/test/BugTracker-2017/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 1205 to 300 lines):

diff --git a/clients/R/Tests/copy_into_fwf.stable.out 
b/clients/R/Tests/copy_into_fwf.stable.out
--- a/clients/R/Tests/copy_into_fwf.stable.out
+++ b/clients/R/Tests/copy_into_fwf.stable.out
@@ -24,11 +24,8 @@ Ready.
 # 16:40:23 >  "R" "--vanilla" "--slave" "--args" "30658"
 # 16:40:23 >  
 
-[1] TRUE
 
   SQL  CREATE TABLE mtcars (mpg DOUBLE PRECISION, cyl DOUBLE PRECISION, disp 
DOUBLE PRECISION, hp DOUBLE PRECISION, drat DOUBLE PRECISION, wt DOUBLE 
PRECISION, qsec DOUBLE PRECISION, vs DOUBLE PRECISION, am DOUBLE PRECISION, 
gear DOUBLE PRECISION, carb DOUBLE PRECISION)
-  ROWS Fetched: 0 [complete]
-   Changed: NA
 mpg cyl  disp  hp dratwt  qsec vs am gear carb
 1  21.0   6 160.0 110 3.90 2.620 16.46  0  144
 2  21.0   6 160.0 110 3.90 2.875 17.02  0  144
@@ -62,7 +59,6 @@ 29 15.8   8 351.0 264 4.22 3.170 14.50  
 30 19.7   6 145.0 175 3.62 2.770 15.50  0  156
 31 15.0   8 301.0 335 3.54 3.570 14.60  0  158
 32 21.4   4 121.0 109 4.11 2.780 18.60  1  142
-[1] TRUE
 [1] "SUCCESS"
 
 # 16:40:23 >  
diff --git a/clients/R/Tests/dbapply.stable.out 
b/clients/R/Tests/dbapply.stable.out
--- a/clients/R/Tests/dbapply.stable.out
+++ b/clients/R/Tests/dbapply.stable.out
@@ -29,14 +29,10 @@ Ready.
 # 11:43:14 >  "R" "--vanilla" "--slave" "--args" "35780"
 # 11:43:14 >  
 
-[1] TRUE
-[1] TRUE
-[1] TRUE
 [1] 32
 [1] TRUE
 [1] 32
 [1] 42
-[1] TRUE
 [1] "SUCCESS"
 
 # 11:43:21 >  
diff --git a/clients/R/Tests/dbi.R b/clients/R/Tests/dbi.R
--- a/clients/R/Tests/dbi.R
+++ b/clients/R/Tests/dbi.R
@@ -43,6 +43,7 @@ dbRemoveTable(con,tname)
 stopifnot(identical(dbExistsTable(con,tname),FALSE))
 
 # write test table iris
+# iris is one of the built-in datasets in R
 data(iris)
 dbWriteTable(con,tname,iris)
 
@@ -65,16 +66,22 @@ stopifnot(identical(res@env$success,TRUE
 stopifnot(dbColumnInfo(res)[[1,1]] == "Species")
 stopifnot(dbColumnInfo(res)[[2,1]] == "Sepal.Width")
 
-stopifnot(dbGetRowCount(res) == 150 && res@env$info$rows == 150)
+stopifnot(dbGetRowCount(res) == 0)
 
 data <- dbFetch(res,10)
 
+stopifnot(dbGetRowCount(res) == 10)
+
+
 stopifnot(dim(data)[[1]] == 10)
 stopifnot(dim(data)[[2]] == 2)
 stopifnot(res@env$delivered == 10)
 stopifnot(dbHasCompleted(res) == FALSE)
 
 data2 <- dbFetch(res,-1)
+
+stopifnot(dbGetRowCount(res) == 150)
+
 stopifnot(dim(data2)[[1]] == 140)
 stopifnot(dbHasCompleted(res) == TRUE)
 
diff --git a/clients/R/Tests/dbi.stable.out b/clients/R/Tests/dbi.stable.out
--- a/clients/R/Tests/dbi.stable.out
+++ b/clients/R/Tests/dbi.stable.out
@@ -44,42 +44,

  1   2   >