MonetDB: wlcr - Approve tests output

2017-01-11 Thread Martin Kersten
Changeset: 9eb546c01300 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9eb546c01300
Modified Files:
clients/Tests/MAL-signatures.stable.out
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
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
monetdb5/modules/mal/wlcr.c
sql/backends/monet5/sql_wlcr.c

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/BugTracker-2014/Tests/querylog.Bug-3607.stable.out
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.32bit
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.int128
sql/test/Tests/setoptimizer.stable.out
sql/test/Tests/setoptimizer.stable.out.Windows
sql/test/Tests/systemfunctions.stable.out
sql/test/Tests/systemfunctions.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/leaks/Tests/check1.stable.out.int128
sql/test/leaks/Tests/check2.stable.out.int128
sql/test/leaks/Tests/check3.stable.out.int128
sql/test/leaks/Tests/check4.stable.out.int128
sql/test/leaks/Tests/check5.stable.out.int128
sql/test/mergetables/Tests/mergequery.stable.out
sql/test/remote/Tests/partition_elim.stable.out
sql/test/remote/Tests/ssbm.stable.err
sql/test/remote/Tests/ssbm.stable.out.int128
Branch: wlcr
Log Message:

Approve tests output


diffs (truncated from 3102 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
@@ -7413,6 +7413,56 @@ Ready.
 [ "clients",   "stop", "pattern clients.stop(id:int):void ",   "CLTstop;", 
"Stop the query execution at the next eligble statement."   ]
 [ "clients",   "suspend",  "pattern clients.suspend(id:int):void ",
"CLTsuspend;",  "Put a client process to sleep for some time.\nIt will simple 
sleep for a second at a time, until\nthe awake bit has been set in its 
descriptor"]
 [ "clients",   "wakeup",   "command clients.wakeup(id:int):void ", 
"CLTwakeup;",   "Wakeup a client process"   ]
+[ "clone", "alter_add_table",  "pattern 
clone.alter_add_table(sname:str, mtnme:str, psnme:str, ptnme:str, 
action:int):void ",  "CLONEgeneric;","Catalog operation 
alter_add_table" ]
+[ "clone", "alter_del_table",  "pattern 
clone.alter_del_table(sname:str, mtnme:str, psnme:str, ptnme:str, 
action:int):void ",  "CLONEgeneric;","Catalog operation 
alter_del_table" ]
+[ "clone", "alter_seq","pattern clone.alter_seq(sname:str, 
seqname:str, val:lng):void ",   "CLONEgeneric;","Catalog operation 
alter_seq"   ]
+[ "clone", "alter_set_table",  "pattern 
clone.alter_set_table(sname:str, tnme:str, access:int):void ", "CLONEgeneric;", 
   "Catalog operation alter_set_table" ]
+[ "clone", "alter_table",  "pattern clone.alter_table(sname:str, 
action:int):void ",   "CLONEgeneric;","Catalog operation 
alter_table" ]
+[ "clone", "alter_user",   "pattern clone.alter_user(sname:str, 
passwrd:str, enc:int, schema:str, oldpasswrd:str):void ",  "CLONEgeneric;", 
   "Catalog operation alter_user"  ]
+[ "clone", "append",   "pattern clone.append(sname:str, tname:str, 
cname:str, ins:any...):int ",   "CLONEappend;", "Apply the insertions in 
the workload-capture-replay list"  ]
+[ "clone", "clear_table",  "pattern clone.clear_table(sname:str, 
tname:str):int ", "CLONEclear_table;","Destroy the tuples in the table" 
  ]
+[ "clone", "create_function",  "pattern 
clone.create_function(sname:str, fname:str):void ","CLONEgeneric;",
"Catalog operation create_function" ]
+[ "clone", "create_role",  "pattern clone.create_role(sname:str, role:str, 
grator:int):void ", "CLONEgeneric;","Catalog operation create_role" 
]
+[ "clone", "create_schema","pattern clone.create_schema(sname:str, 
auth:str, action:int):void ",   "CLONEgeneric;","Catalog operation 
create_schema"   ]
+[ "clone", "create_seq",   "pattern clone.create_seq(sname:str, 
seqname:str, action:int):void ",   "CLONEgeneric;","Catalog operation 
create_seq"  ]
+[ "clone", "create_table", "pattern clone.create_table(sname:str, 
tname:str, temp:int):void ", "CLONEgeneric;","Catalog operation 
create_table"]
+[ "clone", "create_trigger",   "pattern 
clone.create_trigger(sname:str, tname:str, triggername:str, time:int, 
orientation:int, 

MonetDB: wlcr - merge with default

2017-01-11 Thread Martin Kersten
Changeset: ffe4dfada652 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffe4dfada652
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

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out.int128
Removed Files:
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128.single
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.single
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk_batop.c
gdk/gdk_hash.c
gdk/gdk_imprints.c
gdk/gdk_join.c
gdk/gdk_orderidx.c
gdk/gdk_project.c
monetdb5/mal/mal_sabaoth.c
monetdb5/mal/mal_sabaoth.h
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/profiler.h
monetdb5/modules/mal/sabaoth.c
sql/server/rel_optimizer.c
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/BugTracker/Tests/subquery_orderby.SF-1688915.sql
sql/test/BugTracker/Tests/subquery_orderby.SF-1688915.stable.out
sql/test/leaks/Tests/check0.stable.out
sql/test/leaks/Tests/check1.stable.out
sql/test/leaks/Tests/check2.stable.out
sql/test/leaks/Tests/check3.stable.out
sql/test/leaks/Tests/check4.stable.out
sql/test/leaks/Tests/check5.stable.out
sql/test/leaks/Tests/drop3.stable.out
sql/test/leaks/Tests/select1.stable.out
sql/test/leaks/Tests/select2.stable.out
sql/test/leaks/Tests/temp1.stable.out
sql/test/leaks/Tests/temp2.stable.out
sql/test/leaks/Tests/temp3.stable.out

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

merge with default


diffs (truncated from 3600 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
@@ -707,7 +707,6 @@ str ALGprojectionpath(Client cntxt, MalB
 str ALGprojecttail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ALGrangejoin(bat *r1, bat *r2, const bat *lid, const bat *rlid, const bat 
*rhid, const bat *slid, const bat *srid, const bit *li, const bit *hi, const 
lng *estimate);
 str ALGreuse(bat *ret, const bat *bid);
-str ALGsample(bat *result, const bat *bid, const int *param);
 str ALGselect1(bat *result, const bat *bid, const void *low, const void *high, 
const bit *li, const bit *hi, const bit *anti);
 str ALGselect2(bat *result, const bat *bid, const bat *sid, const void *low, 
const void *high, const bit *li, const bit *hi, const bit *anti);
 str ALGselectNotNil(bat *result, const bat *bid);
@@ -728,14 +727,9 @@ str ALGsort33(bat *result, bat *norder, 
 str ALGstdev(dbl *res, const bat *bid);
 str ALGstdevp(dbl *res, const bat *bid);
 str ALGsubslice_lng(bat *ret, const bat *bid, const lng *start, const lng 
*end);
-str ALGtdiff(bat *result, const bat *lid, const bat *rid);
 str ALGthetajoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, 
const bat *sr, const int *op, const bit *nil_matches, const lng *estimate);
 str ALGthetaselect1(bat *result, const bat *bid, const void *val, const char 
**op);
 str ALGthetaselect2(bat *result, const bat *bid, const bat *sid, const void 
*val, const char **op);
-str ALGtinter(bat *result, const bat *lid, const bat *rid);
-str ALGtmark(bat *result, const bat *bid, const oid *base);
-str ALGtmark_default(bat *result, const bat *bid);
-str ALGtmarkp(bat *result, const bat *bid, const int *nr_parts, const int 
*part_nr);
 str ALGunique1(bat *result, const bat *bid);
 str ALGunique2(bat *result, const bat *bid, const bat *sid);
 str ALGvariance(dbl *res, const bat *bid);
@@ -812,7 +806,6 @@ str BKCisTransient(bit *res, const bat *
 str BKCmergecand(bat *ret, const bat *aid, const bat *bid);
 str BKCmirror(bat *ret, const bat *bid);
 str BKCnewBAT(bat *res, const int *tt, const BUN *cap, int role);
-str BKCpersists(void *r, const bat *bid, const bit *flg);
 str BKCreuseBAT(bat *ret, const bat *bid, const bat *did);
 str BKCreuseBATmap(bat *ret, const bat *bid, const bat *did);
 str BKCsave(bit *res, const char *const *input);
@@ -826,7 +819,6 

MonetDB: wlcr - Get the update propagation in place

2017-01-11 Thread Martin Kersten
Changeset: fb23dcab0685 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb23dcab0685
Modified Files:
monetdb5/modules/mal/wlcr.c
monetdb5/modules/mal/wlcr.mal
sql/backends/monet5/sql_wlcr.c
sql/backends/monet5/sql_wlcr.h
sql/backends/monet5/sql_wlcr.mal
Branch: wlcr
Log Message:

Get the update propagation in place


diffs (truncated from 406 to 300 lines):

diff --git a/monetdb5/modules/mal/wlcr.c b/monetdb5/modules/mal/wlcr.c
--- a/monetdb5/modules/mal/wlcr.c
+++ b/monetdb5/modules/mal/wlcr.c
@@ -197,7 +197,7 @@ WLCRmaster(Client cntxt, MalBlkPtr mb, M
}
if( wlcr_fd == NULL)
msg = WLCRloggerfile(cntxt);
-   mnstr_printf(cntxt->fdout,"#master wlcr_batch %d threshold %d file open 
%d\n",wlcr_batch, wlcr_threshold, wlcr_fd != NULL);
+   mnstr_printf(cntxt->fdout,"#master batches %d threshold %d file open 
%d\n",wlcr_batch, wlcr_threshold, wlcr_fd != NULL);
return msg;
 }
 
@@ -217,7 +217,7 @@ WLCRaddtime(Client cntxt, InstrPtr pci, 
return pushStr(cntxt->wlcr, p, tbuf);
 }
 
-#define WLCR_start()\
+#define WLCR_start(P)\
 { Symbol s; \
if( cntxt->wlcr == NULL){\
s = newSymbol("wlrc", FUNCTIONsymbol);\
@@ -226,11 +226,11 @@ WLCRaddtime(Client cntxt, InstrPtr pci, 
s->def = NULL;\
} \
if( cntxt->wlcr->stop == 0){\
-   p = newStmt(cntxt->wlcr,"clone","job");\
-   p = pushStr(cntxt->wlcr,p, cntxt->username);\
-   p = pushInt(cntxt->wlcr,p, wlcr_tid);\
-   p = WLCRaddtime(cntxt,pci, p); \
-   p->ticks = GDKms();\
+   P = newStmt(cntxt->wlcr,"clone","job");\
+   P = pushStr(cntxt->wlcr, P, cntxt->username);\
+   P = pushInt(cntxt->wlcr, P, wlcr_tid);\
+   P = WLCRaddtime(cntxt,pci, P); \
+   P->ticks = GDKms();\
 }  }
 
 str
@@ -263,7 +263,7 @@ WLCRquery(Client cntxt, MalBlkPtr mb, Ma
(void) stk;
if ( strcmp("-- no query",getVarConstant(mb, getArg(pci,1)).val.sval) 
== 0)
return MAL_SUCCEED; // ignore system internal queries.
-   WLCR_start();
+   WLCR_start(p);
p = newStmt(cntxt->wlcr, "clone","query");
p = pushStr(cntxt->wlcr, p, getVarConstant(mb, getArg(pci,1)).val.sval);
p = pushStr(cntxt->wlcr, p, getVarConstant(mb, getArg(pci,2)).val.sval);
@@ -277,7 +277,7 @@ WLCRgeneric(Client cntxt, MalBlkPtr mb, 
int i, tpe, varid;
(void) stk;

-   WLCR_start();
+   WLCR_start(p);
p = newStmt(cntxt->wlcr, "clone",getFunctionId(pci));
for( i = pci->retc; i< pci->argc; i++){
tpe =getArgType(mb, pci, i);
@@ -310,11 +310,23 @@ WLCRgeneric(Client cntxt, MalBlkPtr mb, 
pci = push##TPE2(cntxt->wlcr, pci ,*p);\
 } }
 
+#define updateBatch(TPE1,TPE2)\
+{  TPE1 *x = (TPE1 *) Tloc(bval,0);\
+   TPE1 *y = (TPE1 *) Tloc(bval, BUNlast(b));\
+   int k=0; \
+   for( ; x < y; x++, k++){\
+   p = newStmt(cntxt->wlcr, "clone","update");\
+   p = pushStr(cntxt->wlcr, p, sch);\
+   p = pushStr(cntxt->wlcr, p, tbl);\
+   p = pushStr(cntxt->wlcr, p, col);\
+   p = pushOid(cntxt->wlcr, p, (ol? *ol++: o++));\
+   p = push##TPE2(cntxt->wlcr, p ,*x);\
+} }
+
 static void
 WLCRdatashipping(Client cntxt, MalBlkPtr mb, InstrPtr pci, int bid)
 {  BAT *b;
str sch,tbl,col;
-   (void) cntxt;
(void) mb;
b= BATdescriptor(bid);
assert(b);
@@ -350,7 +362,6 @@ WLCRdatashipping(Client cntxt, MalBlkPtr
pci = pushStr(cntxt->wlcr, pci, sch);
pci = pushStr(cntxt->wlcr, pci, tbl);
pci = pushStr(cntxt->wlcr, pci, col);
-   pci->ticks = GDKms();
}
k++;
pci = pushStr(cntxt->wlcr, pci ,(str) 
BUNtail(bi,p));
@@ -371,12 +382,11 @@ WLCRappend(Client cntxt, MalBlkPtr mb, M
(void) stk;
(void) mb;

-   WLCR_start();
+   WLCR_start(p);
p = newStmt(cntxt->wlcr, "clone","append");
p = pushStr(cntxt->wlcr, p, getVarConstant(mb, getArg(pci,1)).val.sval);
p = pushStr(cntxt->wlcr, p, getVarConstant(mb, getArg(pci,2)).val.sval);
p = pushStr(cntxt->wlcr, p, getVarConstant(mb, getArg(pci,3)).val.sval);
-   p->ticks = GDKms();
 
// extend the instructions with all values. 
// If this become too large we can always switch to a "catalog" mode
@@ -405,12 +415,11 @@ WLCRdelete(Client cntxt, MalBlkPtr mb, M
(void) stk;
(void) mb;

-   WLCR_start();
+   WLCR_start(p);
p = newStmt(cntxt->wlcr, "clone","delete");
p = pushStr(cntxt->wlcr, p, 

monetdb-java: embedded - Some documentation added.

2017-01-11 Thread Pedro Ferreira
Changeset: c0ce1ea5075f for monetdb-java
URL: http://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=c0ce1ea5075f
Modified Files:
src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
src/main/java/nl/cwi/monetdb/mcl/connection/ControlCommands.java
src/main/java/nl/cwi/monetdb/mcl/connection/IMonetDBLanguage.java
src/main/java/nl/cwi/monetdb/mcl/connection/MCLException.java
src/main/java/nl/cwi/monetdb/mcl/connection/SenderThread.java
src/main/java/nl/cwi/monetdb/mcl/connection/mapi/MapiConnection.java
src/main/java/nl/cwi/monetdb/mcl/protocol/AbstractProtocol.java
src/main/java/nl/cwi/monetdb/mcl/protocol/StarterHeaders.java
src/main/java/nl/cwi/monetdb/mcl/protocol/newmapi/NewMapiProtocol.java
src/main/java/nl/cwi/monetdb/mcl/protocol/oldmapi/OldMapiProtocol.java
src/main/java/nl/cwi/monetdb/mcl/responses/DataBlockResponse.java
src/main/java/nl/cwi/monetdb/mcl/responses/ResultSetResponse.java
src/main/java/nl/cwi/monetdb/merovingian/Control.java
src/main/java/nl/cwi/monetdb/util/SQLRestore.java
Branch: embedded
Log Message:

Some documentation added.


diffs (truncated from 512 to 300 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
@@ -1252,7 +1252,7 @@ public abstract class MonetConnection ex
 try {
 protocol.writeNextQuery(language.getQueryTemplateIndex(0), 
command, language.getQueryTemplateIndex(1));
 protocol.waitUntilPrompt();
-int csrh = protocol.getCurrentServerResponseHeader();
+int csrh = protocol.getCurrentServerResponse();
 if (csrh == ServerResponses.ERROR) {
 String error = protocol.getRemainingStringLine(0);
 throw new SQLException(error.substring(6), error.substring(0, 
5));
@@ -1473,7 +1473,7 @@ public abstract class MonetConnection ex
 
 // go for new results
 protocol.fetchNextResponseData();
-int nextResponse = protocol.getCurrentServerResponseHeader();
+int nextResponse = protocol.getCurrentServerResponse();
 IResponse res = null;
 while (nextResponse != ServerResponses.PROMPT) {
 // each response should start with a start of header (or 
error)
@@ -1533,14 +1533,14 @@ public abstract class MonetConnection ex
 + e.getErrorOffset();
 // flush all the rest
 protocol.waitUntilPrompt();
-nextResponse = 
protocol.getCurrentServerResponseHeader();
+nextResponse = 
protocol.getCurrentServerResponse();
 break;
 }
 
 // immediately handle errors after parsing the 
header (res may be null)
 if (error != null) {
 protocol.waitUntilPrompt();
-nextResponse = 
protocol.getCurrentServerResponseHeader();
+nextResponse = 
protocol.getCurrentServerResponse();
 break;
 }
 
@@ -1555,7 +1555,7 @@ public abstract class MonetConnection ex
 // right, some protocol violation, 
skip the rest of the result
 error = "M0M10!" + ex.getMessage();
 protocol.waitUntilPrompt();
-nextResponse = 
protocol.getCurrentServerResponseHeader();
+nextResponse = 
protocol.getCurrentServerResponse();
 break;
 }
 }
@@ -1572,20 +1572,20 @@ public abstract class MonetConnection ex
 }
 // read the next line (can be prompt, new result, 
error, etc.) before we start the loop over
 protocol.fetchNextResponseData();
-nextResponse = 
protocol.getCurrentServerResponseHeader();
+nextResponse = protocol.getCurrentServerResponse();
 break;
 case ServerResponses.INFO:
 addWarning(protocol.getRemainingStringLine(0), 
"01000");
 // read the next line (can be prompt, new result, 
error, etc.) before we start the loop over
 

MonetDB: Dec2016 - New implementation of BATsubcross, avoiding B...

2017-01-11 Thread Sjoerd Mullender
Changeset: bd81ba901662 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd81ba901662
Modified Files:
gdk/gdk_cross.c
Branch: Dec2016
Log Message:

New implementation of BATsubcross, avoiding BATproject.


diffs (148 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(, , 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) {
+   BBPreclaim(bn1);
+   return GDK_FAIL;
}
+   BATsetcount(bn2, cnt1 * cnt2);
+   bn2->tsorted = cnt1 <= 1;
+   bn2->trevsorted = cnt2 <= 1;
+   bn2->tkey = cnt1 <= 1;
+   bn2->tnil = 0;
+   bn2->tnonil = 1;
+   p = (oid *) Tloc(bn2, 0);
+   if (rcand) {
+   for (i = 0; i < cnt1; i++)
+   for (j = 0; j < cnt2; j++)
+   *p++ = rcand[j];
+   bn2->tdense = 0;
+   } else {
+   seq = r->hseqbase + start2;
+   for (i = 0; i < cnt1; i++)
+   for (j = 0; j < cnt2; j++)
+   *p++ = j + seq;
+   bn2->tdense = bn2->tkey != 0;
+   if (bn2->tdense)
+

MonetDB: Dec2016 - Add conditional to test.

2017-01-11 Thread Sjoerd Mullender
Changeset: b203c45d6e95 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b203c45d6e95
Modified Files:
sql/test/BugTracker-2017/Tests/All
Branch: Dec2016
Log Message:

Add conditional to test.


diffs (9 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,4 +1,4 @@
 shutdown.Bug-6182
 avggroupbysq.Bug-6178
 semijoinunion.Bug-6150
-heapextend.Bug-6134
+HAVE_LIBZ?heapextend.Bug-6134
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Cleanup: declarations without definitions, an...

2017-01-11 Thread Sjoerd Mullender
Changeset: bd8e11325a5e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd8e11325a5e
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/profiler.h
Branch: default
Log Message:

Cleanup: declarations without definitions, and unused functions.


diffs (208 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
@@ -707,7 +707,6 @@ str ALGprojectionpath(Client cntxt, MalB
 str ALGprojecttail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ALGrangejoin(bat *r1, bat *r2, const bat *lid, const bat *rlid, const bat 
*rhid, const bat *slid, const bat *srid, const bit *li, const bit *hi, const 
lng *estimate);
 str ALGreuse(bat *ret, const bat *bid);
-str ALGsample(bat *result, const bat *bid, const int *param);
 str ALGselect1(bat *result, const bat *bid, const void *low, const void *high, 
const bit *li, const bit *hi, const bit *anti);
 str ALGselect2(bat *result, const bat *bid, const bat *sid, const void *low, 
const void *high, const bit *li, const bit *hi, const bit *anti);
 str ALGselectNotNil(bat *result, const bat *bid);
@@ -728,14 +727,9 @@ str ALGsort33(bat *result, bat *norder, 
 str ALGstdev(dbl *res, const bat *bid);
 str ALGstdevp(dbl *res, const bat *bid);
 str ALGsubslice_lng(bat *ret, const bat *bid, const lng *start, const lng 
*end);
-str ALGtdiff(bat *result, const bat *lid, const bat *rid);
 str ALGthetajoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, 
const bat *sr, const int *op, const bit *nil_matches, const lng *estimate);
 str ALGthetaselect1(bat *result, const bat *bid, const void *val, const char 
**op);
 str ALGthetaselect2(bat *result, const bat *bid, const bat *sid, const void 
*val, const char **op);
-str ALGtinter(bat *result, const bat *lid, const bat *rid);
-str ALGtmark(bat *result, const bat *bid, const oid *base);
-str ALGtmark_default(bat *result, const bat *bid);
-str ALGtmarkp(bat *result, const bat *bid, const int *nr_parts, const int 
*part_nr);
 str ALGunique1(bat *result, const bat *bid);
 str ALGunique2(bat *result, const bat *bid, const bat *sid);
 str ALGvariance(dbl *res, const bat *bid);
@@ -812,7 +806,6 @@ str BKCisTransient(bit *res, const bat *
 str BKCmergecand(bat *ret, const bat *aid, const bat *bid);
 str BKCmirror(bat *ret, const bat *bid);
 str BKCnewBAT(bat *res, const int *tt, const BUN *cap, int role);
-str BKCpersists(void *r, const bat *bid, const bit *flg);
 str BKCreuseBAT(bat *ret, const bat *bid, const bat *did);
 str BKCreuseBATmap(bat *ret, const bat *bid, const bat *did);
 str BKCsave(bit *res, const char *const *input);
@@ -826,7 +819,6 @@ str BKCsetPersistent(void *r, const bat 
 str BKCsetTransient(void *r, const bat *bid);
 str BKCsetkey(bat *res, const bat *bid, const bit *param);
 str BKCshrinkBAT(bat *ret, const bat *bid, const bat *did);
-str BKCshrinkBATmap(bat *ret, const bat *bid, const bat *did);
 str BLOBblob_blob(blob **d, blob **s);
 str BLOBblob_fromstr(blob **b, str *d);
 void BLOBdel(Heap *h, var_t *index);
@@ -988,9 +980,7 @@ str CMDcalcavg(Client cntxt, MalBlkPtr m
 str CMDcallBAT(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CMDcallFunction(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CMDcallString(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str CMDcleanup(void *ret);
 str CMDcleanupTraces(void *res);
-str CMDclearTrace(void *res);
 str CMDcloseProfilerStream(void *res);
 str CMDconvert_bit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CMDconvert_bte(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
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
@@ -812,50 +812,6 @@ ALGcount_no_nil(lng *result, const bat *
 }
 
 str
-ALGtmark(bat *result, const bat *bid, const oid *base)
-{
-   BAT *b, *bn = NULL;
-
-   if ((b = BATdescriptor(*bid)) == NULL) {
-   throw(MAL, "algebra.mark", RUNTIME_OBJECT_MISSING);
-   }
-   bn = BATdense(b->hseqbase, *base, BATcount(b));
-   if (bn != NULL) {
-   BBPunfix(b->batCacheid);
-   *result = bn->batCacheid;
-   BBPkeepref(*result);
-   return MAL_SUCCEED;
-   }
-   BBPunfix(b->batCacheid);
-   throw(MAL, "algebra.mark", GDK_EXCEPTION);
-}
-
-str
-ALGtmark_default(bat *result, const bat *bid)
-{
-   oid o = 0;
-
-   return ALGtmark(result, bid, );
-}
-
-str
-ALGtmarkp(bat *result, const bat *bid, const int *nr_parts, const int *part_nr)
-{
-#if SIZEOF_OID == 4
-   int bits = 31;
-#else
-   int bits = 63;

MonetDB: default - Cleanup: removed some unused SABAOTH functions.

2017-01-11 Thread Sjoerd Mullender
Changeset: fb6de70f9819 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb6de70f9819
Modified Files:
clients/Tests/exports.stable.out
monetdb5/mal/mal_sabaoth.c
monetdb5/mal/mal_sabaoth.h
monetdb5/modules/mal/sabaoth.c
Branch: default
Log Message:

Cleanup: removed some unused SABAOTH functions.


diffs (212 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
@@ -1639,18 +1639,12 @@ str RUNcostPrediction(Client cntxt, MalB
 str RUNisolation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str RUNpickResult(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str RUNvolumeCost(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
-str SABAOTHdeserialise(sabdb **ret, str *sabdb);
 str SABAOTHfreeStatus(sabdb **ret);
-str SABAOTHgetDBfarm(str *ret);
-str SABAOTHgetDBname(str *ret);
 str SABAOTHgetLocalConnection(str *ret);
 str SABAOTHgetMyStatus(sabdb **ret);
-str SABAOTHgetStatus(sabdb **ret, str dbname);
-str SABAOTHgetUplogInfo(sabuplog *ret, sabdb *db);
-str SABAOTHmarchConnection(void *ret, str *host, int *port);
-str SABAOTHmarchScenario(void *ret, str *lang);
-str SABAOTHretreatScenario(void *ret, str *lang);
-str SABAOTHserialise(str *ret, sabdb *db);
+str SABAOTHmarchConnection(str *host, int *port);
+str SABAOTHmarchScenario(str *lang);
+str SABAOTHretreatScenario(str *lang);
 str SABepilogue(void *ret);
 str SABgetLocalConnectionHost(str *ret);
 str SABgetLocalConnectionPort(int *ret);
diff --git a/monetdb5/mal/mal_sabaoth.c b/monetdb5/mal/mal_sabaoth.c
--- a/monetdb5/mal/mal_sabaoth.c
+++ b/monetdb5/mal/mal_sabaoth.c
@@ -11,7 +11,7 @@
  *  Cluster support
  * The cluster facilitation currently only deals with (de-)registering of
  * services offered by the local server to other servers.
- * The name of this module is inspired by the Armada setting of anchient
+ * The name of this module is inspired by the Armada setting of ancient
  * times and origanisational structures.  Sabaoth, stands for ``Lord of
  * Hosts'' in an army setting as found in the Bible's New Testament.  This
  * module allows an army of Mservers to be aware of each other on a local
@@ -50,41 +50,14 @@ fromMallocToGDK(char *val)
} while (0)
 
 /**
- * Returns the dbfarm as received during SABAOTHinit.  Throws an
- * exception if not initialised.
- */
-str SABAOTHgetDBfarm(str *ret) {
-   str dbfarm;
-   str err = msab_getDBfarm();
-   if (err != NULL)
-   excFromMem(MAL, "sabaoth.getdbfarm", err);
-   *ret = fromMallocToGDK(dbfarm);
-   return(MAL_SUCCEED);
-}
-
-/**
- * Returns the dbname as received during SABAOTHinit.  Throws an
- * exception if not initialised or dbname was set to NULL.
- */
-str SABAOTHgetDBname(str *ret) {
-   str dbname;
-   str err = msab_getDBname();
-   if (err != NULL)
-   excFromMem(MAL, "sabaoth.getdbname", err);
-   *ret = fromMallocToGDK(dbname);
-   return(MAL_SUCCEED);
-}
-
-/**
  * Writes the given language to the scenarios file.  If the file doesn't
  * exist, it is created.  Multiple invocations of this function for the
  * same language are ignored.
  */
-str SABAOTHmarchScenario(void *ret, str *lang) {
+str SABAOTHmarchScenario(str *lang) {
str err = msab_marchScenario(*lang);
if (err != NULL)
excFromMem(MAL, "sabaoth.marchscenario", err);
-   (void)ret;
return(MAL_SUCCEED);
 }
 
@@ -93,11 +66,10 @@ str SABAOTHmarchScenario(void *ret, str 
  * file is empty (before or) after removing the language, the file is
  * removed.
  */
-str SABAOTHretreatScenario(void *ret, str *lang) {
+str SABAOTHretreatScenario(str *lang) {
str err = msab_retreatScenario(*lang);
if (err != NULL)
excFromMem(MAL, "sabaoth.retreatscenario", err);
-   (void)ret;
return(MAL_SUCCEED);
 }
 
@@ -108,11 +80,10 @@ str SABAOTHretreatScenario(void *ret, st
  * to <= 0, this function treats the host argument as UNIX domain
  * socket, in which case host must start with a '/'.
  */
-str SABAOTHmarchConnection(void *ret, str *host, int *port) {
+str SABAOTHmarchConnection(str *host, int *port) {
str err = msab_marchConnection(*host, *port);
if (err != NULL)
excFromMem(MAL, "sabaoth.marchconnection", err);
-   (void)ret;
return(MAL_SUCCEED);
 }
 
@@ -161,21 +132,6 @@ str SABAOTHgetMyStatus(sabdb** ret) {
 }
 
 /**
- * Returns a list of populated sabdb structs.  If dbname == NULL, the
- * list contains sabdb structs for all found databases in the dbfarm.
- * Otherwise, at most one sabdb struct is returned for the database from
- * the dbfarm that matches dbname.
- * If no database could be found, an empty list is returned.  Each list
- * is terminated by a NULL entry.
- */
-str SABAOTHgetStatus(sabdb** ret, str dbname) {
-   str err =