Changeset: 2aecb8a95f20 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2aecb8a95f20
Modified Files:
clients/Makefile.ag
clients/mapiclient/mclient.c
clients/ruby/Makefile.ag
clients/ruby/Tests/All
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_mitosis.c
Branch: leftmart
Log Message:
Merge with default branch.
diffs (154 lines):
diff --git a/clients/Makefile.ag b/clients/Makefile.ag
--- a/clients/Makefile.ag
+++ b/clients/Makefile.ag
@@ -6,4 +6,4 @@
SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php
HAVE_RUBYGEM?ruby examples HAVE_PYTHON2?python2 HAVE_PYTHON3?python3
NATIVE_WIN32?NT
-EXTRA_DIST_DIR = Tests R nodejs
+EXTRA_DIST_DIR = Tests R
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2135,11 +2135,19 @@ myread(void *private, void *buf, size_t
if (size == 0)
return cnt;
if (p->buf == NULL) {
+ rl_completion_func_t *func = NULL;
+
+ if (strcmp(p->prompt, "more>") == 0)
+ func = suspend_completion();
p->buf = readline(p->prompt);
+ if (func)
+ continue_completion(func);
if (p->buf == NULL)
return 0;
p->len = strlen(p->buf);
p->read = 0;
+ if (p->len > 1)
+ save_line(p->buf);
}
if (p->read < p->len) {
if (p->len - p->read < size)
diff --git a/clients/ruby/Makefile.ag b/clients/ruby/Makefile.ag
--- a/clients/ruby/Makefile.ag
+++ b/clients/ruby/Makefile.ag
@@ -10,4 +10,4 @@ gem_monetdb = {
}
EXTRA_DIST = Changelog TODO ruby-monetdb-sql-0.2.gemspec
-EXTRA_DIST_DIR = examples lib
+EXTRA_DIST_DIR = lib
diff --git a/clients/ruby/Tests/All b/clients/ruby/Tests/All
--- a/clients/ruby/Tests/All
+++ b/clients/ruby/Tests/All
@@ -1,1 +1,1 @@
-rubytest.rb
+rubytest
diff --git a/monetdb5/optimizer/opt_costModel.c
b/monetdb5/optimizer/opt_costModel.c
--- a/monetdb5/optimizer/opt_costModel.c
+++ b/monetdb5/optimizer/opt_costModel.c
@@ -15,9 +15,12 @@
#define newRows(W,X,Y,Z) {\
c1 = getRowCnt(mb, getArg(p,W));\
c2 = getRowCnt(mb, getArg(p,X));\
- if (c1 == -1 || c2 == -1) \
+ /* just to ensure that rowcnt was/is never set to -1 */\
+ assert(c1 != (BUN) -1);\
+ assert(c2 != (BUN) -1);\
+ if (c1 == BUN_NONE || c2 == BUN_NONE) \
continue;\
- setRowCnt(mb, getArg(p,Z), (BUN)(Y));\
+ setRowCnt(mb, getArg(p,Z), (Y));\
}
/*
* The cost will be used in many places to make decisions.
@@ -33,7 +36,7 @@ int
OPTcostModelImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci)
{
int i;
- wrd c1, c2;
+ BUN c1, c2;
InstrPtr p;
(void) cntxt;
@@ -105,10 +108,10 @@ OPTcostModelImplementation(Client cntxt,
} else if (getFunctionId(p) == deleteRef){
if( isaBatType(getArgType(mb,p,2)) ){
/* delete BAT */
- newRows(1,2, (c1 - c2 ==0? 1: c1-c2),1);
+ newRows(1, 2, (c2 == c1 ? 1 : c1 - c2),
1);
} else {
/* insert scalars */
- newRows(1,1, (c1==1?1: c1-1),1);
+ newRows(1, 1, (c1 == 1 ? 1 : c1 - 1),
1);
}
} else if (getFunctionId(p) == insertRef){
newRows(1,1,( c1 + 1),0); /* faked */
@@ -124,15 +127,17 @@ OPTcostModelImplementation(Client cntxt,
getFunctionId(p) == minRef ||
getFunctionId(p) == maxRef ||
getFunctionId(p) == avgRef) {
- newRows(1,1, ( c1?c1:c1+1),0);
+ newRows(1, 1, (c1 != 0 ? c1 : 1), 0);
} else if (getFunctionId(p) == countRef){
newRows(1,1, 1,0);
}
} else if( p->token == ASSIGNsymbol && p->argc== 2){
/* copy the rows property */
c1 = getRowCnt(mb, getArg(p,1));
- if (c1 != -1)
- setRowCnt(mb, getArg(p,0), (BUN) c1);
+ /* just to ensure that rowcnt was/is never set to -1 */\
+ assert(c1 != (BUN) -1);\
+ if (c1 != BUN_NONE)
+ setRowCnt(mb, getArg(p,0), c1);
}
}
return 1;
diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c
--- a/monetdb5/optimizer/opt_mitosis.c
+++ b/monetdb5/optimizer/opt_mitosis.c
@@ -61,7 +61,7 @@ OPTmitosisImplementation(Client cntxt, M
{
int i, j, limit, slimit, estimate = 0, pieces = 1, mito_parts = 0,
mito_size = 0, row_size = 0, mt = -1;
str schema = 0, table = 0;
- wrd r = 0, rowcnt = 0; /* table should be sizeable to consider
parallel execution*/
+ BUN r = 0, rowcnt = 0; /* table should be sizeable to consider
parallel execution*/
InstrPtr q, *old, target = 0;
size_t argsize = 6 * sizeof(lng);
/* per op: 6 = (2+1)*2 <= 2 args + 1 res, each with head &
tail */
@@ -136,7 +136,7 @@ OPTmitosisImplementation(Client cntxt, M
* Take into account the number of client connections,
* because all user together are responsible for resource contentions
*/
- r = (wrd) (monet_memory / argsize);
+ r = monet_memory / argsize;
/* if data exceeds memory size,
* i.e., (rowcnt*argsize > monet_memory),
* i.e., (rowcnt > monet_memory/argsize = r) */
@@ -151,13 +151,13 @@ OPTmitosisImplementation(Client cntxt, M
} else if (rowcnt > MINPARTCNT) {
/* exploit parallelism, but ensure minimal partition size to
* limit overhead */
- pieces = (int) MIN((rowcnt / MINPARTCNT), (wrd) threads);
+ pieces = (int) MIN(rowcnt / MINPARTCNT, (BUN) threads);
}
/* when testing, always aim for full parallelism, but avoid
* empty pieces */
FORCEMITODEBUG
if (pieces < threads)
- pieces = (int) MIN((wrd) threads, rowcnt);
+ pieces = (int) MIN((BUN) threads, rowcnt);
/* prevent plan explosion */
if (pieces > MAXSLICES)
pieces = MAXSLICES;
@@ -173,7 +173,7 @@ OPTmitosisImplementation(Client cntxt, M
OPTDEBUGmitosis
mnstr_printf(cntxt->fdout, "#opt_mitosis: target is %s.%s "
- " with " SSZFMT "
rows of size %d into " SSZFMT
+ " with " BUNFMT "
rows of size %d into " BUNFMT
" rows/piece %d
threads %d pieces"
" fixed parts
%d fixed size %d\n",
getVarConstant(mb, getArg(target, 2)).val.sval,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list