MonetDB: Dec2016 - Move unfix to outside the lock: it may cause ...

2017-04-12 Thread Sjoerd Mullender
Changeset: 1a0ab345fe4f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a0ab345fe4f
Modified Files:
gdk/gdk_orderidx.c
Branch: Dec2016
Log Message:

Move unfix to outside the lock: it may cause deadlock (see comment).


diffs (43 lines):

diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -121,6 +121,7 @@ BATorderidx(BAT *b, int stable)
const char *nme;
oid seq;
BUN p, q;
+   BAT *bn = NULL;
 
if (BATcheckorderidx(b))
return GDK_SUCCEED;
@@ -155,7 +156,7 @@ BATorderidx(BAT *b, int stable)
if (!BATtdense(b)) {
/* we need to sort a copy of the column so as not to
 * change the original */
-   BAT *bn = COLcopy(b, b->ttype, TRUE, TRANSIENT);
+   bn = COLcopy(b, b->ttype, TRUE, TRANSIENT);
if (bn == NULL) {
HEAPfree(m, 1);
GDKfree(m);
@@ -179,7 +180,11 @@ BATorderidx(BAT *b, int stable)
 BATcount(bn), Tsize(bn), SIZEOF_OID,
 bn->ttype);
}
-   BBPunfix(bn->batCacheid);
+   /* we must unfix after releasing the lock since we
+* might get deadlock otherwise (we're holding a lock
+* based on b->batCacheid; unfix tries to get a lock
+* based on bn->batCacheid, usually but (crucially)
+* not always a different lock) */
}
 
 #ifdef PERSISTENTIDX
@@ -202,6 +207,9 @@ BATorderidx(BAT *b, int stable)
b->torderidx = m;
MT_lock_unset(&GDKhashLock(b->batCacheid));
 
+   if (bn)
+   BBPunfix(bn->batCacheid);
+
return GDK_SUCCEED;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Dec2016 - Do the work outside of the lock.

2017-04-12 Thread Sjoerd Mullender
Changeset: 020c047fa49b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=020c047fa49b
Modified Files:
gdk/gdk_orderidx.c
Branch: Dec2016
Log Message:

Do the work outside of the lock.


diffs (23 lines):

diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -551,7 +551,10 @@ OIDXdestroy(BAT *b)
Heap *hp;
 
MT_lock_set(&GDKhashLock(b->batCacheid));
-   if ((hp = b->torderidx) == (Heap *) 1) {
+   hp = b->torderidx;
+   b->torderidx = NULL;
+   MT_lock_unset(&GDKhashLock(b->batCacheid));
+   if (hp == (Heap *) 1) {
GDKunlink(BBPselectfarm(b->batRole, b->ttype, 
orderidxheap),
  BATDIR,
  BBP_physical(b->batCacheid),
@@ -560,7 +563,5 @@ OIDXdestroy(BAT *b)
HEAPdelete(hp, BBP_physical(b->batCacheid), 
"torderidx");
GDKfree(hp);
}
-   b->torderidx = NULL;
-   MT_lock_unset(&GDKhashLock(b->batCacheid));
}
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Dec2016 - Test for NULL pointer before dereferencing.

2017-04-12 Thread Sjoerd Mullender
Changeset: 3a9afb7a8637 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3a9afb7a8637
Modified Files:
gdk/gdk_bbp.c
Branch: Dec2016
Log Message:

Test for NULL pointer before dereferencing.
I've seen crashes during exit because of this, although I don't yet
understand how we can get in the situation.


diffs (19 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1739,11 +1739,13 @@ BBPexit(void)
bat tp = VIEWtparent(b);
bat vtp = VIEWvtparent(b);
if (tp) {
-   
BBP_cache(tp)->batSharecnt--;
+   if (BBP_desc(tp))
+   
BBP_desc(tp)->batSharecnt--;
--BBP_lrefs(tp);
}
if (vtp) {
-   
BBP_cache(vtp)->batSharecnt--;
+   if (BBP_desc(vtp))
+   
BBP_desc(vtp)->batSharecnt--;
--BBP_lrefs(vtp);
}
VIEWdestroy(b);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Dec2016 - allow for update table x=1,x=2,x=n (only last...

2017-04-12 Thread Niels Nes
Changeset: 3701dcd5a6c9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3701dcd5a6c9
Modified Files:
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/Tests/02.stable.out
sql/server/rel_optimizer.c
sql/server/rel_updates.c
sql/storage/store.c
sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
Branch: Dec2016
Log Message:

allow for update table x=1,x=2,x=n (only last is used).

cleanup rel_apply_rewriter some more.


diffs (truncated from 557 to 300 lines):

diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out 
b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
--- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
+++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
@@ -81,7 +81,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 
b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
--- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
+++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
@@ -81,7 +81,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out 
b/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
--- a/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
+++ b/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
@@ -37,7 +37,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 09:17:12 >  
 # 09:17:12 >  Done.
diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out 
b/sql/benchmarks/tpch/Tests/01-22.stable.out
--- a/sql/benchmarks/tpch/Tests/01-22.stable.out
+++ b/sql/benchmarks/tpch/Tests/01-22.stable.out
@@ -81,7 +81,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 
b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
@@ -81,7 +81,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/Tests/02.stable.out 
b/sql/benchmarks/tpch/Tests/02.stable.out
--- a/sql/benchmarks/tpch/Tests/02.stable.out
+++ b/sql/benchmarks/tpch/Tests/02.stable.out
@@ -37,7 +37,7 @@ Ready.
 % rewrite, count # name
 % clob,int # type
 % 7,   1 # length
-[ "joinidx",   4   ]
+[ "joinidx",   7   ]
 
 # 09:17:12 >  
 # 09:17:12 >  Done.
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
@@ -1650,7 +1650,6 @@ rel_push_count_down(int *changes, mvc *s
 r && !r->exps && r->op == op_join && !(rel_is_ref(r)) &&
 ((sql_exp *) rel->exps->h->data)->type == e_aggr &&
 strcmp(((sql_subaggr *) ((sql_exp *) 
rel->exps->h->data)->f)->aggr->base.name, "count") == 0) {
-/* TODO check for count(*) */
sql_exp *nce, *oce;
sql_rel *gbl, *gbr; /* Group By */
sql_rel *cp;/* Cross Product */
@@ -3631,97 +3630,6 @@ rel_push_aggr_down(int *changes, mvc *sq
 }
 
 /*
- * Rewrite group(project(join(A,Dict)[a.i==dict.i])[...dict.n])[dict.n][ ... 
dict.n ]
- * into
- * project(join(groupby (A)[a.i],[a.i]), Dict)[a.i==dict.i])[dict.n] 
- *
- */
-
-static sql_rel *
-rel_push_groupby_down(int *changes, mvc *sql, sql_rel *rel) 
-{
-   sql_rel *p = rel->l, *j = rel->l;
-   list *gbe = rel->r;
-
-   if (rel->op == op_groupby && gbe && p && p->op == op_project) {
-   sql_rel *j = p->l;
-   sql_rel *jl, *jr;
-   node *n;
-
-   if (!j || j->op != op_join || list_length(j->exps) != 1)
-   return rel;
-   jl = j->l

MonetDB: Dec2016 - Backout changeset 3a9afb7a8637 and fix proble...

2017-04-12 Thread Sjoerd Mullender
Changeset: 9a90322010d7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9a90322010d7
Modified Files:
gdk/gdk_bbp.c
monetdb5/mal/mal_stack.c
Branch: Dec2016
Log Message:

Backout changeset 3a9afb7a8637 and fix problem in a better way.
When freeing a MAL stack, we need to also unfix BATs.


diffs (33 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1739,13 +1739,11 @@ BBPexit(void)
bat tp = VIEWtparent(b);
bat vtp = VIEWvtparent(b);
if (tp) {
-   if (BBP_desc(tp))
-   
BBP_desc(tp)->batSharecnt--;
+   
BBP_cache(tp)->batSharecnt--;
--BBP_lrefs(tp);
}
if (vtp) {
-   if (BBP_desc(vtp))
-   
BBP_desc(vtp)->batSharecnt--;
+   
BBP_cache(vtp)->batSharecnt--;
--BBP_lrefs(vtp);
}
VIEWdestroy(b);
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
@@ -109,6 +109,10 @@ clearStack(MalStkPtr s)
GDKfree(v->val.pval);
v->vtype = 0;
v->val.pval = NULL;
+   } else if (BATatoms[v->vtype].atomUnfix) {
+   BATatoms[v->vtype].atomUnfix(VALget(v));
+   v->vtype = 0;
+   v->val.pval = NULL;
}
s->stkbot = 0;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Dec2016 - BAT ids are positive, no need for abs.

2017-04-12 Thread Sjoerd Mullender
Changeset: f08081aa3791 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f08081aa3791
Modified Files:
gdk/gdk_batop.c
gdk/gdk_logger.c
Branch: Dec2016
Log Message:

BAT ids are positive, no need for abs.


diffs (25 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -71,8 +71,7 @@ insert_string_bat(BAT *b, BAT *n, int fo
 
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));
+   assert(b->batRole == TRANSIENT || b->tvheap->parentid == b->batCacheid);
if (n->batCount == 0)
return GDK_SUCCEED;
ni = bat_iterator(n);
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1249,7 +1249,7 @@ bm_subcommit(logger *lg, BAT *list_bid, 
name,
(list_bid == catalog_bid) ? 
BUNtvar(iter, p) : "snapshot");
assert(BBPindex(name));
-   n[i++] = abs(BBPindex(name));
+   n[i++] = BBPindex(name);
}
}
/* now commit catalog, so it's also up to date on disk */
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Dec2016 - Test dependency.

2017-04-12 Thread Sjoerd Mullender
Changeset: 252c70ae7fa4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=252c70ae7fa4
Modified Files:
sql/test/sql_xml/Tests/xml.reqtests
Branch: Dec2016
Log Message:

Test dependency.


diffs (6 lines):

diff --git a/sql/test/sql_xml/Tests/xml.reqtests 
b/sql/test/sql_xml/Tests/xml.reqtests
--- a/sql/test/sql_xml/Tests/xml.reqtests
+++ b/sql/test/sql_xml/Tests/xml.reqtests
@@ -1,1 +1,2 @@
 funcs
+load
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Dec2016 branch.

2017-04-12 Thread Sjoerd Mullender
Changeset: 605c3f65cc7a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=605c3f65cc7a
Modified Files:
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_logger.c
gdk/gdk_orderidx.c
monetdb5/mal/mal_stack.c
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out
sql/benchmarks/tpch/Tests/01-22.stable.out.int128
sql/benchmarks/tpch/Tests/02.stable.out
sql/server/rel_optimizer.c
sql/server/rel_updates.c
sql/storage/store.c
sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
sql/test/sql_xml/Tests/xml.reqtests
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 593 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
@@ -74,8 +74,7 @@ insert_string_bat(BAT *b, BAT *n, BAT *s
 
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));
+   assert(b->batRole == TRANSIENT || b->tvheap->parentid == b->batCacheid);
if (n->batCount == 0 || (s && s->batCount == 0))
return GDK_SUCCEED;
ni = bat_iterator(n);
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1297,7 +1297,7 @@ bm_subcommit(logger *lg, BAT *list_bid, 
name,
(list_bid == catalog_bid) ? 
BUNtvar(iter, p) : "snapshot");
assert(BBPindex(name));
-   n[i++] = abs(BBPindex(name));
+   n[i++] = BBPindex(name);
}
}
/* now commit catalog, so it's also up to date on disk */
diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -173,6 +173,7 @@ BATorderidx(BAT *b, int stable)
oid *restrict mv;
oid seq;
BUN p, q;
+   BAT *bn = NULL;
 
if (BATcheckorderidx(b))
return GDK_SUCCEED;
@@ -195,7 +196,7 @@ BATorderidx(BAT *b, int stable)
if (!BATtdense(b)) {
/* we need to sort a copy of the column so as not to
 * change the original */
-   BAT *bn = COLcopy(b, b->ttype, TRUE, TRANSIENT);
+   bn = COLcopy(b, b->ttype, TRUE, TRANSIENT);
if (bn == NULL) {
HEAPfree(m, 1);
GDKfree(m);
@@ -219,7 +220,11 @@ BATorderidx(BAT *b, int stable)
 BATcount(bn), Tsize(bn), SIZEOF_OID,
 bn->ttype);
}
-   BBPunfix(bn->batCacheid);
+   /* we must unfix after releasing the lock since we
+* might get deadlock otherwise (we're holding a lock
+* based on b->batCacheid; unfix tries to get a lock
+* based on bn->batCacheid, usually but (crucially)
+* not always a different lock) */
}
 
b->torderidx = m;
@@ -227,6 +232,9 @@ BATorderidx(BAT *b, int stable)
persistOIDX(b);
MT_lock_unset(&GDKhashLock(b->batCacheid));
 
+   if (bn)
+   BBPunfix(bn->batCacheid);
+
return GDK_SUCCEED;
 }
 
@@ -514,7 +522,10 @@ OIDXdestroy(BAT *b)
Heap *hp;
 
MT_lock_set(&GDKhashLock(b->batCacheid));
-   if ((hp = b->torderidx) == (Heap *) 1) {
+   hp = b->torderidx;
+   b->torderidx = NULL;
+   MT_lock_unset(&GDKhashLock(b->batCacheid));
+   if (hp == (Heap *) 1) {
GDKunlink(BBPselectfarm(b->batRole, b->ttype, 
orderidxheap),
  BATDIR,
  BBP_physical(b->batCacheid),
@@ -523,7 +534,5 @@ OIDXdestroy(BAT *b)
HEAPdelete(hp, BBP_physical(b->batCacheid), 
"torderidx");
GDKfree(hp);
}
-   b->torderidx = NULL;
-   MT_lock_unset(&GDKhashLock(b->batCacheid));
}
 }
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
@@ -115,6 +115,10 @@ clearStack(MalStkPtr s)
GDKfree(v->val.pval);
v->vtype = 0;
v->val.pval = NULL;
+   } else if (BATatoms[v->vtype].atomUnfix) {
+   BATatoms[v->vtype].atomUnfix(VALget(v));
+   v->vtype = 0;
+   v->val.pval = NULL;
}
s->stk

MonetDB: malparsing - Avoid too early flush

2017-04-12 Thread Martin Kersten
Changeset: 4ee6ba939d04 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ee6ba939d04
Modified Files:
monetdb5/mal/mal_scenario.c
Branch: malparsing
Log Message:

Avoid too early flush

The flush should only be called on end of block, ie for the
stream (over the socket etc) protocol this sends the prompt etc.
So should be called only once after each statement output/resultset
is fully send.


diffs (19 lines):

diff --git a/monetdb5/mal/mal_scenario.c b/monetdb5/mal/mal_scenario.c
--- a/monetdb5/mal/mal_scenario.c
+++ b/monetdb5/mal/mal_scenario.c
@@ -574,14 +574,11 @@ runScenarioBody(Client c)
wrapup:
if (msg != MAL_SUCCEED){
mnstr_printf(c->fdout,"!%s%s",msg, (msg[strlen(msg)-1] 
== '\n'? "":"\n"));
-   mnstr_flush(c->fdout);
freeException(msg);
msg = MAL_SUCCEED;
}
-   if( GDKerrbuf && GDKerrbuf[0]){
+   if( GDKerrbuf && GDKerrbuf[0])
mnstr_printf(c->fdout,"!GDKerror: %s\n",GDKerrbuf);
-   mnstr_flush(c->fdout);
-   }
assert(c->curprg->def->errors == NULL);
c->actions++;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Eat away text upon encountering a parsing ...

2017-04-12 Thread Martin Kersten
Changeset: 01456e1a1701 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01456e1a1701
Modified Files:
monetdb5/mal/mal_parser.c
Branch: malparsing
Log Message:

Eat away text upon encountering a parsing error
After a parse error we skip to the next \n
before we attempt to parse again.


diffs (28 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
@@ -60,6 +60,7 @@ parseError(Client cntxt, str msg)
*s = ' ';
else
*s = *t;
+   cntxt->lineptr = t;
if( cntxt->line[strlen(cntxt->line)-1] =='\n')
strcat(new, "!");
else
@@ -778,7 +779,7 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
*curInstr = pushArgument(curBlk, *curInstr, idx);
} else if (*cntxt->lineptr == ':') {
tpe = typeElm(cntxt, TYPE_any);
-   if (tpe < 0)
+   if (tpe < 0 || cntxt->curprg->def->errors)
return 3;
setPolymorphic(*curInstr, tpe, FALSE);
idx = newTypeVariable(curBlk, tpe);
@@ -1294,6 +1295,7 @@ parseStatement(Client cntxt, int cntrl)
if (l == 0 ) {
parseError(cntxt, " expected\n");
freeInstruction(curInstr);
+   return;
}
GETvariable;
if (*cntxt->lineptr == ':') {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Properly format the exceptions during flow...

2017-04-12 Thread Martin Kersten
Changeset: 3366befb5d17 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3366befb5d17
Modified Files:
monetdb5/mal/mal_function.c
Branch: malparsing
Log Message:

Properly format the exceptions during flow checks


diffs (73 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
@@ -110,7 +110,7 @@ chkFlow(MalBlkPtr mb)
 
for(j=btop-1;j>=0;j--)
if( v==var[j]){
-   mb->errors = createMalException(mb,i,SYNTAX,
+   mb->errors = createMalException(mb,i,MAL,
"recursive %s[%d] shields %s[%d]",
getVarName(mb,v), pc[j],
getFcnName(mb),pc[i]);
@@ -122,12 +122,12 @@ chkFlow(MalBlkPtr mb)
case EXITsymbol:
v= getDestVar(p);
if( btop>0 && var[btop-1] != v){
-   mb->errors = createMalException( mb,i,SYNTAX,
+   mb->errors = createMalException( mb,i,MAL,
"exit-label '%s' doesnot match '%s'",
getVarName(mb,v), 
getVarName(mb,var[btop-1]));
}
if(btop==0){
-   mb->errors = createMalException(mb,i,SYNTAX,
+   mb->errors = createMalException(mb,i,MAL,
"exit-label '%s' without begin-label", 
getVarName(mb,v));
continue;
@@ -157,14 +157,14 @@ chkFlow(MalBlkPtr mb)
if( var[j]==v) break;
if(j<0){
str nme=getVarName(mb,v);
-   mb->errors = createMalException(mb,i,SYNTAX,
+   mb->errors = createMalException(mb,i,MAL,
"label '%s' not in guarded block", nme);
} 
break;
case YIELDsymbol:
{ InstrPtr ps= getInstrPtr(mb,0);
if( ps->token != FACTORYsymbol){
-   mb->errors = createMalException(mb,i,SYNTAX, "yield 
misplaced!");
+   mb->errors = createMalException(mb,i,MAL, "yield 
misplaced!");
}
yieldseen= TRUE;
 }
@@ -178,7 +178,7 @@ chkFlow(MalBlkPtr mb)
yieldseen = FALSE;/* always end 
with a return */
}
if (ps->retc != p->retc) {
-   mb->errors = createMalException( mb, i, 
SYNTAX,
+   mb->errors = createMalException( mb, i, 
MAL,
"invalid return 
target!");
} else 
if (ps->typechk == TYPE_RESOLVED)
@@ -207,7 +207,7 @@ chkFlow(MalBlkPtr mb)
/* do nothing */
} else if( i) {
str msg=instruction2str(mb,0,p,TRUE);
-   mb->errors = createMalException( 
mb,i,SYNTAX, "signature misplaced\n!%s",msg);
+   mb->errors = createMalException( 
mb,i,MAL, "signature misplaced\n!%s",msg);
GDKfree(msg);
}
}
@@ -437,6 +437,10 @@ cloneFunction(Module scope, Symbol proc,
/* beware, we should now ignore any cloning */
if (proc->def->errors == 0) {
chkProgram(scope,new->def);
+   if( new->def->errors){
+   mb->errors = new->def->errors;
+   new->def->errors = 0;
+   }
 #ifdef DEBUG_MAL_FCN
fprintFunction(stderr, new->def, 0, LIST_MAL_ALL);
 #endif
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Revert backup malblock for parsing

2017-04-12 Thread Martin Kersten
Changeset: 00c355592bac for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=00c355592bac
Modified Files:
monetdb5/mal/mal_client.c
monetdb5/mal/mal_client.h
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_session.c
Branch: malparsing
Log Message:

Revert backup malblock for parsing
The MAL function statements should be assembled in their own block
to avoid scoping issues.


diffs (242 lines):

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
@@ -215,6 +215,7 @@ MCinitClientRecord(Client c, oid user, b
c->mdb = 0;
c->history = 0;
c->curprg = 0;
+   c->backup = 0;
c->glb = 0;
 
/* remove garbage from previous connection 
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -148,6 +148,7 @@ typedef struct CLIENT {
Module  usermodule; /* private user scope */
Module  curmodule;  /* where to deliver the symbol, 
used by parser , only freed globally */
Symbol  curprg; /* container for the malparser */
+   Symbol  backup; /* saving the parser context for 
functions,commands/patterns */
MalStkPtr   glb;/* global variable stack */
/*
 * Some statistics on client behavior becomes relevant for server
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
@@ -956,7 +956,12 @@ fcnHeader(Client cntxt, int kind)
advance(cntxt, l);
} else 
modnme= cntxt->curmodule->name;
-   cntxt->curprg->name = fnme;
+
+if (cntxt->backup){
+parseError(cntxt, "mal_parser: unexpected recursion\n");
+return 0;
+}
+
 
if (*cntxt->lineptr != '('){
parseError(cntxt, "function header '(' expected\n");
@@ -964,13 +969,12 @@ fcnHeader(Client cntxt, int kind)
}
advance(cntxt, 1);
 
-   curInstr = getInstrPtr(cntxt->curprg->def,0);
-   setModuleId(curInstr,modnme);
-   setFunctionId(curInstr,fnme);
-   curInstr->token = kind;
-   cntxt->curprg->kind = kind;
+cntxt->backup = cntxt->curprg;
+cntxt->curprg = newFunction( modnme, fnme, kind);
+curBlk = cntxt->curprg->def;
+curInstr = getInstrPtr(curBlk, 0);
 
-   /* get calling parameters */
+   /*get calling parameters */
ch = *cntxt->lineptr;
while (ch != ')' && ch && !NL(ch)) {
curInstr = binding(cntxt, curBlk, curInstr, 1);
@@ -984,6 +988,11 @@ fcnHeader(Client cntxt, int kind)
if ((ch = *cntxt->lineptr) != ',') {
if (ch == ')')
break;
+if (cntxt->backup) {
+freeSymbol(cntxt->curprg);
+cntxt->curprg = cntxt->backup;
+cntxt->backup = 0;
+}
parseError(cntxt, "',' expected\n");
return 1;
} else
@@ -991,6 +1000,12 @@ fcnHeader(Client cntxt, int kind)
ch = *cntxt->lineptr;
}
if (*cntxt->lineptr != ')') {
+   if (cntxt->backup) {
+   freeSymbol(cntxt->curprg);
+   cntxt->curprg = cntxt->backup;
+   cntxt->backup = 0;
+   }
+
parseError(cntxt, "')' expected\n");
return 1;
}
@@ -1028,6 +1043,12 @@ fcnHeader(Client cntxt, int kind)
if ((ch = *cntxt->lineptr) != ',') {
if (ch == ')')
break;
+   if (cntxt->backup) {
+   freeSymbol(cntxt->curprg);
+   cntxt->curprg = cntxt->backup;
+   cntxt->backup = 0;
+   }
+
parseError(cntxt, "',' expected\n");
return 1;
} else {
@@ -1039,6 +1060,11 @@ fcnHeader(Client cntxt, int kind)
max = curInstr->maxarg;
newarg = (short *) GDKmalloc(max * sizeof(curInstr->argv[0]));
if (newarg == NULL){
+if (cntxt->backup) {
+freeSymbol(cntxt->curprg);
+cntxt->curprg = cntxt->backup;
+cntxt->backup = 0;
+}
parseError(cntxt, MAL_MALLOC_FAIL);
return 1;
}
@@ -1054,6 +1080,11 @@ fcnHeader(Client cntxt, int kind)
curInstr->argv[i1] = newarg[i1];
GDKfree(newarg);
if (*cntxt->lineptr != ')') {
+if (cntxt->backup) {
+freeSymb

MonetDB: malparsing - Fix the test

2017-04-12 Thread Martin Kersten
Changeset: 12b7acfa769d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=12b7acfa769d
Modified Files:
monetdb5/mal/Tests/pithole.malC
Branch: malparsing
Log Message:

Fix the test


diffs (9 lines):

diff --git a/monetdb5/mal/Tests/pithole.malC b/monetdb5/mal/Tests/pithole.malC
--- a/monetdb5/mal/Tests/pithole.malC
+++ b/monetdb5/mal/Tests/pithole.malC
@@ -1,2 +1,5 @@
 #challenge the runtime stack protection
+function user.main();
+   user.main();
+end main;
 user.main();
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Minor fixes

2017-04-12 Thread Martin Kersten
Changeset: 18c3dc3d5cf1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18c3dc3d5cf1
Modified Files:
monetdb5/mal/mal_import.c
monetdb5/mal/mal_parser.c
Branch: malparsing
Log Message:

Minor fixes


diffs (25 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
@@ -231,7 +231,7 @@ callString(Client cntxt, str s)
Client c;
str msg = MAL_SUCCEED;
 
-   c = MCinitClient((oid)0,0,cntxt->fdout);
+   c = MCinitClient((oid)0,cntxt->fdin,cntxt->fdout);
msg = compileString(c,s);
if( msg == MAL_SUCCEED)
runMAL(c, c->curprg->def,0,0);
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
@@ -1345,8 +1345,7 @@ parseStatement(Client cntxt, int cntrl)
l = idLength(cntxt);
if (l == 0 ) {
parseError(cntxt, " expected\n");
-   freeInstruction(curInstr);
-   return;
+   goto part3;
}
GETvariable;
if (*cntxt->lineptr == ':') {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Approve output

2017-04-12 Thread Martin Kersten
Changeset: b2e541d67b2d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2e541d67b2d
Modified Files:
monetdb5/mal/Tests/dynamicload.stable.err
monetdb5/mal/Tests/parseErrors.stable.err
monetdb5/mal/Tests/pithole.stable.err
monetdb5/mal/Tests/tst002.stable.err
monetdb5/mal/Tests/tst003.stable.err
monetdb5/mal/Tests/tst007.stable.err
monetdb5/mal/Tests/tst008.stable.err
monetdb5/mal/Tests/tst019.stable.err
monetdb5/mal/Tests/tst027.stable.err
monetdb5/mal/Tests/tst036.stable.err
monetdb5/mal/Tests/tst036.stable.out
monetdb5/mal/Tests/tst038.stable.err
monetdb5/mal/Tests/tst058.stable.err
monetdb5/mal/Tests/tst071.stable.err
monetdb5/mal/Tests/tst071.stable.out
monetdb5/mal/Tests/tst102.stable.err
monetdb5/mal/Tests/tst108.stable.err
monetdb5/mal/Tests/tst109.stable.err
monetdb5/mal/Tests/tst115.stable.err
monetdb5/mal/Tests/tst116.stable.err
monetdb5/mal/Tests/tst161.stable.err
monetdb5/mal/Tests/tst163.stable.err
monetdb5/mal/Tests/tst303.stable.err
monetdb5/mal/Tests/tst305.stable.err
monetdb5/mal/Tests/tst611.stable.err
monetdb5/mal/Tests/tst660.stable.err
monetdb5/mal/Tests/tst755.stable.err
monetdb5/mal/Tests/tst760.stable.err
monetdb5/mal/Tests/tst802.stable.out
monetdb5/mal/Tests/tst804.stable.err
monetdb5/mal/Tests/tst830.stable.out
monetdb5/mal/Tests/tst850.stable.out
monetdb5/mal/Tests/tst870.stable.out
monetdb5/mal/Tests/tst900.stable.err
monetdb5/mal/Tests/tst903.stable.out
monetdb5/optimizer/Tests/GCexample01.stable.out
monetdb5/optimizer/Tests/dataflow3.stable.out
monetdb5/optimizer/Tests/inline02.stable.out
monetdb5/optimizer/Tests/inline05.stable.out
monetdb5/optimizer/Tests/inline06.stable.out
monetdb5/optimizer/Tests/inline08.stable.out
monetdb5/optimizer/Tests/inline10.stable.out
monetdb5/optimizer/Tests/inline12.stable.out
monetdb5/optimizer/Tests/inlineIfthen.stable.out
monetdb5/optimizer/Tests/projectionchain.stable.out
monetdb5/optimizer/Tests/remap.stable.out
monetdb5/optimizer/Tests/tst4000.stable.out
monetdb5/optimizer/Tests/tst4003.stable.out
monetdb5/optimizer/Tests/tst4004.stable.out
monetdb5/optimizer/Tests/tst4006.stable.out
monetdb5/optimizer/Tests/tst4010.stable.out
Branch: malparsing
Log Message:

Approve output
The new error reporting affects the format of messages


diffs (truncated from 1051 to 300 lines):

diff --git a/monetdb5/mal/Tests/dynamicload.stable.err 
b/monetdb5/mal/Tests/dynamicload.stable.err
--- a/monetdb5/mal/Tests/dynamicload.stable.err
+++ b/monetdb5/mal/Tests/dynamicload.stable.err
@@ -91,10 +91,12 @@ QUERY = # examples of non-bindable instr
 comment "Should not be callable";
 
 wrong();
-ERROR = !TypeException:user.main[3]:object code for command user.wrong missing
-!TypeException:user.main[3]:'user.wrong' undefined in: 
user.wrong();
+ERROR = !SyntaxException:include UNKNOWlib;
+!SyntaxException:^18 MALException:mal.import:#WARNING: could not open 
file: UNKNOWlib
+!TypeException:user.main[1]:object code for command user.wrong missing
+!TypeException:user.main[1]:'user.wrong' undefined in: 
user.wrong();
 
-# 13:26:24 >  
-# 13:26:24 >  "Done."
-# 13:26:24 >  
+# 16:33:26 >  
+# 16:33:26 >  "Done."
+# 16:33:26 >  
 
diff --git a/monetdb5/mal/Tests/parseErrors.stable.err 
b/monetdb5/mal/Tests/parseErrors.stable.err
--- a/monetdb5/mal/Tests/parseErrors.stable.err
+++ b/monetdb5/mal/Tests/parseErrors.stable.err
@@ -16,10 +16,8 @@ MAPI  = (monetdb) /var/tmp/mtest-13954/.
 QUERY = K := :=
 io.print(1);
 io.print(2);
-ERROR = !SyntaxException:parseError:K := :=
-!SyntaxException:parseError: ^Type identifier expected
-!SyntaxException:parseError:K := :=
-!SyntaxException:parseError: ^';' expected
+ERROR = !SyntaxException:K := := io.print(1);
+!SyntaxException:^6 Type identifier expected
 
 # 21:00:37 >  
 # 21:00:37 >  "Done."
diff --git a/monetdb5/mal/Tests/pithole.stable.err 
b/monetdb5/mal/Tests/pithole.stable.err
--- a/monetdb5/mal/Tests/pithole.stable.err
+++ b/monetdb5/mal/Tests/pithole.stable.err
@@ -68,6 +68,9 @@ stderr of test 'pithole` in directory 'm
 
 MAPI  = (monetdb) /var/tmp/mtest-13954/.s.monetdb.38078
 QUERY = #challenge the runtime stack protection
+function user.main();
+   user.main();
+end main;
 user.main();
 ERROR = !MALException:mal.interpreter:Recursive call limit reached.
 
diff --git a/monetdb5/mal/Tests/tst002.stable.err 
b/monetdb5/mal/Tests/tst002.stable.err
--- a/monetdb5/mal/Tests/tst002.stable.err
+++ b/monetdb5/mal/Tests/tst002.stable.err
@@ -38,10 

MonetDB: protocol - Merge with default.

2017-04-12 Thread Mark Raasveldt
Changeset: cc9f01720b29 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc9f01720b29
Added Files:
sql/backends/monet5/UDF/pyapi3/50_pyapi3.mal
sql/backends/monet5/UDF/pyapi3/Makefile.ag
sql/backends/monet5/UDF/pyapi3/Tests/All
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_00.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_00.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_00.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_01.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_01.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_01.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_02.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_02.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_02.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_03.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_03.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_03.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_04.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_04.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_04.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_05.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_05.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_05.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_06.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_06.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_06.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_07.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_07.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_07.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_11.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_11.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_11.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_12.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_12.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_12.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_13.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_13.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_13.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_15.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_16.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_16.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_16.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_18.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_18.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_18.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_21.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_21.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_21.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_23.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_23.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_23.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_24.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_24.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_24.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_26.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_26.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_26.stable.out
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_27.SQL.sh
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_27.stable.err
sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_27.stable.out

MonetDB: protocol - Remove unnecessary old code.

2017-04-12 Thread Mark Raasveldt
Changeset: bdd217b49f23 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bdd217b49f23
Removed Files:
common/utils/conversion.c
common/utils/conversion.h
Modified Files:
bootstrap
clients/mapiclient/Tests/mclient--help.stable.err
clients/mapilib/Makefile.ag
clients/odbc/driver/ODBCConvert.c
common/stream/stream.h
common/utils/Makefile.ag
configure.ag
gdk/Makefile.ag
gdk/gdk_atoms.c
sql/backends/monet5/Makefile.ag
sql/backends/monet5/Tests/All
sql/backends/monet5/sql_result.c

sql/test/BugTracker-2015/Tests/crash_timestamp_convert.Bug-3816.stable.out
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/Tests/rand_not_executed_for_every_row.SF-1723791.stable.out
sql/test/bugs/Tests/object_name-bug-sf-985242.stable.out
sql/test/mapi/Tests/utf8test.stable.out

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

Remove unnecessary old code.


diffs (truncated from 1264 to 300 lines):

diff --git a/bootstrap b/bootstrap
--- a/bootstrap
+++ b/bootstrap
@@ -59,6 +59,3 @@ autoconf
 if [ -f buildtools/conf/install-sh -a ! -x buildtools/conf/install-sh ]; then
 chmod +x buildtools/conf/install-sh
 fi
-
-
-# protoc-c common/stream/mhapi.proto --c_out .
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err 
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -20,7 +20,7 @@ Options are:
  -e  | --echoecho the query
  -E charset  | --encoding=charset specify encoding (character set) of the 
terminal
  -f kind | --format=kind  specify output format {csv,tab,raw,sql,xml}
- -H  | --history  load/save cmdline history (default off)
+ -H  | --history load/save cmdline history (default off)
  -i  | --interactive[=tm] interpret `\' commands on stdin, use time 
formatting {ms,s,m}
  -l language | --language=lang{sql,mal}
  -L logfile  | --log=logfile save client/server interaction
diff --git a/clients/mapilib/Makefile.ag b/clients/mapilib/Makefile.ag
--- a/clients/mapilib/Makefile.ag
+++ b/clients/mapilib/Makefile.ag
@@ -14,7 +14,6 @@ lib_mapi = {
SOURCES = mapi.c mapi.rc
LIBS = $(SOCKET_LIBS) ../../common/stream/libstream \
../../common/options/libmoptions \
-   ../../common/utils/libconversion \
../../common/utils/libmcrypt $(openssl_LIBS)
 }
 
diff --git a/clients/odbc/driver/ODBCConvert.c 
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -1088,6 +1088,7 @@ ODBCFetch(ODBCStmt *stmt,
 
/* see SQLExecute.c for possible types */
switch (sql_type) {
+   case SQL_DECIMAL:
case SQL_TINYINT:
case SQL_SMALLINT:
case SQL_INTEGER:
@@ -1138,7 +1139,6 @@ ODBCFetch(ODBCStmt *stmt,
break;
}
break;
-   case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_REAL:
if (!parsedouble(data, &fval)) {
@@ -1338,6 +1338,7 @@ ODBCFetch(ODBCStmt *stmt,
*lenp = j;
break;
}
+   case SQL_DECIMAL:
case SQL_TINYINT:
case SQL_SMALLINT:
case SQL_INTEGER:
@@ -1376,7 +1377,6 @@ ODBCFetch(ODBCStmt *stmt,
}
break;
}
-   case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_REAL: {
data = (char *) ptr;
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -282,16 +282,6 @@ stream_export void bstream_destroy(bstre
 stream_export ssize_t bstream_read(bstream *s, size_t size);
 stream_export ssize_t bstream_next(bstream *s);
 
-/* Byte stream is a simple stream that sends a chunk of bytes prefixed
-   with a 64-bit integer describing the length of the chunk.
-
-   The maximum length of the byte stream must be specified upon
-   creation.
- */
-
-
-
-
 typedef enum mnstr_errors {
MNSTR_NO__ERROR = 0,
MNSTR_OPEN_ERROR,
diff --git a/common/utils/Makefile.ag b/common/utils/Makefile.ag
--- a/common/utils/Makefile.ag
+++ b/common/utils/Makefile.ag
@@ -30,9 +30,4 @@ lib_msabaoth = {
SOURCES = msabaoth.h msabaoth.c
 }
 
-lib_conversion = {
-   NOINST
-   SOURCES = conversion.h conversion.c
-}
-
 EXTRA_DIST = s_nextafterf.c math_private.h strptime.c

MonetDB: protocol - More old code removed.

2017-04-12 Thread Mark Raasveldt
Changeset: a1ec82b9c186 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1ec82b9c186
Modified Files:
sql/test/mapi/Tests/utf8test.SQL.py
Branch: protocol
Log Message:

More old code removed.


diffs (28 lines):

diff --git a/sql/test/mapi/Tests/utf8test.SQL.py 
b/sql/test/mapi/Tests/utf8test.SQL.py
--- a/sql/test/mapi/Tests/utf8test.SQL.py
+++ b/sql/test/mapi/Tests/utf8test.SQL.py
@@ -23,13 +23,13 @@ sys.stderr.write(err)
 out, err = client(['-s', "insert into utf8test values ('funny characters: 
%s')" % funny])
 sys.stdout.write(out)
 sys.stderr.write(err)
-out, err = client(['-fcsv', '-s', 'select * from utf8test'])
+out, err = client(['-fraw', '-s', 'select * from utf8test'])
 sys.stdout.write(out)
 sys.stderr.write(err)
 out, err = client(['-fsql', '-s', 'select * from utf8test'])
 sys.stdout.write(out)
 sys.stderr.write(err)
-out, err = client(['-fcsv', '-Eiso-8859-1', '-s', 'select * from utf8test'],
+out, err = client(['-fraw', '-Eiso-8859-1', '-s', 'select * from utf8test'],
   universal_newlines = False)
 out = out.decode('iso-8859-1')
 err = err.decode('iso-8859-1')
@@ -47,7 +47,7 @@ if sys.version_info[0] == 2:
 err = err.encode('utf-8')
 sys.stdout.write(out)
 sys.stderr.write(err)
-out, err = client(['-fcsv', '-Eus-ascii', '-s', 'select * from utf8test'],
+out, err = client(['-fraw', '-Eus-ascii', '-s', 'select * from utf8test'],
   universal_newlines = False)
 out = out.decode('us-ascii')
 err = err.decode('us-ascii')
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - Add back in some code that was accidently re...

2017-04-12 Thread Mark Raasveldt
Changeset: b6dd34110bff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b6dd34110bff
Modified Files:
gdk/gdk_atoms.h
sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

Add back in some code that was accidently removed.


diffs (103 lines):

diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -36,6 +36,30 @@
 #define atom_HASH(v,id,dst)((dst) ATOMhash(id, v))
 
 /*
+ * @- maximum atomic string lengths
+ */
+#define bitStrlen  8
+#define bteStrlen  8
+#define shtStrlen  12
+#define intStrlen  24
+#if SIZEOF_OID == SIZEOF_INT
+#define oidStrlen  24
+#else
+#define oidStrlen  48
+#endif
+#if SIZEOF_PTR == SIZEOF_INT
+#define ptrStrlen  24
+#else
+#define ptrStrlen  48
+#endif
+#define lngStrlen  48
+#ifdef HAVE_HGE
+#define hgeStrlen  96
+#endif
+#define fltStrlen  48
+#define dblStrlen  96
+
+/*
  * The system comes with the traditional atomic types: int (4 bytes),
  * bool(1 byte) and str (variable). In addition, we support the notion
  * of an OID type, which ensures uniqueness of its members.  This
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
@@ -23,6 +23,47 @@
 #define llabs(x)   ((x) < 0 ? -(x) : (x))
 #endif
 
+// stpcpy definition, for systems that do not have stpcpy
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+mystpcpy (char *yydest, const char *yysrc) {
+   char *yyd = yydest;
+   const char *yys = yysrc;
+
+   while ((*yyd++ = *yys++) != '\0')
+   continue;
+
+   return yyd - 1;
+}
+
+#ifdef _MSC_VER
+/* use intrinsic functions on Windows */
+#define short_int_SWAP(s)  ((short) _byteswap_ushort((unsigned short) (s)))
+/* on Windows, long is the same size as int */
+#define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s)))
+#define long_long_SWAP(l)  ((lng) _byteswap_uint64((unsigned __int64) (s)))
+#else
+#define short_int_SWAP(s) ((short)(((0x00ff&(s))<<8) | ((0xff00&(s))>>8)))
+
+#define normal_int_SWAP(i) (((0x00ff&(i))<<24) | ((0xff00&(i))<<8) | \
+   ((0x00ff&(i))>>8)  | ((0xff00&(i))>>24))
+#define long_long_SWAP(l) \
+   lng)normal_int_SWAP(l))<<32) |\
+(0x&normal_int_SWAP(l>>32)))
+#endif
+
+#ifdef HAVE_HGE
+#define huge_int_SWAP(h) \
+   hge)long_long_SWAP(h))<<64) |\
+(0x&long_long_SWAP(h>>64)))
+#endif
+
+static lng 
+mnstr_swap_lng(stream *s, lng lngval) {
+   return mnstr_byteorder(s) != 1234 ? long_long_SWAP(lngval) : lngval;
+}
+
 #define DEC_TOSTR(TYPE)
\
do {\
char buf[64];   \
@@ -1363,7 +1404,7 @@ mvc_export_table_prot10(backend *b, stre
BAT *b = BATdescriptor(c->b);
int mtype = b->ttype;
int typelen = ATOMsize(mtype);
-   int convert_to_string = 
!type_supports_binary_transfer(c->type.type) && b->ttype != TYPE_json;
+   int convert_to_string = 
!type_supports_binary_transfer(c->type.type);
sql_type *type = c->type.type;
 
iterators[i] = bat_iterator(b);
@@ -2040,7 +2081,7 @@ mvc_export_head_prot10(backend *b, strea
int nil_len = -1;
int nil_type = ATOMstorage(mtype);
int retval = -1;
-   int convert_to_string = 
!type_supports_binary_transfer(c->type.type) && b->ttype != TYPE_json;
+   int convert_to_string = 
!type_supports_binary_transfer(c->type.type);
sql_type *type = c->type.type;
lng print_width = -1;

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


MonetDB: Dec2016 - After NORMALIZE, range can be empty.

2017-04-12 Thread Sjoerd Mullender
Changeset: bd6083feb3f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd6083feb3f7
Added Files:
sql/test/BugTracker-2017/Tests/select.Bug-6259.sql
sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.err
sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.out
Modified Files:
gdk/gdk_select.c
sql/test/BugTracker-2017/Tests/All
Branch: Dec2016
Log Message:

After NORMALIZE, range can be empty.
This fixes bug 6259.


diffs (186 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1178,6 +1178,8 @@ BAT_scanselect(BAT *b, BAT *s, BAT *bn, 
th = &vh.v_##TYPE;  \
hval = 1;   \
}   \
+   if (*(TYPE*)tl > *(TYPE*)th)\
+   return newempty();  \
}   \
assert(lval);   \
assert(hval);   \
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
@@ -31,3 +31,4 @@ crash_after_oidx_on_sys_statistics.Bug-6
 crash_correlated_subqueries_in_select.Bug-6254
 fullouterjoinfilter.Bug-6256
 wrong_aggregation_count.Bug-6257
+select.Bug-6259
diff --git a/sql/test/BugTracker-2017/Tests/select.Bug-6259.sql 
b/sql/test/BugTracker-2017/Tests/select.Bug-6259.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/select.Bug-6259.sql
@@ -0,0 +1,14 @@
+start transaction;
+CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, 
col3 INTEGER, col4 FLOAT, col5 TEXT);
+INSERT INTO tab0 VALUES(0,45,106.20,'qixrh',119,127.82,'lqafj');
+INSERT INTO tab0 VALUES(1,47,107.11,'avveo',120,128.36,'tzjrc');
+INSERT INTO tab0 VALUES(2,48,108.0,'htssi',121,132.69,'ablzu');
+INSERT INTO tab0 VALUES(3,116,109.7,'hvapv',123,133.8,'azmay');
+INSERT INTO tab0 VALUES(4,55,110.92,'wffzp',124,134.70,'qjqzu');
+INSERT INTO tab0 VALUES(5,117,112.62,'hkmcc',126,135.82,'rfnvr');
+INSERT INTO tab0 VALUES(6,119,113.87,'yofgi',127,136.86,'jgucx');
+INSERT INTO tab0 VALUES(7,64,114.12,'clvcm',128,137.57,'bywfe');
+INSERT INTO tab0 VALUES(8,67,5.69,'htdpm',129,138.11,'tqmqj');
+INSERT INTO tab0 VALUES(9,121,115.87,'czgiu',130,139.21,'vqktb');
+SELECT pk FROM tab0 WHERE (col1 < 94.60) AND (col0 < 90) AND col3 >= 40 AND 
(col0 > 89);
+rollback;
diff --git a/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.err 
b/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.err
@@ -0,0 +1,36 @@
+stderr of test 'select.Bug-6259` in directory 'sql/test/BugTracker-2017` 
itself:
+
+
+# 21:05:48 >  
+# 21:05:48 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39824" "--set" 
"mapi_usock=/var/tmp/mtest-30774/.s.monetdb.39824" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2017"
 "--set" "embedded_r=yes" "--set" "embedded_py=true"
+# 21:05:48 >  
+
+# builtin opt  gdk_dbpath = /home/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 = 39824
+# cmdline opt  mapi_usock = /var/tmp/mtest-30774/.s.monetdb.39824
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/home/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
+
+# 21:05:49 >  
+# 21:05:49 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-30774" "--port=39824"
+# 21:05:49 >  
+
+
+# 21:05:49 >  
+# 21:05:49 >  "Done."
+# 21:05:49 >  
+
diff --git a/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.out 
b/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/select.Bug-6259.stable.out
@@ -0,0 +1,101 @@
+stdout of test 'select.Bug-6259` in directory 'sql/test/BugTracker-2017` 
itself:
+
+
+# 21:05:48 >  
+# 21:05:48 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39824" "--set" 
"mapi_usock=/var/tmp/mtest-30774/.s.monetdb.39824" "--set

MonetDB: malparsing - Fixing minor issues in the optimizers

2017-04-12 Thread Martin Kersten
Changeset: 34ab9bc4e0f9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=34ab9bc4e0f9
Modified Files:
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_generator.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_support.c
Branch: malparsing
Log Message:

Fixing minor issues in the optimizers


diffs (70 lines):

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
@@ -243,7 +243,7 @@ OPTevaluateImplementation(Client cntxt, 
 
 /* Defense line against incorrect plans */
/* Plan is unaffected */
-   // chkTypes(cntxt->usermodule, mb, FALSE);
+   chkTypes(cntxt->usermodule, mb, FALSE);
// chkFlow(mb);
// chkDeclarations(mb);
 
diff --git a/monetdb5/optimizer/opt_generator.c 
b/monetdb5/optimizer/opt_generator.c
--- a/monetdb5/optimizer/opt_generator.c
+++ b/monetdb5/optimizer/opt_generator.c
@@ -118,8 +118,7 @@ OPTgeneratorImplementation(Client cntxt,
errorCheck(p,algebraRef,getArg(p,2));
} else if ( getModuleId(p) == sqlRef && getFunctionId(p) ==  
putName("exportValue") && isaBatType(getArgType(mb,p,0)) ){
// interface expects scalar type only, not expressable 
in MAL signature
-   mb->errors++;
-   showException(cntxt->fdout, MAL, "generate_series", 
"internal error, generate_series is a table producing function");
+   mb->errors=createException(MAL, "generate_series", 
"internal error, generate_series is a table producing function");
}else if ( getModuleId(p) == batcalcRef && getFunctionId(p) == 
bteRef && series[getArg(p,1)] && p->argc == 2 ){
casting(bte);
} else if ( getModuleId(p) == batcalcRef && getFunctionId(p) == 
shtRef && series[getArg(p,1)] && p->argc == 2 ){
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
@@ -699,7 +699,7 @@ mat_joinNxM(Client cntxt, MalBlkPtr mb, 
 
if (split < 0) {
GDKfree(mats);
-   mb->errors++;
+   mb->errors= createException(MAL,"mergetable.join"," 
incorrect split level");
return ;
}
/* now detect split point */
@@ -1870,7 +1870,7 @@ OPTmergetableImplementation(Client cntxt
}
 #endif
 
-   if ( mb->errors == 0) {
+   if ( mb->errors == MAL_SUCCEED) {
for(i=0; ioptimize);
newComment(mb, buf);
}
-   if (msg != MAL_SUCCEED) {
-   mb->errors++;
-   }
if (cnt >= mb->stop)
throw(MAL, "optimizer.MALoptimizer", OPTIMIZER_CYCLE);
return msg;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Borrow the output channel while processing...

2017-04-12 Thread Martin Kersten
Changeset: ba13d859664f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ba13d859664f
Modified Files:
monetdb5/mal/mal_import.c
Branch: malparsing
Log Message:

Borrow the output channel while processing a file.


diffs (21 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
@@ -131,7 +131,7 @@ evalFile(Client cntxt, str fname, int li
 #ifdef _DEBUG_IMPORT_
fprintf(stderr,"load file %s using new 
client\n",files[i]);
 #endif
-   c = MCinitClient((oid)0,bstream_create(fd, 32 * 
BLOCK),0);
+   c = MCinitClient((oid)0,bstream_create(fd, 32 * BLOCK), 
cntxt->fdout);
c->curmodule = c->usermodule = userModule();
GDKfree(c->prompt);
c->prompt= NULL;
@@ -143,7 +143,7 @@ evalFile(Client cntxt, str fname, int li
c->listing = listing;
msg = runScenario(c);
}
-   c->fdout = NULL;// to avoid accidental closinf 
a default output channel
+   c->fdout = NULL;// to avoid accidental closing 
a default output channel
MCcloseClient(c);
}
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: malparsing - Approve output

2017-04-12 Thread Martin Kersten
Changeset: 26b7c9a13849 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=26b7c9a13849
Modified Files:
monetdb5/optimizer/Tests/ARexample.malC
monetdb5/optimizer/Tests/ARexample.stable.out
monetdb5/optimizer/Tests/CXexample.stable.out
monetdb5/optimizer/Tests/DCexample.stable.out
monetdb5/optimizer/Tests/dataflow.malC
monetdb5/optimizer/Tests/dataflow.stable.out
monetdb5/optimizer/Tests/dataflow4.stable.out
monetdb5/optimizer/Tests/ifthencst.malC
monetdb5/optimizer/Tests/ifthencst.stable.out
monetdb5/optimizer/Tests/inlineCst.malC
monetdb5/optimizer/Tests/inlineFunction1.malC
monetdb5/optimizer/Tests/inlineFunction1.stable.out
monetdb5/optimizer/Tests/manifold2.stable.out
monetdb5/optimizer/Tests/tst4001.malC
monetdb5/optimizer/Tests/tst4001.stable.out
monetdb5/optimizer/Tests/tst4630.stable.out
Branch: malparsing
Log Message:

Approve output


diffs (truncated from 458 to 300 lines):

diff --git a/monetdb5/optimizer/Tests/ARexample.malC 
b/monetdb5/optimizer/Tests/ARexample.malC
--- a/monetdb5/optimizer/Tests/ARexample.malC
+++ b/monetdb5/optimizer/Tests/ARexample.malC
@@ -11,6 +11,6 @@ redo go:= i<2;
 exit go;
io.print(b);
 end;
-mdb.list("user","foo");
+mdb.List("user","foo");
 optimizer.aliases("user","foo");
-mdb.list("user","foo");
+mdb.List("user","foo");
diff --git a/monetdb5/optimizer/Tests/ARexample.stable.out 
b/monetdb5/optimizer/Tests/ARexample.stable.out
--- a/monetdb5/optimizer/Tests/ARexample.stable.out
+++ b/monetdb5/optimizer/Tests/ARexample.stable.out
@@ -27,28 +27,30 @@ Ready.
 # 15:36:17 >  "mclient" "-lmal" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-27236" "--port=37175"
 # 15:36:17 >  
 
-#mdb.list("user","foo");
-function user.foo():void;
-i := 0:int;
-barrier go := true;
-c := calc.+(i, 1:int);
-io.print("step");
-i := c;
-redo go := calc.<(i, 2:int);
-exit go;
-io.print("done");
-end user.foo;
-#mdb.list("user","foo");
-function user.foo():void;
-i := 0:int;
-barrier go := true;
-c := calc.+(i, 1:int);
-io.print("step");
-i := c;
-redo go := calc.<(i, 2:int);
-exit go;
-io.print("done");
-end user.foo;
+function user.foo():void;  #[0] (0)  0 
+i:int := 0:int;#[1] (0)  1 <- 2 
+b:str := "done":str;   #[2] (0)  3 <- 4 
+barrier go:bit := true:bit;#[3] (0)  5 <- 6 
+c:int := calc.+(i:int, 1:int); #[4] (0) CMDvarADDsignal 7 <- 1 
8 
+d:str := "step":str;   #[5] (0)  9 <- 10 
+v:str := d:str;#[6] (0)  11 <- 9 
+io.print(v:str);   #[7] (0) IOprint_val 12 <- 11 
+i:int := c:int;#[8] (0)  1 <- 7 
+redo go:bit := calc.<(i:int, 2:int);   #[9] (0) CMDvarLT 5 <- 1 13 
+exit go:bit;   #[10] (0)  5 
+io.print(b:str);   #[11] (0) IOprint_val 14 <- 3 
+end user.foo;  #[12] (0)  
+function user.foo():void;  #[0] (0)  0 
+i:int := 0:int;#[1] (0)  1 <- 2 
+barrier go:bit := true:bit;#[2] (0)  5 <- 6 
+c:int := calc.+(i:int, 1:int); #[3] (0) CMDvarADDsignal 7 <- 1 
8 
+io.print("step":str);  #[4] (0) IOprint_val 12 <- 10 
+i:int := c:int;#[5] (0)  1 <- 7 
+redo go:bit := calc.<(i:int, 2:int);   #[6] (0) CMDvarLT 5 <- 1 13 
+exit go:bit;   #[7] (0)  5 
+io.print("done":str);  #[8] (0) IOprint_val 14 <- 4 
+end user.foo;  #[9] (0)  
+#aliases  actions= 3 time=5 usec 
 
 # 23:53:02 >  
 # 23:53:02 >  Done.
diff --git a/monetdb5/optimizer/Tests/CXexample.stable.out 
b/monetdb5/optimizer/Tests/CXexample.stable.out
--- a/monetdb5/optimizer/Tests/CXexample.stable.out
+++ b/monetdb5/optimizer/Tests/CXexample.stable.out
@@ -31,9 +31,13 @@ function user.foo():void;   
 b:bat[:int] := bat.new(:int);  #[1] (0) CMDBATnew 1 <- 2 
 c:bat[:int] := bat.new(:int);  #[2] (0) CMDBATnew 3 <- 2 
 d:bat[:oid] := algebra.select(b:bat[:int], 0:int, 100:int, true:bit, 
true:bit, false:bit); #[3] (0) ALGselect1 4 <- 1 5 6 7 8 9 
-l:int := calc.+(24:int, 27:int);   #[4] (0) CMDvarADDsignal 15 <- 
12 14 
-l3:int := calc.+(l:int, 24:int);   #[5] (0) CMDvarADDsignal 17 <- 
15 12 
-end user.foo;  #[6] (0)  
+e:bat[:oid] := algebra.select(b:bat[:int], 0:int, 100:int, true:bit, 
true:bit, false:bit); #[4] (0) ALGselect1 10 <- 1 5 6 7 7 9 
+k1:int := 24:int;  #[5] (0)  11 <- 12 
+k2:int := 27:int;