MonetDB: default - merged with oct2014

2015-06-07 Thread Niels Nes
Changeset: 35b25e60b302 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=35b25e60b302
Added Files:
sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.sql
sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.stable.err
sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.stable.out
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/BugTracker-2015/Tests/All
Branch: default
Log Message:

merged with oct2014


diffs (166 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -616,6 +616,18 @@ exp_bin(mvc *sql, sql_exp *e, stmt *left
s = exp_bin(sql, n->data, left, right, grp, 
ext, cnt, sel1); 
if (!s) 
return s;
+   if (sel1 && sel1->nrcols == 0 && s->nrcols == 
0) {
+   sql_subtype *bt = 
sql_bind_localtype("bit");
+   sql_subfunc *f = sql_bind_func(sql->sa, 
sql->session->schema, "and", bt, bt, F_FUNC);
+   assert(f);
+   s = stmt_binop(sql->sa, sel1, s, f);
+   }
+   if (sel1 && sel1->nrcols && s->nrcols == 0) {
+   stmt *predicate = 
bin_first_column(sql->sa, left);
+   
+   predicate = stmt_const(sql->sa, 
predicate, stmt_bool(sql->sa, 1));
+   s = stmt_uselect(sql->sa, predicate, s, 
cmp_equal, sel1);
+   }
sel1 = s;
}
l = e->r;
@@ -623,6 +635,18 @@ exp_bin(mvc *sql, sql_exp *e, stmt *left
s = exp_bin(sql, n->data, left, right, grp, 
ext, cnt, sel2); 
if (!s) 
return s;
+   if (sel2 && sel2->nrcols == 0 && s->nrcols == 
0) {
+   sql_subtype *bt = 
sql_bind_localtype("bit");
+   sql_subfunc *f = sql_bind_func(sql->sa, 
sql->session->schema, "and", bt, bt, F_FUNC);
+   assert(f);
+   s = stmt_binop(sql->sa, sel2, s, f);
+   }
+   if (sel2 && sel2->nrcols && s->nrcols == 0) {
+   stmt *predicate = 
bin_first_column(sql->sa, left);
+   
+   predicate = stmt_const(sql->sa, 
predicate, stmt_bool(sql->sa, 1));
+   s = stmt_uselect(sql->sa, predicate, s, 
cmp_equal, sel2);
+   }
sel2 = s;
}
if (sel1->nrcols == 0 && sel2->nrcols == 0) {
diff --git a/sql/test/BugTracker-2015/Tests/All 
b/sql/test/BugTracker-2015/Tests/All
--- a/sql/test/BugTracker-2015/Tests/All
+++ b/sql/test/BugTracker-2015/Tests/All
@@ -33,3 +33,4 @@ adddrop_unknown_table.Bug-3718
 schema_view.Bug-3708
 outerjoin_project.Bug-3725
 left_shift_inet.Bug-3730
+true_or_predicate.Bug-3733
diff --git a/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.sql 
b/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.sql
@@ -0,0 +1,8 @@
+create table test (c1 int);
+insert into test values(1);
+SELECT * FROM test WHERE (true OR c1 = 3) AND c1 = 2; 
+SELECT * FROM test WHERE (true OR c1 = 3) AND c1 = 1; 
+SELECT * FROM test WHERE (false OR c1 = 3) AND c1 = 2; 
+SELECT * FROM test WHERE (false OR c1 = 3) AND c1 = 1; 
+drop table test;
+
diff --git 
a/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.stable.err 
b/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/true_or_predicate.Bug-3733.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'true_or_predicate.Bug-3733` in directory 
'sql/test/BugTracker-2015` itself:
+
+
+# 14:03:53 >  
+# 14:03:53 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31324" "--set" 
"mapi_usock=/var/tmp/mtest-19512/.s.monetdb.31324" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015"
 "--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 14:03:53 >  
+
+# builtin opt  gdk_dbpath = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm/demo
+# builtin op

MonetDB: default - merged with Oct2014

2015-05-20 Thread Niels Nes
Changeset: 3af9813c28c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3af9813c28c6
Modified Files:
gdk/gdk_group.c
monetdb5/optimizer/opt_pushselect.c
sql/test/testdb-upgrade-chain/Tests/package.py
sql/test/testdb/Tests/testdb-package.py
Branch: default
Log Message:

merged with Oct2014


diffs (110 lines):

diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -81,7 +81,7 @@
}   \
}   \
if (extents)\
-   exts[ngrp] = b->hseqbase + (oid) (p - r);   \
+   exts[ngrp] = hseqb + (oid) (p - r); \
if (histo)  \
cnts[ngrp] = 1; \
ngrps[p - r] = ngrp;\
@@ -369,7 +369,7 @@ BATgroup_internal(BAT **groups, BAT **ex
int t;
int (*cmp)(const void *, const void *);
const oid *grps = NULL;
-   oid *restrict ngrps, ngrp, prev = 0;
+   oid *restrict ngrps, ngrp, prev = 0, hseqb = 0;
oid *restrict exts = NULL;
wrd *restrict cnts = NULL;
BUN p, q, r;
@@ -402,6 +402,7 @@ BATgroup_internal(BAT **groups, BAT **ex
/* we want our output to go somewhere */
assert(groups != NULL);
 
+   hseqb = b->hseqbase;
if (b->tkey || BATcount(b) <= 1 || (g && (g->tkey || BATtdense(g {
/* grouping is trivial: 1 element per group */
ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT ","
@@ -784,6 +785,7 @@ BATgroup_internal(BAT **groups, BAT **ex
BAT *b2 = BBPdescriptor(-parent);
lo = (BUN) ((b->T->heap.base - b2->T->heap.base) >> 
b->T->shift) + BUNfirst(b);
hi = lo + BATcount(b);
+   hseqb = b->hseqbase;
b = b2;
bi = bat_iterator(b);
} else {
diff --git a/monetdb5/optimizer/opt_pushselect.c 
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -114,6 +114,20 @@ lastbat_arg(MalBlkPtr mb, InstrPtr p)
return 0;
 }
 
+/* check for updates inbetween assignment to variables newv and oldv */
+static int 
+no_updates(InstrPtr *old, int *vars, int oldv, int newv) 
+{
+   while(newv > oldv) {
+   InstrPtr q = old[vars[newv]];
+
+   if (isUpdateInstruction(q)) 
+   return 0;
+   newv = getArg(q, 1);
+   }
+   return 1;
+}
+
 int
 OPTpushselectImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci)
 {
@@ -170,9 +184,10 @@ OPTpushselectImplementation(Client cntxt
InstrPtr q = old[vars[subselects.tid[s]]];
int Qsname = getArg(q, 2), Qtname = getArg(q, 
3);
 
-   if ((sname == Qsname && tname == Qtname) ||
+   if (no_updates(old, vars, getArg(q,1), 
getArg(p,1)) &&
+   ((sname == Qsname && tname == Qtname) ||
(0 && strcmp(getVarConstant(mb, 
sname).val.sval, getVarConstant(mb, Qsname).val.sval) == 0 &&
-strcmp(getVarConstant(mb, tname).val.sval, 
getVarConstant(mb, Qtname).val.sval) == 0)) {
+strcmp(getVarConstant(mb, tname).val.sval, 
getVarConstant(mb, Qtname).val.sval) == 0))) {
clrFunction(p);
p->retc = 1;
p->argc = 2;
diff --git a/sql/test/testdb-upgrade-chain/Tests/package.py 
b/sql/test/testdb-upgrade-chain/Tests/package.py
--- a/sql/test/testdb-upgrade-chain/Tests/package.py
+++ b/sql/test/testdb-upgrade-chain/Tests/package.py
@@ -9,7 +9,13 @@ if not os.path.exists(db):
 print >> sys.stderr, 'database directory %s does not exist' % db
 sys.exit(1)
 
-f = open(os.path.join(db, 'bat', 'BACKUP', 'BBP.dir'), 'rU')
+try:
+f = open(os.path.join(db, 'bat', 'BACKUP', 'SUBCOMMIT', 'BBP.dir'), 'rU')
+except IOError:
+try:
+f = open(os.path.join(db, 'bat', 'BACKUP', 'BBP.dir'), 'rU')
+except IOError:
+f = open(os.path.join(db, 'bat', 'BBP.dir'), 'rU')
 hdr = f.readline()
 ptroid = f.readline()
 ptr, oid = ptroid.split()
diff --git a/sql/test/testdb/Tests/testdb-package.py 
b/sql/test/testdb/Tests/testdb-package.py
--- a/sql/test/testdb/Tests/testdb-package.py
+++ b/sql/test/testdb/Tests/testdb-package.py
@@ -8,7 +8,13 @@ if not os.path.exists(db):
 print >> sys.stderr, 'database directory %s does not exist' % db

MonetDB: default - merged with Oct2014

2015-05-15 Thread Niels Nes
Changeset: fb9e4d2ff8b6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb9e4d2ff8b6
Added Files:
sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql
sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err
sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out
sql/test/BugTracker-2015/Tests/crash_on_alter_set_not_null.Bug-3715.sql
sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.sql
sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.err
sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.out
Modified Files:
sql/server/rel_schema.c
sql/test/BugTracker-2015/Tests/All
Branch: default
Log Message:

merged with Oct2014


diffs (276 lines):

diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -1189,6 +1189,8 @@ rel_alter_table(mvc *sql, dlist *qname, 
if (rel_check_tables(sql, t, nnt) < 0)
return NULL;
cs_add(&nt->tables, nnt, TR_NEW); 
+   } else {
+   return sql_error(sql, 02, "42S02!ALTER TABLE: 
no such table '%s' in schema '%s'", ntname, s->base.name);
}
}
/* table drop table */
diff --git a/sql/test/BugTracker-2015/Tests/All 
b/sql/test/BugTracker-2015/Tests/All
--- a/sql/test/BugTracker-2015/Tests/All
+++ b/sql/test/BugTracker-2015/Tests/All
@@ -28,3 +28,5 @@ readonly.Bug-3709
 crash_on_alter_set_not_null.Bug-3715
 convert-to-bit.Bug-3719
 union_project.Bug-3723
+leftjoin.Bug-3720
+adddrop_unknown_table.Bug-3718
diff --git a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql 
b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql
@@ -0,0 +1,4 @@
+CREATE merge TABLE mt (i int);
+ALTER TABLE mt ADD TABLE blablah;
+ALTER TABLE mt DROP TABLE blablah;
+DROP TABLE mt;
diff --git 
a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err 
b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err
@@ -0,0 +1,40 @@
+stderr of test 'adddrop_unknown_table.Bug-3718` in directory 
'sql/test/BugTracker-2015` itself:
+
+
+# 12:45:37 >  
+# 12:45:37 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36769" "--set" 
"mapi_usock=/var/tmp/mtest-2012/.s.monetdb.36769" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015"
 "--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 12:45:37 >  
+
+# builtin opt  gdk_dbpath = 
/home/niels/scratch/rc-clean/Linux-x86_64/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 = 36769
+# cmdline opt  mapi_usock = /var/tmp/mtest-2012/.s.monetdb.36769
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015
+# cmdline opt  mal_listing = 0
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 12:45:38 >  
+# 12:45:38 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-2012" "--port=36769"
+# 12:45:38 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-2012/.s.monetdb.36769
+QUERY = ALTER TABLE mt ADD TABLE blablah;
+ERROR = !ALTER TABLE: no such table 'blablah' in schema 'sys'
+
+# 12:45:38 >  
+# 12:45:38 >  "Done."
+# 12:45:38 >  
+
diff --git 
a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out 
b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out
@@ -0,0 +1,35 @@
+stdout of test 'adddrop_unknown_table.Bug-3718` in directory 
'sql/test/BugTracker-2015` itself:
+
+
+# 12:45:37 >  
+# 12:45:37 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36769" "--set" 
"mapi_usock=/var/tmp/mtest-2012/.s.monetdb.36769" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015"
 "--set" "mal_listing=0" "--set" "embedded_r=yes"

MonetDB: default - Merged with Oct2014 branch.

2015-04-07 Thread Stefan Manegold
Changeset: 11c0c6cf614f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=11c0c6cf614f
Modified Files:
gdk/gdk_search.c
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (53 lines):

diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -98,10 +98,13 @@ HASHwidth(BUN hashsize)
 BUN
 HASHmask(BUN cnt)
 {
-   BUN m = 1 << 8; /* minimum size */
+   BUN m = 1 << 8; /* minimum size; == BATTINY */
 
+   /* find largest power of 2 smaller than cnt */
while (m + m < cnt)
m += m;
+   /* if cnt is more than 1/3 into the gap between m & 2*m,
+  double m */
if (m + m - cnt < 2 * (cnt - m))
m += m;
return m;
@@ -321,7 +324,7 @@ BAThash(BAT *b, BUN masksize)
if (b->T->hash == NULL) {
unsigned int tpe = ATOMbasetype(b->ttype);
BUN cnt = BATcount(b);
-   BUN mask;
+   BUN mask, maxmask = 0;
BUN p = BUNfirst(b), q = BUNlast(b), r;
Hash *h = NULL;
Heap *hp;
@@ -369,11 +372,12 @@ BAThash(BAT *b, BUN masksize)
mask = HASHmask(cnt);
} else {
/* dynamic hash: we start with
-* HASHmask(cnt/64); if there are too many
-* collisions we try HASHmask(cnt/16), then
-* HASHmask(cnt/4), and finally
+* HASHmask(cnt)/64; if there are too many
+* collisions we try HASHmask(cnt)/16, then
+* HASHmask(cnt)/4, and finally
 * HASHmask(cnt).  */
-   mask = HASHmask(cnt >> 6);
+   maxmask = HASHmask(cnt);
+   mask = maxmask >> 6;
p += (cnt >> 2);/* try out on first 25% of b */
if (p > q)
p = q;
@@ -453,7 +457,7 @@ BAThash(BAT *b, BUN masksize)
}
break;
}
-   } while (r < p && mask < cnt && (mask <<= 2));
+   } while (r < p && mask < maxmask && (mask <<= 2));
 
/* finish the hashtable with the current mask */
p = r;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2015-02-11 Thread Niels Nes
Changeset: cf7e72e10d2d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cf7e72e10d2d
Added Files:
sql/test/BugTracker-2015/Tests/negative_oid_crash.Bug-3667.sql
sql/test/BugTracker-2015/Tests/negative_oid_crash.Bug-3667.stable.err
sql/test/BugTracker-2015/Tests/negative_oid_crash.Bug-3667.stable.out
Modified Files:
sql/backends/monet5/UDF/Tests/udf-fuse.stable.out
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/vaults/fits.c
sql/benchmarks/ssbm/Tests/01-explain.stable.out
sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/02-explain.stable.out
sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128
sql/benchmarks/ssbm/Tests/03-explain.stable.out
sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128
sql/benchmarks/tpch/Tests/06-explain.stable.out
sql/benchmarks/tpch/Tests/06-explain.stable.out.int128
sql/benchmarks/tpch/Tests/14-explain.stable.out
sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
sql/benchmarks/tpch/Tests/17-explain.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out.int128
sql/benchmarks/tpch/Tests/19-explain.stable.out
sql/benchmarks/tpch/Tests/19-explain.stable.out.int128
sql/common/sql_types.c
sql/common/sql_types.h
sql/test/BugTracker-2015/Tests/All
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 494 to 300 lines):

diff --git a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out 
b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out
--- a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out
+++ b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out
@@ -30,7 +30,7 @@ Ready.
 % 73 # length
 function user.s2_1{autoCommit=true}(A0:bte,A1:bte):void;
 X_4 := udf.fuse(A0,A1);
-sql.exportValue(1,".L","fuse_single_value","smallint",16,0,6,X_4,"");
+sql.exportValue(1,".L","fuse_single_value","smallint",16,0,7,X_4,"");
 end s2_1;
 # querylog.define("explain select fuse(1,2);","default_pipe")
 #select fuse(1,2);
@@ -46,7 +46,7 @@ end s2_1;
 % 70 # length
 function user.s3_1{autoCommit=true}(A0:sht,A1:sht):void;
 X_4 := udf.fuse(A0,A1);
-sql.exportValue(1,".L","fuse_single_value","int",32,0,6,X_4,"");
+sql.exportValue(1,".L","fuse_single_value","int",32,0,7,X_4,"");
 end s3_1;
 # querylog.define("explain select fuse(1000,2000);","default_pipe")
 #select fuse(1000,2000);
@@ -62,7 +62,7 @@ end s3_1;
 % 76 # length
 function user.s4_1{autoCommit=true}(A0:int,A1:int):void;
 X_4 := udf.fuse(A0,A1);
-sql.exportValue(1,".L","fuse_single_value","bigint",64,0,6,X_4,"");
+sql.exportValue(1,".L","fuse_single_value","bigint",64,0,7,X_4,"");
 end s4_1;
 # querylog.define("explain select fuse(100,200);","default_pipe")
 #select fuse(100,200);
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1289,7 +1289,7 @@ rel2bin_table( mvc *sql, sql_rel *rel, l
l = sa_list(sql->sa);
for (argc = 0; argc < sql->argc; argc++) {
atom *a = sql->args[argc];
-   stmt *s = stmt_atom(sql->sa, a);
+   stmt *s = stmt_varnr(sql->sa, argc, &a->tpe);
char nme[16];
 
snprintf(nme, 16, "A%d", argc);
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
@@ -1393,7 +1393,7 @@ export_length(stream *s, int mtype, int 
}
ok = mvc_send_int(s, l);
}
-   } else if (eclass == EC_NUM) {
+   } else if (eclass == EC_NUM || eclass == EC_POS) {
count = 0;
if (bid) {
BAT *b = BATdescriptor(bid);
diff --git a/sql/backends/monet5/vaults/fits.c 
b/sql/backends/monet5/vaults/fits.c
--- a/sql/backends/monet5/vaults/fits.c
+++ b/sql/backends/monet5/vaults/fits.c
@@ -227,7 +227,7 @@ str FITSexportTable(Client cntxt, MalBlk
colname = (str *) GDKmalloc(columns * sizeof(str));
tform = (str *) GDKmalloc(columns * sizeof(str));
 
-   /*  mnstr_printf(GDKout,"Number of columns: %d\n", columns);*/
+   /*  fprintf(stderr,"Number of columns: %d\n", columns);*/
 
tables = mvc_bind_table(m, sch, "_tables");
col = mvc_bind_column(m, tables, "name");
@@ -274,7 +274,7 @@ str FITSexportTable(Client cntxt, MalBlk
nrows = store_funcs.count_col(tr, col, 1);
 
snprintf(filename,BUFSIZ,"\n%s.fit",tname);
-   mnstr_printf(GDKout, "Filename: %s\n", filename);
+   fprintf(stderr, "Filename: %s\n", filename);
 
remo

MonetDB: default - merged with Oct2014

2015-02-08 Thread Niels Nes
Changeset: 6103f5fbbf55 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6103f5fbbf55
Added Files:
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.sql
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.err
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.sql
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.stable.err
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.stable.out
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/atoms/inet.c
sql/backends/monet5/rel_bin.c
sql/server/rel_optimizer.c
sql/test/BugTracker-2015/Tests/All
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 706 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
@@ -1288,33 +1288,33 @@ int IDfromString(str src, int *len, iden
 str IDprelude(void *ret);
 int IDtoString(str *retval, int *len, identifier handle);
 str ILIKEsubjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, const str 
*esc, const bat *slid, const bat *srid, const bit *nil_matches, const lng 
*estimate);
-str INET_comp_CS(bit *retval, inet *val1, inet *val2);
-str INET_comp_CSE(bit *retval, inet *val1, inet *val2);
-str INET_comp_CW(bit *retval, inet *val1, inet *val2);
-str INET_comp_CWE(bit *retval, inet *val1, inet *val2);
-str INET_comp_EQ(bit *retval, inet *val1, inet *val2);
-str INET_comp_GE(bit *retval, inet *val1, inet *val2);
-str INET_comp_GT(bit *retval, inet *val1, inet *val2);
-str INET_comp_LE(bit *retval, inet *val1, inet *val2);
-str INET_comp_LT(bit *retval, inet *val1, inet *val2);
-str INET_comp_NEQ(bit *retval, inet *val1, inet *val2);
+str INET_comp_CS(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_CSE(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_CW(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_CWE(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_EQ(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_GE(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_GT(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_LE(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_LT(bit *retval, const inet *val1, const inet *val2);
+str INET_comp_NEQ(bit *retval, const inet *val1, const inet *val2);
 str INET_fromstr(inet *ret, str *s);
-str INET_inet(inet *d, inet *s);
-str INET_isnil(bit *retval, inet *val);
-str INETabbrev(str *retval, inet *val);
-str INETbroadcast(inet *retval, inet *val);
-int INETcompare(inet *l, inet *r);
-int INETfromString(str src, int *len, inet **retval);
-str INEThost(str *retval, inet *val);
-str INEThostmask(inet *retval, inet *val);
-str INETmasklen(int *retval, inet *val);
-str INETnetmask(inet *retval, inet *val);
-str INETnetwork(inet *retval, inet *val);
+str INET_inet(inet *d, const inet *s);
+str INET_isnil(bit *retval, const inet *val);
+str INETabbrev(str *retval, const inet *val);
+str INETbroadcast(inet *retval, const inet *val);
+int INETcompare(const inet *l, const inet *r);
+int INETfromString(const char *src, int *len, inet **retval);
+str INEThost(str *retval, const inet *val);
+str INEThostmask(inet *retval, const inet *val);
+str INETmasklen(int *retval, const inet *val);
+str INETnetmask(inet *retval, const inet *val);
+str INETnetwork(inet *retval, const inet *val);
 str INETnew(inet *retval, str *in);
 inet *INETnull(void);
-str INETsetmasklen(inet *retval, inet *val, int *mask);
-str INETtext(str *retval, inet *val);
-int INETtoString(str *retval, int *len, inet *handle);
+str INETsetmasklen(inet *retval, const inet *val, const int *mask);
+str INETtext(str *retval, const inet *val);
+int INETtoString(str *retval, int *len, const inet *handle);
 str INSPECTatom_names(bat *ret);
 str INSPECTatom_sizes(bat *ret);
 str INSPECTatom_sup_names(bat *ret);
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -67,31 +67,31 @@ typedef struct _inet {
 #define inet_export extern
 #endif
 
-inet_export int INETfromString(str src, int *len, inet **retval);
-inet_export int INETtoString(str *retval, int *len, inet *handle);
-inet_export int INETcompare(inet *l, inet *r);
-inet_export str INETnew(inet * retval, str *in);
-inet_export str INET_isnil(bit *retval, inet * val);
-inet_export str INET_comp_EQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_NEQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_GT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LE(bit *retval, inet * val1, inet *val2);
-inet_expor

MonetDB: default - merged with Oct2014

2015-01-25 Thread Niels Nes
Changeset: 9eb169473892 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9eb169473892
Added Files:
sql/test/BugTracker-2015/Tests/name_conflict.Bug-3650.sql
sql/test/BugTracker-2015/Tests/name_conflict.Bug-3650.stable.err
sql/test/BugTracker-2015/Tests/name_conflict.Bug-3650.stable.out
Modified Files:
sql/backends/monet5/sql.c
sql/backends/monet5/sql_statement.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
sql/test/BugTracker-2015/Tests/All
Branch: default
Log Message:

merged with Oct2014


diffs (241 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -443,7 +443,9 @@ create_table_or_view(mvc *sql, char *sna
 
for (n = t->columns.set->h; n; n = n->next) {
sql_column *c = n->data;
-   mvc_copy_column(sql, nt, c);
+   if (mvc_copy_column(sql, nt, c) == NULL)
+   throw(SQL, "sql.catalog", "CREATE TABLE: %s_%s_%s 
conflicts", s->base.name, t->base.name, c->base.name);
+
}
if (t->idxs.set) {
for (n = t->idxs.set->h; n; n = n->next) {
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -1744,8 +1744,6 @@ stack_push_children(sql_stack *stk, stmt
if (s->op2) {
if (s->op3)
stack_push_stmt(stk, s->op3, 1);
-   if (s->op3)
-   stack_push_stmt(stk, s->op3, 1);
stack_push_stmt(stk, s->op2, 1);
}
if (s->op1)
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -984,6 +984,12 @@ create_col(sql_trans *tr, sql_column *c)
sql_column *fc = NULL;
size_t cnt = 0;
 
+   /* Temp solutions for name conflicts */
+   log_bid bid = logger_find_bat(bat_logger, bat->name);
+
+   if (bid)
+   return LOG_ERR;
+
/* alter ? */
if (c->t->columns.set && (fc = c->t->columns.set->h->data) != 
NULL) 
cnt = count_col(tr, fc, 1);
@@ -1404,6 +1410,24 @@ empty_col(sql_column *c)
bat->ibase = BATcount(BBPquickdesc(bat->bid, 0));
if (bat->bid == bat->ibid)
bat->bid = copyBat(bat->ibid, type, 0);
+
+   /* make new bat persistent */
+   {
+   BAT *b = temp_descriptor(bat->bid);
+
+   assert(b->batRole == PERSISTENT);
+   if (b->batRole != PERSISTENT) {
+   bat->bid = copyBat(b->batCacheid, type, 0);
+   temp_destroy(b->batCacheid);
+   bat_destroy(b);
+   b = temp_descriptor(bat->bid);
+   }
+   bat_set_access(b, BAT_READ);
+   BATmode(b, PERSISTENT);
+   logger_add_bat(bat_logger, b, bat->name);
+   bat_destroy(b);
+
+   }
 }
 
 static void 
@@ -1418,6 +1442,22 @@ empty_idx(sql_idx *i)
bat->ibase = BATcount(BBPquickdesc(bat->bid, 0));
if (bat->bid == bat->ibid) 
bat->bid = copyBat(bat->ibid, type, 0);
+
+   /* make new bat persistent */
+   {
+   BAT *b = temp_descriptor(bat->bid);
+
+   if (b->batRole != PERSISTENT) {
+   bat->bid = copyBat(b->batCacheid, type, 0);
+   temp_destroy(b->batCacheid);
+   bat_destroy(b);
+   b = temp_descriptor(bat->bid);
+   }
+   bat_set_access(b, BAT_READ);
+   BATmode(b, PERSISTENT);
+   logger_add_bat(bat_logger, b, bat->name);
+   bat_destroy(b);
+   }
 }
 
 static BUN
@@ -1907,14 +1947,15 @@ tr_log_delta( sql_trans *tr, sql_delta *
 
(void)tr;
assert(tr->parent == gtrans);
+   ins = temp_descriptor(cbat->ibid);
+
if (cleared) 
log_bat_clear(bat_logger, cbat->name);
 
-   ins = temp_descriptor(cbat->ibid);
/* any inserts */
if (BUNlast(ins) > BUNfirst(ins)) {
assert(store_nr_active>0);
-   if (BUNlast(ins) > ins->batInserted && (store_nr_active != 1 || 
cbat->ibase || BATcount(ins) <= SNAPSHOT_MINSIZE))
+   if (BUNlast(ins) > ins->batInserted && (store_nr_active != 1 || 
cbat->ibase || BATcount(ins) <= SNAPSHOT_MINSIZE)) 
ok = log_bat(bat_logger, ins, cbat->name);
if (store_nr_active == 1 &&
!cbat->ibase && BATcount(ins) > SNAPSHOT_MINSIZE) {
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ 

MonetDB: default - merged with Oct2014

2014-12-17 Thread Niels Nes
Changeset: cb01027b8c86 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cb01027b8c86
Modified Files:
sql/backends/monet5/sql_gencode.c
Branch: default
Log Message:

merged with Oct2014


diffs (40 lines):

diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -331,6 +331,7 @@ static int
InstrPtr curInstr = 0;
Symbol backup = NULL;
stmt *s;
+   int old_argc = be->mvc->argc;
 
r = rel_optimizer(m, rel);
s = rel_bin(m, r);
@@ -365,7 +366,7 @@ static int
sql_subtype *t = tail_type(op);
int type = t->type->localtype;
int varid = 0;
-   char *nme = op->op3->op4.aval->data.val.sval;
+   char *nme = 
(op->op3)?op->op3->op4.aval->data.val.sval:op->cname;
 
varid = newVariable(curBlk, _STRDUP(nme), type);
curInstr = pushArgument(curBlk, curInstr, varid);
@@ -374,8 +375,10 @@ static int
}
}
 
+   be->mvc->argc = 0;
if (backend_dumpstmt(be, curBlk, s, 0) < 0)
return -1;
+   be->mvc->argc = old_argc;
/* SQL function definitions meant for inlineing should not be optimized 
before */
varSetProp(curBlk, getArg(curInstr, 0), sqlfunctionProp, op_eq, NULL);
addQueryToCache(c);
@@ -431,7 +434,7 @@ static int
sql_subtype *t = tail_type(op);
int type = t->type->localtype;
int varid = 0;
-   char *nme = op->op3->op4.aval->data.val.sval;
+   char *nme = 
(op->op3)?op->op3->op4.aval->data.val.sval:op->cname;
 
varid = newVariable(curBlk, _STRDUP(nme), type);
curInstr = pushArgument(curBlk, curInstr, varid);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with oct2014

2014-12-17 Thread Niels Nes
Changeset: 6330a12fca51 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6330a12fca51
Modified Files:
gdk/gdk_utils.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/mtime.h
monetdb5/modules/atoms/mtime.mal
monetdb5/optimizer/opt_pushselect.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_scenario.c
sql/server/rel_select.c
Branch: default
Log Message:

merged with oct2014


diffs (199 lines):

diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -1045,7 +1045,6 @@ GDKinit(opt *set, int setlen)
MT_lock_init(&GDKthreadLock, "GDKthreadLock");
MT_lock_init(&GDKtmLock, "GDKtmLock");
 #endif
-   (void) ATOMIC_TAS(GDKstopped, GDKstoppedLock, "GDKinit");
for (i = 0; i <= BBP_BATMASK; i++) {
MT_lock_init(&GDKbatLock[i].swap, "GDKswapLock");
MT_lock_init(&GDKbatLock[i].hash, "GDKhashLock");
@@ -1342,10 +1341,6 @@ GDKlockHome(void)
GDKfatal("GDKlockHome: Could not truncate %s\n", GDKLOCK);
fflush(GDKlockFile);
GDKlog(GDKLOGON);
-   /*
-* In shared mode, we allow more parties to join. Release the lock.
-*/
-   ATOMIC_CLEAR(GDKstopped, GDKstoppedLock, "");
 }
 
 static void
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -1963,6 +1963,13 @@ MTIMEdate_addmonths(date *ret, const dat
return MAL_SUCCEED;
 }
 
+str
+MTIMEdate_submonths(date *ret, const date *v, const int *delta)
+{
+   int mindelta = -(*delta);
+   return MTIMEdate_addmonths(ret, v, &mindelta);
+}
+
 /* returns the number of days between 'val1' and 'val2'. */
 str
 MTIMEdate_diff(int *ret, const date *v1, const date *v2)
diff --git a/monetdb5/modules/atoms/mtime.h b/monetdb5/modules/atoms/mtime.h
--- a/monetdb5/modules/atoms/mtime.h
+++ b/monetdb5/modules/atoms/mtime.h
@@ -175,6 +175,7 @@ mtime_export str MTIMEtimestamp_extract_
 mtime_export str MTIMEdate_addyears(date *ret, const date *v, const int 
*delta);
 mtime_export str MTIMEdate_adddays(date *ret, const date *v, const int *delta);
 mtime_export str MTIMEdate_addmonths(date *ret, const date *v, const int 
*delta);
+mtime_export str MTIMEdate_submonths(date *ret, const date *v, const int 
*delta);
 mtime_export str MTIMEdate_diff(int *ret, const date *v1, const date *v2);
 mtime_export str MTIMEdate_diff_bulk(bat *ret, const bat *bid1, const bat 
*bid2);
 mtime_export str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const 
lng *msec);
diff --git a/monetdb5/modules/atoms/mtime.mal b/monetdb5/modules/atoms/mtime.mal
--- a/monetdb5/modules/atoms/mtime.mal
+++ b/monetdb5/modules/atoms/mtime.mal
@@ -424,6 +424,10 @@ command date_add_month_interval(t:date,s
 address MTIMEdate_addmonths
 comment "Add months to a date";
 
+command date_sub_month_interval(t:date,s:int):date
+address MTIMEdate_submonths
+comment "Subtract months from a date";
+
 # @-
 # #command int(d:date):int = MTIMEdate_2int;
 # #command int(d:daytime):int = MTIMEdaytime_2int;
diff --git a/monetdb5/optimizer/opt_pushselect.c 
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -190,6 +190,12 @@ OPTpushselectImplementation(Client cntxt

if (getModuleId(s) == sqlRef && 
getFunctionId(s) == tidRef) 
tid = getArg(q, 1);
+   if (s->argc == 2 && s->retc == 1) {
+   int i1 = getArg(s, 1);
+   InstrPtr s = old[vars[i1]];
+   if (getModuleId(s) == sqlRef && 
getFunctionId(s) == tidRef) 
+   tid = getArg(q, 1);
+   }
break;
} else if (isMapOp(q) && q->argc >= 2 && 
isaBatType(getArgType(mb, q, 1))) {
int i1 = getArg(q, 1);
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1513,16 +1513,16 @@ rel2bin_join( mvc *sql, sql_rel *rel, li
list *lje = sa_list(sql->sa);
list *rje = sa_list(sql->sa);
 
-   /* get equi-joins first */
+   /* get equi-joins/filters first */
if (list_length(rel->exps) > 1) {
for( en = rel->exps->h; en; en = en->next ) {
sql_exp *e = en->data;
-   if (e->type == e_cmp && e->flag == cmp_equal)
+   if (e->type == e

MonetDB: default - merged with Oct2014

2014-11-16 Thread Niels Nes
Changeset: c638761448c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c638761448c3
Added Files:
sql/test/BugTracker-2014/Tests/orderby_column_exp.Bug-3620.sql
sql/test/BugTracker-2014/Tests/orderby_column_exp.Bug-3620.stable.err
sql/test/BugTracker-2014/Tests/orderby_column_exp.Bug-3620.stable.out
Modified Files:
sql/common/sql_types.c
sql/common/sql_types.h
sql/server/rel_psm.c
sql/server/rel_select.c
sql/server/sql_mvc.h
sql/test/BugTracker-2014/Tests/All
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 438 to 300 lines):

diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -404,7 +404,7 @@ subfunc_cmp( sql_subfunc *f1, sql_subfun
return -1;
 }
 
-static int
+int
 arg_subtype_cmp(sql_arg *a, sql_subtype *t)
 {
if (a->type.type->eclass == EC_ANY)
@@ -568,8 +568,8 @@ is_sqlfunc(sql_func *f)
return f->sql;
 }
 
-static sql_subfunc*
-_dup_subfunc(sql_allocator *sa, sql_func *f, list *ops, sql_subtype *member)
+sql_subfunc*
+sql_dup_subfunc(sql_allocator *sa, sql_func *f, list *ops, sql_subtype *member)
 {
node *tn;
unsigned int scale = 0, digits = 0;
@@ -636,9 +636,9 @@ func_cmp(sql_allocator *sa, sql_func *f,
 {
if (strcmp(f->base.name, name) == 0) {
if (f->vararg) 
-   return _dup_subfunc(sa, f, NULL, NULL);
+   return sql_dup_subfunc(sa, f, NULL, NULL);
if (nrargs < 0 || list_length(f->ops) == nrargs) 
-   return _dup_subfunc(sa, f, NULL, NULL);
+   return sql_dup_subfunc(sa, f, NULL, NULL);
}
return NULL;
 }
@@ -716,7 +716,7 @@ sql_bind_member(sql_allocator *sa, sql_s
continue;
if (strcmp(f->base.name, sqlfname) == 0) {
if (list_length(f->ops) == nrargs && is_subtype(tp, 
&((sql_arg *) f->ops->h->data)->type)) 
-   return _dup_subfunc(sa, f, NULL, tp);
+   return sql_dup_subfunc(sa, f, NULL, tp);
}
}
if (tp && tp->type->eclass == EC_NUM) {
@@ -729,7 +729,7 @@ sql_bind_member(sql_allocator *sa, sql_s
if (strcmp(f->base.name, sqlfname) == 0 && 
list_length(f->ops) == nrargs) {
if (((sql_arg *) 
f->ops->h->data)->type.type->eclass == EC_DEC && 
((sql_arg *) 
f->ops->h->data)->type.type->localtype == tp->type->localtype) 
-   return _dup_subfunc(sa, f, NULL, tp);
+   return sql_dup_subfunc(sa, f, NULL, tp);
}
}
}
@@ -743,7 +743,7 @@ sql_bind_member(sql_allocator *sa, sql_s
continue;
if (strcmp(f->base.name, sqlfname) == 0) {
if (list_length(f->ops) == nrargs && 
is_subtype(tp, &((sql_arg *) f->ops->h->data)->type)) 
-   return _dup_subfunc(sa, f, NULL, tp);
+   return sql_dup_subfunc(sa, f, NULL, tp);
}
}
}
@@ -795,7 +795,7 @@ sql_bind_func_(sql_allocator *sa, sql_sc
continue;
if (strcmp(f->base.name, sqlfname) == 0) {
if (list_cmp(f->ops, ops, (fcmp) &arg_subtype_cmp) == 
0) 
-   return _dup_subfunc(sa, f, ops, NULL);
+   return sql_dup_subfunc(sa, f, ops, NULL);
}
}
if (s) {
@@ -808,7 +808,7 @@ sql_bind_func_(sql_allocator *sa, sql_sc
continue;
if (strcmp(f->base.name, sqlfname) == 0) {
if (list_cmp(f->ops, ops, (fcmp) 
&arg_subtype_cmp) == 0) 
-   return _dup_subfunc(sa, f, ops, NULL);
+   return sql_dup_subfunc(sa, f, ops, 
NULL);
}
}
}
@@ -862,7 +862,7 @@ sql_bind_func_result_(sql_allocator *sa,
continue;
firstres = f->res->h->data;
if (strcmp(f->base.name, sqlfname) == 0 && 
(is_subtype(&firstres->type, res) || firstres->type.type->eclass == EC_ANY) && 
list_cmp(f->ops, ops, (fcmp) &arg_subtype_cmp) == 0) 
-   return _dup_subfunc(sa, f, ops, NULL);
+   return sql_dup_subfunc(sa, f, ops, NULL);
}
return NULL;
 }
diff --git a/sql/common/sql_types.h b/sql/common/sql_types.h
--- a/sql/common/sql_types.h
+++ b/sql/common/sql_types.h
@@ -83,6 +83,7 @@ extern char *sql_subtype_string(sql_subt
 
 extern int type_cmp(sql_type *

MonetDB: default - merged with oct2014

2014-11-12 Thread Niels Nes
Changeset: f1a039e49377 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f1a039e49377
Modified Files:
sql/backends/monet5/sql.c
Branch: default
Log Message:

merged with oct2014


diffs (20 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3010,14 +3010,14 @@ mvc_bin_import_table_wrap(Client cntxt, 
 
/* handle the various cases */
if (tpe < TYPE_str || tpe == TYPE_date || tpe == TYPE_daytime 
|| tpe == TYPE_timestamp) {
-   c = BATattach(col->type.type->localtype, 
*getArgReference_str(stk, pci, i), TRANSIENT);
+   c = BATattach(col->type.type->localtype, 
*getArgReference_str(stk, pci, i), PERSISTENT);
if (c == NULL)
throw(SQL, "sql", "failed to attach file %s", 
*getArgReference_str(stk, pci, i));
BATsetaccess(c, BAT_READ);
BATderiveProps(c, 1);
} else if (tpe == TYPE_str) {
/* get the BAT and fill it with the strings */
-   c = BATnew(TYPE_void, TYPE_str, 0, TRANSIENT);
+   c = BATnew(TYPE_void, TYPE_str, 0, PERSISTENT);
if (c == NULL)
throw(SQL, "sql", MAL_MALLOC_FAIL);
BATseqbase(c, 0);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2014-11-12 Thread Niels Nes
Changeset: 62f8b38c7a4c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=62f8b38c7a4c
Modified Files:
buildtools/doc/windowsbuild.rst
clients/R/MonetDB.R/R/dbi.R
clients/R/Tests/survey.R
clients/R/Tests/survey.stable.err
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
gdk/gdk_bat.c
gdk/libbat.rc
geom/monetdb5/geom.c
geom/monetdb5/geom.mal
geom/sql/40_geom.sql
monetdb5/tools/libmonetdb5.rc
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
sql/server/rel_optimizer.c
sql/storage/bat/bat_logger.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_storage.h
sql/storage/bat/bat_table.c
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 673 to 300 lines):

diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -23,12 +23,11 @@ Building MonetDB On Windows
 +++
 
 In this document we describe how to build the MonetDB suite of
-programs on Windows using the sources from our source repository at
-`our server`__.  This document is mainly targeted at building on
-Windows on a 32-bit architecture, but there are notes throughout about
-building on Windows on a 64-bit architecture which is indicated with
-Windows64.  We have successfully built on Windows XP, Windows Server,
-and Windows 7.
+programs on Windows using the sources from `our source repository`__.
+This document is mainly targeted at building on Windows on a 32-bit
+architecture, but there are notes throughout about building on Windows
+on a 64-bit architecture which is indicated with Windows64.  We have
+successfully built on Windows XP, Windows Server, and Windows 7.
 
 __ http://dev.monetdb.org/hg/MonetDB/
 
@@ -172,7 +171,8 @@ the build process would be much more lik
 here).
 
 We currently use Microsoft Visual Studio 2010 and Intel(R) C++
-Compiler XE 13.1.2.190, the latter using Microsoft Visual Studio 10.0.
+Compiler XE 13.1.2.190, the latter using Microsoft Visual Studio
+10.0.  Older versions haven't been tried in a long time.
 
 __ http://www.cygwin.com/
 __ http://www.mingw.org/
@@ -262,7 +262,27 @@ Files\PCRE``.
 For Windows64, select the correct compiler (``Visual Studio 10 2010
 Win64``) and proceed normally.  When building the 32 bit version on
 Windows64, choose ``C:/Program Files (x86)/PCRE`` for the
-``CMAKE_INSTALL_PREFIX`` value, otherwise choose ``C:/Program Files/PCRE``.
+``CMAKE_INSTALL_PREFIX`` value, otherwise choose ``C:/Program
+Files/PCRE``.
+
+In order to get a version number in the DLL that is produced, we added
+a file ``version.rc`` to the sources for the ``pcre`` subproject.  The
+contents of the file are::
+
+ #include 
+ VS_VERSION_INFO   VERSIONINFO
+ FILEVERSION   8,36,0,0// change as appropriate
+ PRODUCTVERSION8,36,0,0// change as appropriate
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0
+ FILEOSVOS_NT_WINDOWS32
+ FILETYPE  VFT_DLL
+ FILESUBTYPE   VFT2_UNKNOWN
+ BEGIN
+   BLOCK "StringFileInfo"
+   BEGIN
+   END
+ END
 
 __ http://www.pcre.org/
 
@@ -338,6 +358,29 @@ Studio 2008 a warning.
``d`` to the definitions of ``XML_SO``, ``XML_IMP``, ``XML_A``, and
``XML_A_DLL``.  Also add ``d`` to the ``zlib.lib`` and ``iconv.lib``.
 
+In order to get a version number in the DLL that is produced, we added
+a file ``version.rc`` in the ``win32`` folder.  The contents of the
+file are::
+
+ #include 
+ VS_VERSION_INFO   VERSIONINFO
+ FILEVERSION   2,9,2,0 // change as appropriate
+ PRODUCTVERSION2,9,2,0 // change as appropriate
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0
+ FILEOSVOS_NT_WINDOWS32
+ FILETYPE  VFT_DLL
+ FILESUBTYPE   VFT2_UNKNOWN
+ BEGIN
+   BLOCK "StringFileInfo"
+   BEGIN
+   END
+ END
+
+To use it, we also added ``version.res`` after ``$(XML_OBJS)`` in
+``win32\Makefile.msvc`` both in the list of dependencies of
+``$(BINDIR)\$(XML_SO)`` and in the command to produce said file.
+
 After this, you may want to move the file ``libxml2.dll`` from the
 ``lib`` folder to the ``bin`` folder.
 
@@ -366,6 +409,32 @@ in the instructions.
 
 .. On Windows64, add WIN64=YES to the nmake command line.
 
+.. For a debug build, add ``BUILD_DEBUG=YES`` to the ``nmake`` command
+   line.
+
+In order to get a version number in the DLL that is produced, we added
+a file ``version.rc`` in the ``src`` folder.  The contents of the
+file are::
+
+ #include 
+ VS_VERSION_INFO   VERSIONINFO
+ FILEVERSION   3,4,2,0 // change as appropriate

MonetDB: default - merged with Oct2014

2014-10-11 Thread Niels Nes
Changeset: 935220fa9232 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=935220fa9232
Modified Files:
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/mtime.h
monetdb5/modules/atoms/mtime.mal
Branch: default
Log Message:

merged with Oct2014


diffs (83 lines):

diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -2386,6 +2386,21 @@ MTIMEtimestamp_add_month_interval_wrap(t
 }
 
 str
+MTIMEtimestamp_add_month_interval_lng_wrap(timestamp *ret, const timestamp *v, 
const lng *months)
+{
+   daytime t;
+   date d;
+   int m;
+   MTIMEtimestamp_extract_daytime(&t, v, &tzone_local);
+   MTIMEtimestamp_extract_date(&d, v, &tzone_local);
+   if (*months > (YEAR_MAX*12)) 
+   throw(MAL, "mtime.timestamp_sub_interval", "to many months");
+   m = (int)*months;
+   MTIMEdate_addmonths(&d, &d, &m);
+   return MTIMEtimestamp_create(ret, &d, &t, &tzone_local);
+}
+
+str
 MTIMEtimestamp_sub_month_interval_wrap(timestamp *ret, const timestamp *v, 
const int *months)
 {
daytime t;
@@ -2398,6 +2413,22 @@ MTIMEtimestamp_sub_month_interval_wrap(t
 }
 
 str
+MTIMEtimestamp_sub_month_interval_lng_wrap(timestamp *ret, const timestamp *v, 
const lng *months)
+{
+   daytime t;
+   date d;
+   int m;
+   MTIMEtimestamp_extract_daytime(&t, v, &tzone_local);
+   MTIMEtimestamp_extract_date(&d, v, &tzone_local);
+   if (*months > (YEAR_MAX*12)) 
+   throw(MAL, "mtime.timestamp_sub_interval", "to many months");
+   m = -(int)*months;
+   MTIMEdate_addmonths(&d, &d, &m);
+   return MTIMEtimestamp_create(ret, &d, &t, &tzone_local);
+}
+
+
+str
 MTIMEtime_add_msec_interval_wrap(daytime *ret, const daytime *t, const lng 
*mseconds)
 {
lng s = *mseconds;
diff --git a/monetdb5/modules/atoms/mtime.h b/monetdb5/modules/atoms/mtime.h
--- a/monetdb5/modules/atoms/mtime.h
+++ b/monetdb5/modules/atoms/mtime.h
@@ -220,6 +220,8 @@ mtime_export str MTIMEdate_add_msec_inte
 mtime_export str MTIMEtimestamp_sub_msec_interval_lng_wrap(timestamp *ret, 
const timestamp *t, const lng *msec);
 mtime_export str MTIMEtimestamp_sub_month_interval_wrap(timestamp *ret, const 
timestamp *t, const int *months);
 mtime_export str MTIMEtimestamp_add_month_interval_wrap(timestamp *ret, const 
timestamp *t, const int *months);
+mtime_export str MTIMEtimestamp_sub_month_interval_lng_wrap(timestamp *ret, 
const timestamp *t, const lng *months);
+mtime_export str MTIMEtimestamp_add_month_interval_lng_wrap(timestamp *ret, 
const timestamp *t, const lng *months);
 mtime_export str MTIMEtime_sub_msec_interval_wrap(daytime *ret, const daytime 
*t, const lng *msec);
 mtime_export str MTIMEtime_add_msec_interval_wrap(daytime *ret, const daytime 
*t, const lng *msec);
 mtime_export str MTIMEcompute_rule_foryear(date *ret, const rule *val, const 
int *year);
diff --git a/monetdb5/modules/atoms/mtime.mal b/monetdb5/modules/atoms/mtime.mal
--- a/monetdb5/modules/atoms/mtime.mal
+++ b/monetdb5/modules/atoms/mtime.mal
@@ -397,9 +397,19 @@ address MTIMEtimestamp_add;
 command timestamp_sub_month_interval(t:timestamp,s:int):timestamp
 address MTIMEtimestamp_sub_month_interval_wrap
 comment "Subtract months from a timestamp";
+
+command timestamp_sub_month_interval(t:timestamp,s:lng):timestamp
+address MTIMEtimestamp_sub_month_interval_lng_wrap
+comment "Subtract months from a timestamp";
+
 command timestamp_add_month_interval(t:timestamp,s:int):timestamp
 address MTIMEtimestamp_add_month_interval_wrap
 comment "Add months to a timestamp";
+
+command timestamp_add_month_interval(t:timestamp,s:lng):timestamp
+address MTIMEtimestamp_add_month_interval_lng_wrap
+comment "Add months to a timestamp";
+
 command timestamp(t:timestamp):timestamp
 address MTIMEtimestamp2timestamp;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2014-10-11 Thread Niels Nes
Changeset: 1432d91c86c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1432d91c86c3
Modified Files:
clients/R/MonetDB.R/DESCRIPTION
clients/R/MonetDB.R/R/control.R
clients/R/Tests/dbi.R
clients/Tests/exports.stable.out
common/stream/stream.c
gdk/gdk_system.c
geom/lib/libgeom.h
geom/monetdb5/geom.c
monetdb5/mal/mal.h
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_debugger.h
monetdb5/modules/atoms/blob.h
monetdb5/modules/mal/tablet.h
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

merged with Oct2014


diffs (300 lines):

diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -1,5 +1,5 @@
 Package: MonetDB.R
-Version: 0.9.5
+Version: 0.9.6
 Title: Connect MonetDB to R
 Authors@R: c(person("Hannes Muehleisen", role = c("aut", "cre"),email = 
"han...@cwi.nl"),
person("Thomas Lumley", role = "ctb"),
diff --git a/clients/R/MonetDB.R/R/control.R b/clients/R/MonetDB.R/R/control.R
--- a/clients/R/MonetDB.R/R/control.R
+++ b/clients/R/MonetDB.R/R/control.R
@@ -10,7 +10,7 @@ monetdb.server.start <-
   
   # run script
   system(bat.file,wait=T)
-  
+
   # read pid from file
   pid <- scan(pidfile,what=integer(),n=1)
   return(pid)
@@ -75,7 +75,7 @@ monetdb.server.stop <-
   system(paste0("kill ",correct.pid))  
   waittime <- 2
   if (!wait) return(TRUE)
-  Sys.sleep(1)
+  Sys.sleep(.5)
   repeat {
 psout <- system(paste0("ps ax | grep \"^", correct.pid, 
".*mserver5\""), ignore.stdout=T) 
 if (psout != 0) break
diff --git a/clients/R/Tests/dbi.R b/clients/R/Tests/dbi.R
--- a/clients/R/Tests/dbi.R
+++ b/clients/R/Tests/dbi.R
@@ -11,6 +11,7 @@ if (length(args) > 0)
dbport <- args[[1]]
 
 options(monetdb.insert.splitsize=10)
+
 tname <- "monetdbtest"
 
 
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
@@ -2553,13 +2553,13 @@ str maxRef;
 str max_no_nilRef;
 int mayhaveSideEffects(Client cntxt, MalBlkPtr mb, InstrPtr p, int strict);
 void mdbDump(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str mdbGrab(Client cntxt, MalBlkPtr mb1, MalStkPtr stk1, InstrPtr pc1);
+str mdbGrab(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str mdbRef;
 int mdbSession(void);
 void mdbSetBreakRequest(Client cntxt, MalBlkPtr mb, str request, char cmd);
 int mdbSetTrap(Client cntxt, str modnme, str fcnnme, int flag);
-str mdbTrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc);
-str mdbTrapClient(Client cntxt, MalBlkPtr mb1, MalStkPtr stk1, InstrPtr pc1);
+str mdbTrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
+str mdbTrapClient(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 int memoryclaims;
 lng memorypool;
 str mergecandRef;
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -3614,7 +3614,7 @@ bstream_destroy(bstream *s)
 typedef struct {
stream *s;
size_t len, pos;
-   char buf[1];/* NOTE: buf extends beyond array for wbs->len 
bytes */
+   char buf[]; /* NOTE: buf extends beyond array for wbs->len 
bytes */
 } wbs_stream;
 
 static int
@@ -3716,7 +3716,7 @@ wbstream(stream *s, size_t buflen)
ns = create_stream(s->name);
if (ns == NULL)
return NULL;
-   wbs = (wbs_stream *) malloc(sizeof(wbs_stream) + buflen - 1);
+   wbs = (wbs_stream *) malloc(sizeof(wbs_stream) + buflen);
if (wbs == NULL) {
destroy(ns);
return NULL;
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -495,7 +495,6 @@ rm_posthread(struct posthread *p, int lo
*pp = p->next;
if (lock)
pthread_mutex_unlock(&posthread_lock);
-   free(p);
 }
 
 static void
@@ -512,20 +511,22 @@ thread_starter(void *arg)
 static void
 join_threads(void)
 {
-   struct posthread *p;
+   struct posthread *p, *n = NULL;
int waited;
pthread_t tid;
 
pthread_mutex_lock(&posthread_lock);
do {
waited = 0;
-   for (p = posthreads; p; p = p->next) {
+   for (p = posthreads; p; p = n) {
+   n = p->next;
if (p->exited) {
tid = p->tid;
rm_posthread(p, 0);
pthread_mutex_unlock(&posthread_lock);
pthread_join(tid, NULL);
pthread_mutex_lock(&posthread_lock);
+   free(p);
waited = 1;
 

MonetDB: default - merged with Oct2014

2014-10-09 Thread Niels Nes
Changeset: b35a4cb41491 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b35a4cb41491
Modified Files:
NT/monetdb_config.h.in
clients/R/MonetDB.R/R/control.R
clients/R/MonetDB.R/src/mapi.c
clients/Tests/exports.stable.out
clients/mapiclient/mclient.c
clients/mapiclient/mnc.c
clients/mapilib/mapi.c
clients/mapilib/mapi.h
clients/odbc/driver/ODBCGlobal.h
common/stream/stream.c
common/utils/mutils.c
common/utils/mutils.h
configure.ag
gdk/gdk_atoms.c
gdk/gdk_posix.c
gdk/gdk_posix.h
gdk/gdk_storage.c
gdk/gdk_utils.c
monetdb5/modules/atoms/batxml.c
monetdb5/modules/kernel/aggr.c
monetdb5/modules/kernel/alarm.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/kernel/counters.c
monetdb5/modules/kernel/logger.c
monetdb5/modules/kernel/mmath.c
monetdb5/modules/mal/batcalc.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/transaction.c
sql/backends/monet5/datacell/dcsocket.c
sql/backends/monet5/gsl/gsl.c
sql/benchmarks/tpch/Tests/11-explain.stable.out
sql/benchmarks/tpch/Tests/11-plan.stable.out
sql/benchmarks/tpch/Tests/14-explain.stable.out
sql/benchmarks/tpch/Tests/14-plan.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out
sql/benchmarks/tpch/Tests/17-plan.stable.out
sql/benchmarks/tpch/Tests/20-explain.stable.out
sql/benchmarks/tpch/Tests/20-plan.stable.out
sql/benchmarks/tpch/Tests/22-explain.stable.out
sql/benchmarks/tpch/Tests/22-plan.stable.out
sql/common/sql_string.c
sql/server/rel_select.c
sql/server/sql_parser.y

sql/test/BugTracker-2012/Tests/user_defined_decimal_function.Bug-2992.stable.out
sql/test/BugTracker-2014/Tests/stringfloatshtcompare.Bug-3512.stable.err
sql/test/BugTracker-2014/Tests/stringfloatshtcompare.Bug-3512.stable.out
tools/merovingian/daemon/client.c
tools/merovingian/daemon/connections.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/daemon/proxy.c
tools/merovingian/utils/control.c
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 2432 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -111,13 +111,6 @@
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_CRYPT_H */
 
-/* Define to 1 if you have the  header file. */
-#if _MSC_VER >= 1300
-#define HAVE_CSTDIO 1
-#else
-/* #undef HAVE_CSTDIO */
-#endif
-
 /* Define to 1 if you have the `ctime_r' function. */
 #define HAVE_CTIME_R 1
 
@@ -229,13 +222,6 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_INTTYPES_H 1  /* generated by the Makefile */
 
-/* Define to 1 if you have the  header file. */
-#if _MSC_VER >= 1300
-#define HAVE_IOSTREAM 1
-#else
-/* #undef HAVE_IOSTREAM */
-#endif
-
 /* Define to 1 if you have the  header file. */
 #define HAVE_IO_H 1
 
@@ -1041,9 +1027,6 @@ typedef unsigned __int64 uint64_t;
 #define __bool_true_false_are_defined 1
 
 
-#define SLASH_2_DIR_SEP(s) {char *t; for(t=strchr(s, '/'); t; 
t=strchr(t+1, '/')) *t=DIR_SEP;}
-#define DIR_SEP_2_SLASH(s) {char *t; for(t=strchr(s, DIR_SEP); t; 
t=strchr(t+1, DIR_SEP)) *t='/';}
-
 #ifdef HAVE_LONG_LONG
 typedef long long lng;
 # define SIZEOF_LNG SIZEOF_LONG_LONG
diff --git a/clients/R/MonetDB.R/R/control.R b/clients/R/MonetDB.R/R/control.R
--- a/clients/R/MonetDB.R/R/control.R
+++ b/clients/R/MonetDB.R/R/control.R
@@ -69,10 +69,20 @@ monetdb.server.start <-
 
 
 monetdb.server.stop <-
-  function( correct.pid ){
+  function( correct.pid, wait=T ){
 
 if ( .Platform$OS.type == "unix" ) {
-  system(paste0("kill ",correct.pid))
+  system(paste0("kill ",correct.pid))  
+  waittime <- 2
+  if (!wait) return(TRUE)
+  Sys.sleep(1)
+  repeat {
+psout <- system(paste0("ps ax | grep \"^", correct.pid, 
".*mserver5\""), ignore.stdout=T) 
+if (psout != 0) break
+message("Waiting ",waittime,"s for server shutdown (ESC or CTRL+C to 
abort)")
+Sys.sleep(waittime)
+waittime <- waittime * 2
+  }
 } 
 
 if ( .Platform$OS.type == "windows" ) {
diff --git a/clients/R/MonetDB.R/src/mapi.c b/clients/R/MonetDB.R/src/mapi.c
--- a/clients/R/MonetDB.R/src/mapi.c
+++ b/clients/R/MonetDB.R/src/mapi.c
@@ -132,25 +132,25 @@ SEXP mapiConnect(SEXP host, SEXP port, S
 
for (rp = result; rp != NULL; rp = rp->ai_next) {
sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);

MonetDB: default - merged with Oct2014

2014-10-08 Thread Niels Nes
Changeset: 5e8433fd572c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5e8433fd572c
Modified Files:
NT/monetdb_config.h.in
clients/Tests/exports.stable.out
common/stream/stream_socket.h
gdk/gdk_align.c
gdk/gdk_atoms.c
gdk/gdk_bat.c
gdk/gdk_posix.c
gdk/gdk_posix.h
gdk/gdk_storage.c
gdk/gdk_system.h
gdk/gdk_utils.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/mmath.c
monetdb5/modules/mal/mal_mapi.c
sql/server/sql_parser.y
sql/storage/bat/bat_storage.c
sql/storage/store.c
sql/test/leaks/Tests/check0.stable.out
sql/test/leaks/Tests/temp2.stable.out
sql/test/leaks/Tests/temp3.stable.out
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 488 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -151,6 +151,9 @@
 /* If the system has a working fdatasync */
 /* #undef HAVE_FDATASYNC */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_FENV_H */
+
 /* Define to 1 if you have the `fpclass' function. */
 #define HAVE_FPCLASS 1
 
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
@@ -479,6 +479,7 @@ int ptrToStr(str *dst, int *len, const p
 const ptr ptr_nil;
 struct dirent *readdir(DIR *dir);
 void rewinddir(DIR *dir);
+void set_errno(int);
 int shtFromStr(const char *src, int *len, sht **dst);
 int shtToStr(str *dst, int *len, const sht *src);
 const sht sht_nil;
diff --git a/common/stream/stream_socket.h b/common/stream/stream_socket.h
--- a/common/stream/stream_socket.h
+++ b/common/stream/stream_socket.h
@@ -30,6 +30,9 @@
 #ifndef INVALID_SOCKET
 #define INVALID_SOCKET (-1)
 #endif
+#ifndef SOCKET_ERROR
+#define SOCKET_ERROR (-1)
+#endif
 
 stream_export stream *socket_rstream(SOCKET socket, const char *name);
 stream_export stream *socket_wstream(SOCKET socket, const char *name);
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -566,6 +566,12 @@ VIEWunlink(BAT *b)
b->H->hash = NULL;
if (tpb && b->T->hash && b->T->hash == tpb->H->hash)
b->T->hash = NULL;
+
+   /* unlink imprints shared with parent */
+   if (hpb && b->H->imprints && b->H->imprints == hpb->H->imprints)
+   b->H->imprints = NULL;
+   if (tpb && b->T->imprints && b->T->imprints == tpb->H->imprints)
+   b->T->imprints = NULL;
}
 }
 
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -844,7 +844,7 @@ dblFromStr(const char *src, int *len, db
 * normalized double, and may or may not set errno to
 * ERANGE.  We accept underflow, but not overflow. */
char *pe;
-   errno = 0;
+   set_errno(0);
d = strtod(src, &pe);
p = pe;
if (p == src || (errno == ERANGE && (d < -1 || d > 1))) {
@@ -886,7 +886,7 @@ fltFromStr(const char *src, int *len, fl
 * normalized float, and may or may not set errno to
 * ERANGE.  We accept underflow, but not overflow. */
char *pe;
-   errno = 0;
+   set_errno(0);
f = strtof(src, &pe);
p = pe;
while (GDKisspace(*p))
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -352,8 +352,8 @@ BATattach(int tt, const char *heapfile, 
path = GDKfilepath(bn->T->heap.farmid, BATDIR, bn->T->heap.filename, 
"new");
GDKcreatedir(path);
if (rename(heapfile, path) < 0) {
+   GDKsyserror("BATattach: cannot rename heapfile\n");
GDKfree(path);
-   GDKsyserror("BATattach: cannot rename heapfile\n");
HEAPfree(&bn->T->heap);
GDKfree(bs);
return NULL;
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -1156,20 +1156,15 @@ win_errmap_t win_errmap[] = {
 
 #define GDK_WIN_ERRNO_TLS 13
 
+#undef _errno
 int *
 win_errno(void)
 {
/* get address of thread-local Posix errno; refresh its value
 * from WIN32 error code */
int i, err = GetLastError() & 0xff;
-   int *result = TlsGetValue(GDK_WIN_ERRNO_TLS);
+   int *result = _errno();
 
-   if (result == NULL) {
-   result = (int *) malloc(sizeof(int));
-   *result = 0;
-   TlsSetValue(GDK_WIN_ERRNO_TLS, result);
-   }
-   *result = ENOSYS;   /* fallback error */
for (i = 0; win_errmap[i].w != 0; ++i) {
if (err == win_errmap[i].w) {
 

MonetDB: default - merged with Oct2014

2014-10-08 Thread Niels Nes
Changeset: 6d267a853346 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d267a853346
Modified Files:
sql/jdbc/tests/Tests/Test_Dobjects.stable.out
sql/server/rel_select.c
Branch: default
Log Message:

merged with Oct2014


diffs (37 lines):

diff --git a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out 
b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
--- a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
+++ b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
@@ -50,7 +50,7 @@ Ready.
 # 20:09:14 >  
 
 Resultset with 1 columns
-TABLE_TYPE 
+TABLE_CAT  
 mTests_sql_jdbc_tests  
 Resultset with 3 columns
 TABLE_SCHEMTABLE_CATALOG   TABLE_CAT   
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4183,6 +4183,8 @@ rel_case(mvc *sql, sql_rel **rel, int to
tpe = &rtype;
}
restype = tpe;
+   if (restype->type->localtype == TYPE_void) /* NULL */
+   restype = sql_bind_localtype("str");
 
if (!result || !(result = rel_check_type(sql, restype, result, 
type_equal))) 
return NULL;
@@ -4191,9 +4193,9 @@ rel_case(mvc *sql, sql_rel **rel, int to
if (!res) 
return NULL;
} else {
-   sql_exp *a = exp_atom(sql->sa, atom_general(sql->sa, restype, 
NULL));
-
-   res = a;
+   if (restype->type->localtype == TYPE_void) /* NULL */
+   restype = sql_bind_localtype("str");
+   res = exp_atom(sql->sa, atom_general(sql->sa, restype, NULL));
}
 
for (n = conds->h, m = results->h; n && m; n = n->next, m = m->next) {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2014-10-08 Thread Niels Nes
Changeset: 19ea66edb860 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19ea66edb860
Added Files:
sql/test/BugTracker-2014/Tests/copy_decimal_into.Bug-3596.sql
sql/test/BugTracker-2014/Tests/copy_decimal_into.Bug-3596.stable.err
sql/test/BugTracker-2014/Tests/copy_decimal_into.Bug-3596.stable.out

sql/test/BugTracker-2014/Tests/duplicate_primary_keys.Bug-3474.stable.err

sql/test/BugTracker-2014/Tests/duplicate_primary_keys.Bug-3474.stable.out
Modified Files:
configure.ag
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/mmath.c
monetdb5/modules/mal/mkey.c
sql/backends/monet5/sql_result.c
sql/storage/bat/bat_storage.c
sql/test/BugTracker-2014/Tests/All
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/select1.stable.out
sql/test/leaks/Tests/select2.stable.out
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 802 to 300 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2635,6 +2635,7 @@ AC_CHECK_HEADERS([ \
dlfcn.h \
execinfo.h \
fcntl.h \
+   fenv.h \
getopt.h \
iconv.h \
ieeefp.h \
diff --git a/monetdb5/modules/kernel/batmmath.c 
b/monetdb5/modules/kernel/batmmath.c
--- a/monetdb5/modules/kernel/batmmath.c
+++ b/monetdb5/modules/kernel/batmmath.c
@@ -29,96 +29,124 @@
  */
 #include "monetdb_config.h"
 #include "batmmath.h"
+#ifdef HAVE_FENV_H
+#include 
+#else
+#define feclearexcept(x)
+#define fetestexcept(x)0
+#endif
 
-#define voidresultBAT(X1,X2)\
-   bn = BATnew(TYPE_void, X1, BATcount(b), TRANSIENT);\
-   if (bn == NULL) {\
-   BBPreleaseref(b->batCacheid);\
-   throw(MAL, X2, MAL_MALLOC_FAIL);\
-   }\
-   BATseqbase(bn, b->hseqbase);\
-   bn->hsorted = b->hsorted;\
-   bn->hrevsorted = b->hrevsorted;\
-   bn->tsorted = b->tsorted;\
-   bn->trevsorted = b->trevsorted;\
-   bn->H->nonil = 1;\
-   bn->T->nonil = b->T->nonil;
+#define voidresultBAT(X1,X2)   
\
+   do {
\
+   bn = BATnew(TYPE_void, X1, BATcount(b), TRANSIENT); \
+   if (bn == NULL) {   
\
+   BBPreleaseref(b->batCacheid);   
\
+   throw(MAL, X2, MAL_MALLOC_FAIL);
\
+   }   
\
+   BATseqbase(bn, b->hseqbase);
\
+   bn->hsorted = b->hsorted;   
\
+   bn->hrevsorted = b->hrevsorted; 
\
+   bn->tsorted = b->tsorted;   
\
+   bn->trevsorted = b->trevsorted; 
\
+   bn->H->nonil = 1;   
\
+   bn->T->nonil = b->T->nonil; 
\
+   } while (0)
 
 
-#define scienceFcnImpl(X1,X2,X3)   
\
-str CMDscience_bat_##X2##_##X1(bat *ret, const bat *bid)   \
-{  
\
-   BAT *b,*bn; 
\
-   X2 *o, *p, *q;  
\
-   if ((b = BATdescriptor(*bid)) == NULL) {
\
-   throw(MAL, #X2, RUNTIME_OBJECT_MISSING);
\
-   }   
\
-   voidresultBAT(TYPE_##X2,"batcalc." #X1);
\
-   o = (X2*) Tloc(bn, BUNfirst(bn));   
\
-   p = (X2*) Tloc(b, BUNfirst(b)); 
\
-   q = (X2*) Tloc(b, BUNlast(b));  
\
-   
\
-   if (b->T->nonil){   
\
-   

MonetDB: default - merged with Oct2014

2014-09-28 Thread Niels Nes
Changeset: 23535ac6a4be for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=23535ac6a4be
Modified Files:
sql/server/rel_select.c
sql/storage/store.c
Branch: default
Log Message:

merged with Oct2014


diffs (63 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -194,7 +194,7 @@ exp_alias_or_copy( mvc *sql, char *tname
 
 /* return all expressions, with table name == tname */
 static list *
-rel_table_projections( mvc *sql, sql_rel *rel, char *tname )
+rel_table_projections( mvc *sql, sql_rel *rel, char *tname, int level )
 {
list *exps;
 
@@ -214,15 +214,15 @@ rel_table_projections( mvc *sql, sql_rel
case op_left:
case op_right:
case op_full:
-   exps = rel_table_projections( sql, rel->l, tname);
+   exps = rel_table_projections( sql, rel->l, tname, level+1);
if (exps)
return exps;
-   return rel_table_projections( sql, rel->r, tname);
+   return rel_table_projections( sql, rel->r, tname, level+1);
case op_apply:
case op_semi:
case op_anti:
case op_select:
-   return rel_table_projections( sql, rel->l, tname);
+   return rel_table_projections( sql, rel->l, tname, level+1);
 
case op_topn:
case op_sample:
@@ -231,8 +231,8 @@ rel_table_projections( mvc *sql, sql_rel
case op_except:
case op_inter:
case op_project:
-   if (!is_processed(rel))
-   return rel_table_projections( sql, rel->l, tname);
+   if (!is_processed(rel) && level == 0)
+   return rel_table_projections( sql, rel->l, tname, 
level+1);
/* fall through */
case op_table:
case op_basetable:
@@ -4993,7 +4993,7 @@ rel_table_exp(mvc *sql, sql_rel **rel, s
char *tname = column_e->data.lval->h->data.sval;
list *exps;

-   if ((exps = rel_table_projections(sql, *rel, tname)) != NULL)
+   if ((exps = rel_table_projections(sql, *rel, tname, 0)) != NULL)
return exps;
if (!tname)
return sql_error(sql, 02,
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2304,7 +2304,7 @@ rollforward_changeset_updates(sql_trans 
if (fs->dset) {
for (n = fs->dset->h; ok == LOG_OK && n; n = n->next) {
sql_base *fb = n->data;
-   node *tbn = cs_find_name(ts, fb->name);
+   node *tbn = cs_find_id(ts, fb->id);
 
if (tbn) {
sql_base *tb = tbn->data;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2014-09-22 Thread Niels Nes
Changeset: 8f10a8b13e77 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8f10a8b13e77
Modified Files:
sql/backends/monet5/sql_round_impl.h
sql/test/bugs/Tests/alter_add_column-bug.stable.err
Branch: default
Log Message:

merged with Oct2014


diffs (47 lines):

diff --git a/sql/backends/monet5/sql_round_impl.h 
b/sql/backends/monet5/sql_round_impl.h
--- a/sql/backends/monet5/sql_round_impl.h
+++ b/sql/backends/monet5/sql_round_impl.h
@@ -291,8 +291,8 @@ str_2dec(TYPE *res, str *val, int *d, in
 {
char *s = strip_extra_zeros(*val);
char *dot = strchr(s, '.'), *end = NULL;
-   int digits = _strlen(s) - 1;
-   int scale = digits - (int) (dot - s);
+   int digits = _strlen(s);
+   int scale = digits - (int) (dot - s) - 1;
lng value = 0;
 
if (!dot) {
@@ -305,7 +305,7 @@ str_2dec(TYPE *res, str *val, int *d, in
} else { /* we have a dot in the string */
digits--;
}
-   if (digits <= 0)
+   if (digits < 0)
throw(SQL, STRING(TYPE), "decimal (%s) doesn't have format 
(%d.%d)", *val, *d, *sc);
 
value = decimal_from_str(s, &end);
@@ -335,7 +335,7 @@ str_2dec(TYPE *res, str *val, int *d, in
throw(SQL, STRING(TYPE), "rounding of decimal (%s) 
doesn't fit format (%d.%d)", *val, *d, *sc);
}
}
-   if (digits <= 0 || digits > *d || *end) {
+   if (value <= -scales[*d] || value >= scales[*d]  || *end) {
throw(SQL, STRING(TYPE), "decimal (%s) doesn't have format 
(%d.%d)", *val, *d, *sc);
}
*res = (TYPE) value;
diff --git a/sql/test/bugs/Tests/alter_add_column-bug.stable.err 
b/sql/test/bugs/Tests/alter_add_column-bug.stable.err
--- a/sql/test/bugs/Tests/alter_add_column-bug.stable.err
+++ b/sql/test/bugs/Tests/alter_add_column-bug.stable.err
@@ -12,9 +12,9 @@ stderr of test 'alter_add_column-bug` in
 # 23:04:06 >  mclient -lsql -umonetdb -Pmonetdb --host=koala --port=36740 
 # 23:04:06 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-23209/.s.monetdb.33225
+MAPI  = (monetdb) /var/tmp/mtest-28252/.s.monetdb.32257
 QUERY = ALTER TABLE "myschema"."COLLECTION_INFO" ADD COLUMN test_col1  
varchar(256);
-ERROR = !ALTER TABLE: no such table 'COLLECTION_INFO'
+ERROR = !ALTER TABLE: no such table 'COLLECTION_INFO' in schema 'myschema'
 
 # 23:04:06 >  
 # 23:04:06 >  Done.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with Oct2014

2014-09-22 Thread Niels Nes
Changeset: 69eac417e424 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69eac417e424
Added Files:
clients/R/MonetDB.R/R/dbi.R
clients/R/MonetDB.R/R/dplyr.R
clients/R/MonetDB.R/R/mapi.R
Removed Files:
clients/R/MonetDB.R/R/monetdb.R
Modified Files:
clients/R/MonetDB.R/DESCRIPTION
clients/R/MonetDB.R/NAMESPACE
clients/R/MonetDB.R/NEWS
clients/R/Tests/dplyr.R
configure.ag
gdk/gdk_calc_compare.h
gdk/gdk_join.c
sql/backends/monet5/sql_round_impl.h
sql/server/rel_dump.c
sql/server/rel_optimizer.c
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/sql_decimal.c
sql/server/sql_decimal.h
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/storage/bat/bat_storage.c

sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
sql/test/Tests/identifiers.stable.err
sql/test/Tests/identifiers.stable.out
Branch: default
Log Message:

merged with Oct2014


diffs (truncated from 2917 to 300 lines):

diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -5,6 +5,7 @@ Authors@R: c(person("Hannes Muehleisen",
person("Thomas Lumley", role = "ctb"),
person("Anthony Damico", role = "ctb"))
 Depends: DBI (>= 0.3), digest (>= 0.6.4), bitops (>= 1.0), methods
+Suggests: dplyr(>= 0.2.0.9000)
 Description: Allows to pull data from MonetDB into R
 License: MPL (== 1.1)
 URL: http://monetr.r-forge.r-project.org
diff --git a/clients/R/MonetDB.R/NAMESPACE b/clients/R/MonetDB.R/NAMESPACE
--- a/clients/R/MonetDB.R/NAMESPACE
+++ b/clients/R/MonetDB.R/NAMESPACE
@@ -4,16 +4,9 @@ import(DBI,digest,methods,bitops)
 export(MonetDB,MonetR,MonetDBR,MonetDB.R)
 export(monet.read.csv,monetdb.read.csv)
 # this one is not in the DBI
-exportMethods(dbSendUpdate,dbSendUpdateAsync,dbTransaction)
-export(monetdbGetTransferredBytes)
-export(monetdbRtype)
-export(monetdb_queryinfo)
-
-# shorthand for db connections
-export(mc)
-
-# shorthand for db queries
-export(mq)
+exportMethods(dbSendUpdate,dbSendUpdateAsync,dbTransaction,dbIsValid)
+# shorthands
+export(mc,mq)
 
 # control.R
 export(monetdb.server.setup)
@@ -22,3 +15,17 @@ export(monetdb.server.stop)
 export(monetdbd.liststatus)
 export(monetdb.liststatus)
 useDynLib(MonetDB.R)
+
+# dplyr.R
+export(src_monetdb)
+export(translate_env.src_monetdb)
+export(brief_desc.src_monetdb)
+export(tbl.src_monetdb)
+export(db_query_fields.MonetDBConnection)
+export(db_query_rows.MonetDBConnection)
+export(db_save_query.MonetDBConnection)
+export(db_insert_into.MonetDBConnection)
+export(db_create_index.MonetDBConnection)
+export(db_analyze.MonetDBConnection)
+export(db_begin.MonetDBConnection)
+export(sql_subquery.MonetDBConnection)
diff --git a/clients/R/MonetDB.R/NEWS b/clients/R/MonetDB.R/NEWS
--- a/clients/R/MonetDB.R/NEWS
+++ b/clients/R/MonetDB.R/NEWS
@@ -5,6 +5,8 @@ 0.9.5
 - DBI 0.3 compatibility (isValid etc.)
 - deprecated dbTransaction() (DBI has standardized dbBegin())
 - Back to R socket code for peace of mind
+- Code cleanup
+- dplyr integration moved to MonetDB.R
 
 0.9.4
 - dbWriteTable overhaul (thanks, Anthony)
diff --git a/clients/R/MonetDB.R/R/dbi.R b/clients/R/MonetDB.R/R/dbi.R
new file mode 100644
--- /dev/null
+++ b/clients/R/MonetDB.R/R/dbi.R
@@ -0,0 +1,657 @@
+C_LIBRARY <- "MonetDB.R"
+
+.onLoad <- function(lib, pkg) {
+  if (getOption("monetdb.clib", FALSE)) {
+library.dynam( C_LIBRARY, pkg, lib )
+.Call("mapiInit", PACKAGE=C_LIBRARY)
+  }
+}
+
+# Make S4 aware of S3 classes
+setOldClass(c("sockconn", "connection", "monetdb_mapi_conn"))
+
+### MonetDBDriver
+setClass("MonetDBDriver", representation("DBIDriver"))
+
+# allow instantiation of this driver with MonetDB to allow existing programs 
to work
+MonetR <- MonetDB <- MonetDBR <- MonetDB.R <- function() {
+  new("MonetDBDriver")
+}
+
+# dbIsValid is missing from the DBI 0.3, so redefine
+setGeneric("dbIsValid", 
+  def = function(dbObj, ...) standardGeneric("dbIsValid"),
+  valueClass = "logical")
+
+setMethod("dbIsValid", "MonetDBDriver", def=function(dbObj, ...) {
+  return(TRUE) # driver object cannot be invalid
+})
+
+setMethod("dbUnloadDriver", "MonetDBDriver", def=function(drv, ...) {
+  return(TRUE) # there is nothing to really unload here...
+})
+
+setMethod("dbGetInfo", "MonetDBDriver", def=function(dbObj, ...)
+  list(name="MonetDBDriver", 
+   driver.version=packageVersion("MonetDB.R"), 
+   DBI.version=packageVersion("DBI"), 
+   client.version="NA", 
+   max.connections=125) # R can only handle 128 connections, three of 
which are pre-allocated
+)
+
+# shorthand for connecting to the DB, very handy, e.g. dbListTables(mc("acs"))
+mc <- function(dbname="demo", user="monetdb", password="monetdb", 
host="localhost", port=5L, 
+  

MonetDB: default - merged with Oct2014

2014-09-14 Thread Niels Nes
Changeset: c56b9b975224 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c56b9b975224
Added Files:
sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.sql
sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.err
sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.out
Modified Files:
sql/backends/monet5/sql.c
sql/test/BugTracker-2014/Tests/All
Branch: default
Log Message:

merged with Oct2014


diffs (168 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -63,8 +63,9 @@ exp_is_point_select(sql_exp *e)
return 1;
if (e->type == e_cmp && !e->f && e->flag == (int) cmp_equal) {
sql_exp *r = e->r;
-
-   if (r->card <= CARD_AGGR)
+   sql_exp *l = e->l;
+
+   if (!is_func(l->type) && r->card <= CARD_AGGR)
return 1;
}
return 0;
diff --git a/sql/test/BugTracker-2014/Tests/All 
b/sql/test/BugTracker-2014/Tests/All
--- a/sql/test/BugTracker-2014/Tests/All
+++ b/sql/test/BugTracker-2014/Tests/All
@@ -40,3 +40,4 @@ orderby_on_constant.Bug-3554
 div_by_zero_in_return.Bug-3555
 round-sorted.Bug-3562
 locate-offset.Bug-3563
+aggr-with-limit.Bug-3498
diff --git a/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.sql 
b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.sql
@@ -0,0 +1,9 @@
+START TRANSACTION;
+
+CREATE TABLE simple_table("id" INTEGER);
+INSERT INTO simple_table VALUES (1),(2),(3),(4),(5);
+SELECT COUNT(*) AS val FROM simple_table ORDER BY val DESC;
+SELECT COUNT(*) AS val FROM simple_table ORDER BY val DESC LIMIT 5;
+SELECT COUNT(*) AS val FROM simple_table HAVING 1 > 0 ORDER BY val DESC LIMIT 
5;
+
+ROLLBACK;
diff --git a/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.err 
b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'aggr-with-limit.Bug-3498` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 16:07:42 >  
+# 16:07:42 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36743" "--set" 
"mapi_usock=/var/tmp/mtest-7574/.s.monetdb.36743" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_sql_test_BugTracker-2014"
 "--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 16:07:42 >  
+
+# builtin opt  gdk_dbpath = 
/ufs/sjoerd/Monet-candidate/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 = 36743
+# cmdline opt  mapi_usock = /var/tmp/mtest-7574/.s.monetdb.36743
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_sql_test_BugTracker-2014
+# cmdline opt  mal_listing = 0
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 16:07:43 >  
+# 16:07:43 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7574" "--port=36743"
+# 16:07:43 >  
+
+
+# 16:07:43 >  
+# 16:07:43 >  "Done."
+# 16:07:43 >  
+
diff --git a/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.out 
b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/aggr-with-limit.Bug-3498.stable.out
@@ -0,0 +1,84 @@
+stdout of test 'aggr-with-limit.Bug-3498` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 16:07:42 >  
+# 16:07:42 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36743" "--set" 
"mapi_usock=/var/tmp/mtest-7574/.s.monetdb.36743" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_sql_test_BugTracker-2014"
 "--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 16:07:42 >  
+
+# MonetDB 5 server v11.19.0 (hg id: ecb2e8102eee)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2014', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.590 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connectio

MonetDB: default - Merged with Oct2014 branch.

2014-08-30 Thread Stefan Manegold
Changeset: 67d8cf4edb63 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=67d8cf4edb63
Modified Files:
clients/Tests/SQL-dump_geom.stable.out.32bit
sql/benchmarks/tpch/Tests/22-explain.stable.out.32bit
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (296 lines):

diff --git a/clients/Tests/SQL-dump_geom.stable.out.32bit 
b/clients/Tests/SQL-dump_geom.stable.out.32bit
--- a/clients/Tests/SQL-dump_geom.stable.out.32bit
+++ b/clients/Tests/SQL-dump_geom.stable.out.32bit
@@ -707,6 +707,12 @@ external name generator.series;
 create function sys.generate_series(first tinyint, last tinyint, stepsize 
tinyint)
 returns table (value tinyint)
 external name generator.series;
+create function sys.generate_series(first smallint, last smallint)
+returns table (value smallint)
+external name generator.series;
+create function sys.generate_series(first smallint, last smallint, stepsize 
smallint)
+returns table (value smallint)
+external name generator.series;
 create function sys.generate_series(first int, last int)
 returns table (value int)
 external name generator.series;
@@ -1808,7 +1814,7 @@ 6449  "nils"  "bigint"64  0   6453
NULLtrue
 6450   "minval""clob"  0   0   6453NULLtrue10  
NULL
 6451   "maxval""clob"  0   0   6453NULLtrue11  
NULL
 6452   "sorted""boolean"   1   0   6453NULLtrue
12  NULL
-6563   "function_id"   "int"   32  0   6564NULLtrue0   
NULL
+6574   "function_id"   "int"   32  0   6575NULLtrue0   
NULL
 COMMIT;
 START TRANSACTION;
 CREATE TABLE "sys"."_tables" (
@@ -1861,7 +1867,7 @@ 6380  "storagemodelinput" 2000NULL0   
tru
 6428   "storagemodel"  2000"create view sys.storagemodel as select * from 
sys.storagemodel();" 1   true0   false
 6438   "tablestoragemodel" 2000"-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxillary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxillary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1   true0   false
 6453   "statistics"2000NULL0   true0   false
-6564   "systemfunctions"   2000NULL0   true0   false
+6575   "systemfunctions"   2000NULL0   true0   false
 COMMIT;
 START TRANSACTION;
 CREATE TABLE "sys"."args" (
@@ -1874,7 +1880,7 @@ CREATE TABLE "sys"."args" (
"inout"   TINYINT,
"number"  INTEGER
 );
-COPY 3693 RECORDS INTO "sys"."args" FROM stdin USING DELIMITERS '\t','\n','"';
+COPY 3700 RECORDS INTO "sys"."args" FROM stdin USING DELIMITERS '\t','\n','"';
 2155   28  "res_0" "oid"   31  0   0   0
 2156   28  "arg_1" "wrd"   32  0   1   1
 2157   29  "res_0" "oid"   31  0   0   0
@@ -5538,36 +5544,43 @@ 65126511"value" "tinyint"   8   0   
0   0
 6513   6511"first" "tinyint"   8   0   1   1
 6514   6511"last"  "tinyint"   8   0   1   2
 6515   6511"stepsize"  "tinyint"   8   0   1   3
-6518   6517"value" "int"   32  0   0   0
-6519   6517"first" "int"   32  0   1   1
-6520   6517"last"  "int"   32  0   1   2
-6523   6522"value" "int"   32  0   0   0
-6524   6522"first" "int"   32  0   1   1
-6525   6522"last"  "int"   32  0   1   2
-6526   6522"stepsize"  "int"   32  0   1   3
-6529   6528"value" "bigint"64  0   0   0
-6530   6528"first" "bigint"64  0   1   1
-6531   6528"last"  "bigint"64  0   1   2
-6534   6533"value" "bigint"64  0   0   0
-6535   6533"first" "bigint"64  0   1   1
-6536   6533"last"  "bigint"64  0   1   2
-6537   6533"stepsize"  "bigint"64  0   1   3
-6540   6539"value" "real"  24  0   0   0
-6541   6539"first" "real"  24  0   1   1
-6542   6539"last"  "real"  24  0   1   2
-6543   6539"stepsize"  "real"  24  0   1   3
-6546   6545"value" "double"53  0   0   0
-6547   6545"first" "double"53  0   1   1
-6548   6545"last"  "double"53  0   1 

MonetDB: default - Merged with Oct2014 branch.

2014-08-29 Thread Stefan Manegold
Changeset: f7afd1883a8f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f7afd1883a8f
Modified Files:
clients/Tests/SQL-dump_all.stable.out
clients/Tests/SQL-dump_all.stable.out.oid32
clients/Tests/SQL-dump_geom.stable.out
clients/Tests/SQL-dump_geom.stable.out.64bit.oid32
clients/Tests/SQL-dump_none.stable.out
gdk/gdk_aggr.c
monetdb5/modules/atoms/json.c
monetdb5/modules/kernel/aggr.mal
sql/backends/monet5/generator/90_generator.sql
sql/backends/monet5/generator/generator.c
sql/backends/monet5/generator/generator.h
sql/backends/monet5/sql.c
sql/backends/monet5/sql_gencode.c
sql/benchmarks/ssbm/Tests/01-explain.stable.out
sql/benchmarks/ssbm/Tests/02-explain.stable.out
sql/benchmarks/ssbm/Tests/03-explain.stable.out
sql/benchmarks/tpch/Tests/06-explain.stable.out
sql/benchmarks/tpch/Tests/11-explain.stable.out
sql/benchmarks/tpch/Tests/14-explain.stable.out
sql/benchmarks/tpch/Tests/15-explain.stable.out
sql/benchmarks/tpch/Tests/17-explain.stable.out
sql/benchmarks/tpch/Tests/19-explain.stable.out
sql/benchmarks/tpch/Tests/22-explain.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/Tests/systemfunctions.stable.out
sql/test/Tests/systemfunctions_bam.stable.out
sql/test/Tests/systemfunctions_gsl.stable.out
sql/test/Tests/systemfunctions_nogeom.stable.out
sql/test/leaks/Tests/check1.stable.out
sql/test/leaks/Tests/check1_bam.stable.out
sql/test/leaks/Tests/check1_gsl.stable.out
sql/test/leaks/Tests/check1_nogeom.stable.out
sql/test/leaks/Tests/check2.stable.out
sql/test/leaks/Tests/check2_bam.stable.out
sql/test/leaks/Tests/check2_gsl.stable.out
sql/test/leaks/Tests/check2_nogeom.stable.out
sql/test/leaks/Tests/check3.stable.out
sql/test/leaks/Tests/check3_bam.stable.out
sql/test/leaks/Tests/check3_gsl.stable.out
sql/test/leaks/Tests/check3_nogeom.stable.out
sql/test/leaks/Tests/check4.stable.out
sql/test/leaks/Tests/check4_bam.stable.out
sql/test/leaks/Tests/check4_gsl.stable.out
sql/test/leaks/Tests/check4_nogeom.stable.out
sql/test/leaks/Tests/check5.stable.out
sql/test/leaks/Tests/check5_bam.stable.out
sql/test/leaks/Tests/check5_gsl.stable.out
sql/test/leaks/Tests/check5_nogeom.stable.out
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (truncated from 3124 to 300 lines):

diff --git a/clients/Tests/SQL-dump_all.stable.out 
b/clients/Tests/SQL-dump_all.stable.out
--- a/clients/Tests/SQL-dump_all.stable.out
+++ b/clients/Tests/SQL-dump_all.stable.out
@@ -738,6 +738,12 @@ external name generator.series;
 create function sys.generate_series(first tinyint, last tinyint, stepsize 
tinyint)
 returns table (value tinyint)
 external name generator.series;
+create function sys.generate_series(first smallint, last smallint)
+returns table (value smallint)
+external name generator.series;
+create function sys.generate_series(first smallint, last smallint, stepsize 
smallint)
+returns table (value smallint)
+external name generator.series;
 create function sys.generate_series(first int, last int)
 returns table (value int)
 external name generator.series;
@@ -1884,7 +1890,7 @@ 6614  "pnext" "int"   32  0   6618NULL
false   
 6615   "tlen"  "int"   32  0   6618NULLfalse   8   NULL
 6616   "seq"   "clob"  0   0   6618NULLfalse   9   NULL
 6617   "qual"  "clob"  0   0   6618NULLfalse   10  NULL
-6677   "function_id"   "int"   32  0   6678NULLtrue0   
NULL
+6688   "function_id"   "int"   32  0   6689NULLtrue0   
NULL
 COMMIT;
 START TRANSACTION;
 CREATE TABLE "sys"."_tables" (
@@ -1942,7 +1948,7 @@ 6574  "sq"6510NULL0   true0   
false
 6593   "rg"6510NULL0   true0   false
 6605   "pg"6510NULL0   true0   false
 6618   "export"6510NULL0   true0   false
-6678   "systemfunctions"   2000NULL0   true0   false
+6689   "systemfunctions"   2000NULL0   true0   false
 COMMIT;
 START TRANSACTION;
 CREATE TABLE "sys"."args" (
@@ -1955,7 +1961,7 @@ CREATE TABLE "sys"."args" (
"inout"   TINYINT,
"number"  INTEGER
 );
-COPY 3717 RECORDS INTO "sys"."args" FROM stdin USING DELIMITERS '\t','\n','"';
+COPY 3724 RECORDS INTO "sys"."args" FROM stdin USING DELIMITERS '\t','\n','"';
 2155   28  "res_0" "oid"   63  0   0   0
 2156   28  "arg_1" "wrd"   64  0   1   1
 2157   29  "res_0" "oid"   63  0   0   0
@@ -5643,36 +5649,43 @@ 66266625"valu

MonetDB: default - Merged with Oct2014 branch.

2014-08-15 Thread Sjoerd Mullender
Changeset: 3975d85c6aa4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3975d85c6aa4
Modified Files:
sql/server/rel_optimizer.c
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (12 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -2065,7 +2065,7 @@ exp_shares_exps( sql_exp *e, list *share
if (!ne)
return 0;
if (ne && ne->type != e_column) {
-   lng used = (1

MonetDB: default - Merged with Oct2014 branch.

2014-08-13 Thread Sjoerd Mullender
Changeset: 493e3f110044 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=493e3f110044
Modified Files:
NT/installer32/MonetDB-ODBC-Installer.vdproj
NT/installer32/MonetDB5-Geom-Module.vdproj
NT/installer32/MonetDB5-SQL-Installer.vdproj
NT/installer64/MonetDB-ODBC-Installer.vdproj
NT/installer64/MonetDB5-Geom-Module.vdproj
NT/installer64/MonetDB5-SQL-Installer.vdproj
monetdb5/extras/rapi/Tests/rapi07.malC
monetdb5/extras/rapi/Tests/rapi07.stable.out
monetdb5/extras/rapi/Tests/rapi08.malC
monetdb5/extras/rapi/Tests/rapi08.stable.out
monetdb5/extras/rapi/rapi.mal
monetdb5/mal/mal_interpreter.c
testing/README
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (truncated from 707 to 300 lines):

diff --git a/NT/installer32/MonetDB-ODBC-Installer.vdproj 
b/NT/installer32/MonetDB-ODBC-Installer.vdproj
--- a/NT/installer32/MonetDB-ODBC-Installer.vdproj
+++ b/NT/installer32/MonetDB-ODBC-Installer.vdproj
@@ -230,7 +230,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_17D7FB69076E415C8973295D502161C5"
 {
-"SourcePath" = 
"8:C:\\Libraries\\iconv-1.11.1.win32-vs10\\bin\\iconv.dll"
+"SourcePath" = 
"8:C:\\Libraries\\iconv-1.11.1.win32\\bin\\iconv.dll"
 "TargetName" = "8:iconv.dll"
 "Tag" = "8:"
 "Folder" = "8:_376EC0506E4F452CA2C78ACE11515435"
@@ -250,7 +250,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2E74F1B1BDE548A7922BAD968E690A3A"
 {
-"SourcePath" = 
"8:C:\\Libraries\\bzip2-1.0.6.win32-vs10\\bin\\libbz2.dll"
+"SourcePath" = 
"8:C:\\Libraries\\bzip2-1.0.6.win32\\bin\\libbz2.dll"
 "TargetName" = "8:libbz2.dll"
 "Tag" = "8:"
 "Folder" = "8:_376EC0506E4F452CA2C78ACE11515435"
@@ -290,7 +290,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4F0D2367141846EFA634DA35B05CDA4D"
 {
-"SourcePath" = 
"8:C:\\Libraries\\zlib-1.2.5.win32-vs10\\bin\\zlib1.dll"
+"SourcePath" = "8:C:\\Libraries\\zlib-1.2.5.win32\\bin\\zlib1.dll"
 "TargetName" = "8:zlib1.dll"
 "Tag" = "8:"
 "Folder" = "8:_376EC0506E4F452CA2C78ACE11515435"
@@ -330,7 +330,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_779449EF5BAD4B068A50802402E52278"
 {
-"SourcePath" = 
"8:C:\\Libraries\\openssl-1.0.1g.win32-vs10\\bin\\libeay32.dll"
+"SourcePath" = 
"8:C:\\Libraries\\openssl-1.0.1g.win32\\bin\\libeay32.dll"
 "TargetName" = "8:libeay32.dll"
 "Tag" = "8:"
 "Folder" = "8:_376EC0506E4F452CA2C78ACE11515435"
@@ -370,7 +370,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B1B1C0011D7945F892A77F529772EA72"
 {
-"SourcePath" = 
"8:C:\\Libraries\\openssl-1.0.1g.win32-vs10\\bin\\ssleay32.dll"
+"SourcePath" = 
"8:C:\\Libraries\\openssl-1.0.1g.win32\\bin\\ssleay32.dll"
 "TargetName" = "8:ssleay32.dll"
 "Tag" = "8:"
 "Folder" = "8:_376EC0506E4F452CA2C78ACE11515435"
diff --git a/NT/installer32/MonetDB5-Geom-Module.vdproj 
b/NT/installer32/MonetDB5-Geom-Module.vdproj
--- a/NT/installer32/MonetDB5-Geom-Module.vdproj
+++ b/NT/installer32/MonetDB5-Geom-Module.vdproj
@@ -226,7 +226,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6C07D912740F414490DD35D5A179D268"
 {
-"SourcePath" = 
"8:C:\\Libraries\\geos-3.4.2.win32-vs10\\bin\\geos_c.dll"
+"SourcePath" = "8:C:\\Libraries\\geos-3.4.2.win32\\bin\\geos_c.dll"
 "TargetName" = "8:geos_c.dll"
 "Tag" = "8:"
 "Folder" = "8:_4D9CE65EDD774551869CFD46B59B4F9E"
diff --git a/NT/installer32/MonetDB5-SQL-Installer.vdproj 
b/NT/installer32/MonetDB5-SQL-Installer.vdproj
--- a/NT/installer32/MonetDB5-SQL-Installer.vdproj
+++ b/NT/installer32/MonetDB5-SQL-Installer.vdproj
@@ -1042,7 +1042,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_03431EDC85094776AD217020CB3E26D4"
 {
-"SourcePath" = 
"8:C:\\Libraries\\zlib-1.2.5.win32-vs10\\lib\\zdll.lib"
+"SourcePath" = "8:C:\\Libraries\\zlib-1.2.5.win32\\lib\\zdll.lib"
 "TargetName" = "8:zdll.lib"
 "Tag" = "8:"
 "Folder" = "8:_A3C9BE5CA72B42628868618D180581DA"
@@ -1182,7 +1182,7 @@
 }
 
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0D84516ED4054FEA84A5E2C60F42AFE3"
 {
-"SourcePath" = 
"8:C:\\Libraries\\bzip2-1.0.6.win32-vs10\\bin\\libbz2.dll"
+"SourcePath" = 
"8:C:\\Libraries\\bzip2-1.0.6.win32\\bin\\libbz2.dll"
 "TargetName" = "8:libbz2.dll"
 "Tag" = "8:"
 "Folder" = "8:_A3C9BE5CA72B42628868618D180581DA"
@@ -128

MonetDB: default - Merged with Oct2014 branch.

2014-08-12 Thread Stefan Manegold
Changeset: 57bee4687875 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57bee4687875
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_all.stable.out.int128
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out.int128
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out.int128
clients/Tests/MAL-signatures_none.stable.out
clients/Tests/MAL-signatures_none.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/json.h
monetdb5/modules/atoms/json.mal
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (truncated from 426 to 300 lines):

diff --git a/clients/Tests/MAL-signatures_all.stable.out 
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -39353,23 +39353,23 @@ address JSONfold;
 comment Combine the key-value pairs into a single json object list.
 
 command json.filter(name:json,idx:lng,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_lng;
 comment Extract a single array element
 
 command json.filter(name:json,idx:lng):json 
-address JSONfilterArray;
+address JSONfilterArray_lng;
 command json.filter(name:json,idx:int,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_int;
 command json.filter(name:json,idx:int):json 
-address JSONfilterArray;
+address JSONfilterArray_int;
 command json.filter(name:json,idx:sht,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_sht;
 command json.filter(name:json,idx:sht):json 
-address JSONfilterArray;
+address JSONfilterArray_sht;
 command json.filter(name:json,idx:bte,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_bte;
 command json.filter(name:json,idx:bte):json 
-address JSONfilterArray;
+address JSONfilterArray_bte;
 command json.filter(name:json,pathexpr:str):json 
 address JSONfilter;
 comment Filter all members of an object by a path expression, returning an 
array.Non-matching elements are skipped.
diff --git a/clients/Tests/MAL-signatures_all.stable.out.int128 
b/clients/Tests/MAL-signatures_all.stable.out.int128
--- a/clients/Tests/MAL-signatures_all.stable.out.int128
+++ b/clients/Tests/MAL-signatures_all.stable.out.int128
@@ -50295,23 +50295,23 @@ address JSONfold;
 comment Combine the key-value pairs into a single json object list.
 
 command json.filter(name:json,idx:lng,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_lng;
 comment Extract a single array element
 
 command json.filter(name:json,idx:lng):json 
-address JSONfilterArray;
+address JSONfilterArray_lng;
 command json.filter(name:json,idx:int,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_int;
 command json.filter(name:json,idx:int):json 
-address JSONfilterArray;
+address JSONfilterArray_int;
 command json.filter(name:json,idx:sht,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_sht;
 command json.filter(name:json,idx:sht):json 
-address JSONfilterArray;
+address JSONfilterArray_sht;
 command json.filter(name:json,idx:bte,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_bte;
 command json.filter(name:json,idx:bte):json 
-address JSONfilterArray;
+address JSONfilterArray_bte;
 command json.filter(name:json,pathexpr:str):json 
 address JSONfilter;
 comment Filter all members of an object by a path expression, returning an 
array.Non-matching elements are skipped.
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out 
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -39269,23 +39269,23 @@ address JSONfold;
 comment Combine the key-value pairs into a single json object list.
 
 command json.filter(name:json,idx:lng,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_lng;
 comment Extract a single array element
 
 command json.filter(name:json,idx:lng):json 
-address JSONfilterArray;
+address JSONfilterArray_lng;
 command json.filter(name:json,idx:int,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_int;
 command json.filter(name:json,idx:int):json 
-address JSONfilterArray;
+address JSONfilterArray_int;
 command json.filter(name:json,idx:sht,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_sht;
 command json.filter(name:json,idx:sht):json 
-address JSONfilterArray;
+address JSONfilterArray_sht;
 command json.filter(name:json,idx:bte,other:str):json 
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_bte;
 command

MonetDB: default - Merged with Oct2014 branch.

2014-08-12 Thread Stefan Manegold
Changeset: 1a08fd49662c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a08fd49662c
Added Files:
clients/Tests/MAL-signatures_all.malC
clients/Tests/MAL-signatures_fits_geom.malC.src
clients/Tests/MAL-signatures_fits_geom.stable.err
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.malC.src
clients/Tests/MAL-signatures_geom.stable.err
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/SQL-dump_all.sql
clients/Tests/SQL-dump_geom.sql.src
clients/Tests/SQL-dump_geom.stable.err
clients/Tests/SQL-dump_geom.stable.out
clients/Tests/SQL-dump_geom.stable.out.32bit
clients/Tests/SQL-dump_geom.stable.out.64bit.oid32
Removed Files:
clients/Tests/MAL-signatures.malC
clients/Tests/MAL-signatures.stable.err
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/MAL-signatures_R.malC.src
clients/Tests/MAL-signatures_R.stable.err
clients/Tests/MAL-signatures_R.stable.out
clients/Tests/MAL-signatures_R.stable.out.int128
clients/Tests/MAL-signatures_all.malC.src
clients/Tests/MAL-signatures_bam.malC.src
clients/Tests/MAL-signatures_bam.stable.err
clients/Tests/MAL-signatures_bam.stable.out
clients/Tests/MAL-signatures_bam.stable.out.int128
clients/Tests/MAL-signatures_gsl.malC.src
clients/Tests/MAL-signatures_gsl.stable.err
clients/Tests/MAL-signatures_gsl.stable.out
clients/Tests/MAL-signatures_gsl.stable.out.int128
clients/Tests/MAL-signatures_nocfitsio.malC.src
clients/Tests/MAL-signatures_nocfitsio.stable.err
clients/Tests/MAL-signatures_nocfitsio.stable.out
clients/Tests/MAL-signatures_nocfitsio.stable.out.int128
clients/Tests/SQL-dump.sql
clients/Tests/SQL-dump.stable.err
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.32bit
clients/Tests/SQL-dump.stable.out.64bit.oid32
clients/Tests/SQL-dump.stable.out.64bit.oid32.int128
clients/Tests/SQL-dump.stable.out.int128
clients/Tests/SQL-dump.timeout
clients/Tests/SQL-dump_all.sql.src
Modified Files:
clients/Tests/All
clients/Tests/MAL-signatures_none.malC.src
clients/Tests/SQL-dump_none.sql.src
configure.ag
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (truncated from 415343 to 300 lines):

diff --git a/clients/Tests/All b/clients/Tests/All
--- a/clients/Tests/All
+++ b/clients/Tests/All
@@ -1,11 +1,8 @@
 exports
-HAVE_CFITSIO&HAVE_GEOM&!HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures
-HAVE_CFITSIO&HAVE_GEOM&HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_gsl
-HAVE_CFITSIO&HAVE_GEOM&HAVE_GSL&!HAVE_LIBR&HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_bam
-HAVE_CFITSIO&HAVE_GEOM&HAVE_GSL&HAVE_LIBR&HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_R
-!HAVE_CFITSIO&HAVE_GEOM&!HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_nocfitsio
 
HAVE_CFITSIO&HAVE_GEOM&HAVE_GSL&HAVE_LIBR&HAVE_SAMTOOLS&HAVE_SPHINXCLIENT?MAL-signatures_all
+HAVE_CFITSIO&HAVE_GEOM&!HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_fits_geom
+!HAVE_CFITSIO&HAVE_GEOM&!HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_geom
 
!HAVE_CFITSIO&!HAVE_GEOM&!HAVE_GSL&!HAVE_LIBR&!HAVE_SAMTOOLS&!HAVE_SPHINXCLIENT?MAL-signatures_none
-HAVE_GEOM&!HAVE_GSL&!HAVE_SAMTOOLS?SQL-dump
 HAVE_GEOM&HAVE_GSL&HAVE_SAMTOOLS?SQL-dump_all
+HAVE_GEOM&!HAVE_GSL&!HAVE_SAMTOOLS?SQL-dump_geom
 !HAVE_GEOM&!HAVE_GSL&!HAVE_SAMTOOLS?SQL-dump_none
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
deleted file mode 100644
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ /dev/null
@@ -1,53557 +0,0 @@
-stdout of test 'MAL-signatures` in directory 'clients` itself:
-
-
-# 14:24:10 >  
-# 14:24:10 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31236" "--set" 
"mapi_usock=/var/tmp/mtest-21213/.s.monetdb.31236" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-candidate/var/MonetDB/mTests_clients" "--set" 
"mal_listing=2"
-# 14:24:10 >  
-
-# MonetDB 5 server v11.17.0
-# This is an unreleased version
-# Serving database 'mTests_clients', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Found 15.591 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://madrid.ins.cwi.nl:31236/
-# Listening for UNIX domain connection requests on 
mapi:monetdb://

MonetDB: default - Merged with Oct2014 branch.

2014-08-11 Thread Stefan Manegold
Changeset: 903a76b688e1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=903a76b688e1
Modified Files:
clients/Tests/SQL-dump.stable.out.32bit
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (109 lines):

diff --git a/clients/Tests/SQL-dump.stable.out.32bit 
b/clients/Tests/SQL-dump.stable.out.32bit
--- a/clients/Tests/SQL-dump.stable.out.32bit
+++ b/clients/Tests/SQL-dump.stable.out.32bit
@@ -236,6 +236,7 @@ SYSTEM FUNCTION  sys.y
 SYSTEM FUNCTION  sys.zorder_decode_x
 SYSTEM FUNCTION  sys.zorder_decode_y
 SYSTEM FUNCTION  sys.zorder_encode
+CREATE SCHEMA "json" AUTHORIZATION "monetdb";
 CREATE SCHEMA "tmp";
 CREATE SCHEMA "sys";
 CREATE TABLE "sys"."_columns" (
@@ -681,6 +682,55 @@ returns integer external name udf.fuse;
 -- fuse two (4-byte) integer values into one (8-byte) bigint value
 create function fuse(one integer, two integer)
 returns bigint external name udf.fuse;
+-- The contents of this file are subject to the MonetDB Public License
+-- Version 1.1 (the "License"); you may not use this file except in
+-- compliance with the License. You may obtain a copy of the License at
+-- http://www.monetdb.org/Legal/MonetDBLicense
+--
+-- Software distributed under the License is distributed on an "AS IS"
+-- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+-- License for the specific language governing rights and limitations
+-- under the License.
+--
+-- The Original Code is the MonetDB Database System.
+--
+-- The Initial Developer of the Original Code is CWI.
+-- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+-- Copyright August 2008-2014 MonetDB B.V.
+-- All Rights Reserved.
+
+-- (c) Author M.Kersten
+
+create function sys.generate_series(first tinyint, last tinyint)
+returns table (value tinyint)
+external name generator.series;
+create function sys.generate_series(first tinyint, last tinyint, stepsize 
tinyint)
+returns table (value tinyint)
+external name generator.series;
+create function sys.generate_series(first int, last int)
+returns table (value int)
+external name generator.series;
+create function sys.generate_series(first int, last int, stepsize int)
+returns table (value int)
+external name generator.series;
+create function sys.generate_series(first bigint, last bigint)
+returns table (value bigint)
+external name generator.series;
+create function sys.generate_series(first bigint, last bigint, stepsize bigint)
+returns table (value bigint)
+external name generator.series;
+create function sys.generate_series(first real, last real, stepsize real)
+returns table (value real)
+external name generator.series;
+create function sys.generate_series(first double, last double, stepsize double)
+returns table (value double)
+external name generator.series;
+create function sys.generate_series(first decimal(10,2), last decimal(10,2), 
stepsize decimal(10,2))
+returns table (value decimal(10,2))
+external name generator.series;
+create function sys.generate_series(first timestamp, last timestamp, stepsize 
interval second)
+returns table (value timestamp)
+external name generator.series;
 create function geomcollectionfromtext(wkt string, srid smallint) returns 
multipolygon external name geom."GeomCollectionFromText";
 create function geometrytypeid(g geometry) returns integer external name 
geom."GeometryTypeId";
 -- The srid in the *FromText Functions is currently not used
@@ -711,6 +761,16 @@ create function getroboturl(theurl url) 
external name url."getRobotURL";
 create function getuser(theurl url) returns string   
external name url."getUser";
+create function sys.hashsize(b boolean, i bigint)
+returns bigint
+begin
+   -- assume non-compound keys
+   if  b = true
+   then
+   return 8 * i;
+   end if;
+   return 0;
+end;
 create function sys.heapsize(tpe string, i bigint, w int)
 returns bigint
 begin
@@ -725,6 +785,24 @@ create function "host" (p inet) returns 
 create function "hostmask" (p inet) returns inet
external name inet."hostmask";
 create filter function "ilike"(val string, pat string, esc string) external 
name algebra.ilikesubselect;
+create function sys.imprintsize(i bigint, nme string)
+returns bigint
+begin
+   if nme = 'boolean'
+   or nme = 'tinyint'
+   or nme = 'smallint'
+   or nme = 'int'  
+   or nme = 'bigint'   
+   or nme = 'decimal'  
+   or nme = 'date'
+   or nme = 'timestamp'
+   or nme = 'real'
+   or nme = 'double'
+   then
+   return cast( i * 0.12 as bigint);
+   end if ;
+   return 0;
+end;
 create function intersection(a geometry, b geometry) returns geometry external 
name geom."Intersection";
 create function isaurl(theurl url) returns bool
external name url."isaURL";
___
checkin-list mailing list
checkin-list@mon

MonetDB: default - Merged with Oct2014 branch.

2014-08-11 Thread Stefan Manegold
Changeset: cc3ba2a1ebb4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc3ba2a1ebb4
Modified Files:
clients/Tests/SQL-dump.sql
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.64bit.oid32
clients/Tests/SQL-dump_all.stable.out
clients/Tests/SQL-dump_all.stable.out.oid32
clients/Tests/SQL-dump_none.stable.out
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (truncated from 682 to 300 lines):

diff --git a/clients/Tests/SQL-dump.sql b/clients/Tests/SQL-dump.sql
--- a/clients/Tests/SQL-dump.sql
+++ b/clients/Tests/SQL-dump.sql
@@ -10,6 +10,8 @@
 \dSs
 \dSf
 
+\dn bam
+\dn json
 \dn tmp
 
 \dSn sys
@@ -62,6 +64,7 @@
 \dSf sys.boundary
 \dSf sys.broadcast
 \dSf sys.buffer
+\dSf sys.chi2prob
 \dSf sys.cluster1
 \dSf sys.cluster2
 \dSf sys.columnsize
@@ -93,13 +96,13 @@
 \dSf sys.dimension
 \dSf sys.disjoint
 \dSf sys.distance
-\dSf sys.dropdictionary
 \dSf sys.env
 \dSf sys.envelope
 \dSf sys.environment
 \dSf sys.equals
 \dSf sys.evalalgebra
 \dSf sys.fuse
+\dSf sys.generate_series
 \dSf sys.geomcollectionfromtext
 \dSf sys.geometrytypeid
 \dSf sys.geomfromtext
@@ -116,29 +119,17 @@
 \dSf sys.getquery
 \dSf sys.getroboturl
 \dSf sys.getuser
-\dSf sys.gzcompress
-\dSf sys.gzdecompress
-\dSf sys.gzexpand
-\dSf sys.gztruncate
+\dSf sys.hashsize
 \dSf sys.heapsize
 \dSf sys.host
 \dSf sys.hostmask
 \dSf sys.ilike
-\dSf sys.indexsize
-\dSf sys.initializedictionary
+\dSf sys.imprintsize
 \dSf sys.intersection
 \dSf sys.isaurl
 \dSf sys.isauuid
 \dSf sys.isempty
 \dSf sys.issimple
-\dSf sys.json_filter
-\dSf sys.json_filter_all
-\dSf sys.json_isvalid
-\dSf sys.json_isvalidarray
-\dSf sys.json_isvalidobject
-\dSf sys.json_length
-\dSf sys.json_path
-\dSf sys.json_text
 \dSf sys.length
 \dSf sys.like
 \dSf sys.linefromtext
@@ -156,7 +147,6 @@
 \dSf sys.ms_trunc
 \dSf sys.netmask
 \dSf sys.network
-\dSf sys.newdictionary
 \dSf sys.newurl
 \dSf sys.optimizer_stats
 \dSf sys.optimizers
diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -240,6 +240,7 @@ SYSTEM FUNCTION  sys.y
 SYSTEM FUNCTION  sys.zorder_decode_x
 SYSTEM FUNCTION  sys.zorder_decode_y
 SYSTEM FUNCTION  sys.zorder_encode
+CREATE SCHEMA "json" AUTHORIZATION "monetdb";
 CREATE SCHEMA "tmp";
 CREATE SCHEMA "sys";
 CREATE TABLE "sys"."_columns" (
@@ -685,6 +686,55 @@ returns integer external name udf.fuse;
 -- fuse two (4-byte) integer values into one (8-byte) bigint value
 create function fuse(one integer, two integer)
 returns bigint external name udf.fuse;
+-- The contents of this file are subject to the MonetDB Public License
+-- Version 1.1 (the "License"); you may not use this file except in
+-- compliance with the License. You may obtain a copy of the License at
+-- http://www.monetdb.org/Legal/MonetDBLicense
+--
+-- Software distributed under the License is distributed on an "AS IS"
+-- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+-- License for the specific language governing rights and limitations
+-- under the License.
+--
+-- The Original Code is the MonetDB Database System.
+--
+-- The Initial Developer of the Original Code is CWI.
+-- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+-- Copyright August 2008-2014 MonetDB B.V.
+-- All Rights Reserved.
+
+-- (c) Author M.Kersten
+
+create function sys.generate_series(first tinyint, last tinyint)
+returns table (value tinyint)
+external name generator.series;
+create function sys.generate_series(first tinyint, last tinyint, stepsize 
tinyint)
+returns table (value tinyint)
+external name generator.series;
+create function sys.generate_series(first int, last int)
+returns table (value int)
+external name generator.series;
+create function sys.generate_series(first int, last int, stepsize int)
+returns table (value int)
+external name generator.series;
+create function sys.generate_series(first bigint, last bigint)
+returns table (value bigint)
+external name generator.series;
+create function sys.generate_series(first bigint, last bigint, stepsize bigint)
+returns table (value bigint)
+external name generator.series;
+create function sys.generate_series(first real, last real, stepsize real)
+returns table (value real)
+external name generator.series;
+create function sys.generate_series(first double, last double, stepsize double)
+returns table (value double)
+external name generator.series;
+create function sys.generate_series(first decimal(10,2), last decimal(10,2), 
stepsize decimal(10,2))
+returns table (value decimal(10,2))
+external name generator.series;
+create function sys.generate_series(first timestamp, last timestamp, stepsize 
interval second)
+returns table (value timestamp)
+external name generator.series;
 create function geomcollectionfromtext(wkt string, srid smallint) returns 
multipolygon external name geom."GeomCollectionFro

MonetDB: default - Merged with Oct2014 branch.

2014-08-11 Thread Stefan Manegold
Changeset: bbd8d343a80b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bbd8d343a80b
Modified Files:
clients/Tests/SQL-dump.stable.out.32bit
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (29 lines):

diff --git a/clients/Tests/SQL-dump.stable.out.32bit 
b/clients/Tests/SQL-dump.stable.out.32bit
--- a/clients/Tests/SQL-dump.stable.out.32bit
+++ b/clients/Tests/SQL-dump.stable.out.32bit
@@ -5715,7 +5715,7 @@ CREATE TABLE "sys"."functions" (
"vararg"  BOOLEAN,
"schema_id"   INTEGER
 );
-COPY 1308 RECORDS INTO "sys"."functions" FROM stdin USING DELIMITERS 
'\t','\n','"';
+COPY 1318 RECORDS INTO "sys"."functions" FROM stdin USING DELIMITERS 
'\t','\n','"';
 28 "not_uniques"   "not_uniques"   "sql"   false   1   false   false   
false   0
 29 "not_uniques"   "not_uniques"   "sql"   false   1   false   false   
false   0
 30 "hash"  "hash"  "mkey"  false   1   false   false   false   0
@@ -7024,6 +7024,16 @@ 6487 "reverse"   "-- The contents of this 
 6491   "fuse"  "-- fuse two (1-byte) tinyint values into one (2-byte) smallint 
value\ncreate function fuse(one tinyint, two tinyint)\nreturns smallint 
external name udf.fuse;""udf"   true1   false   false   false   
2000
 6496   "fuse"  "-- fuse two (2-byte) smallint values into one (4-byte) integer 
value\ncreate function fuse(one smallint, two smallint)\nreturns integer 
external name udf.fuse;"   "udf"   true1   false   false   false   
2000
 6501   "fuse"  "-- fuse two (4-byte) integer values into one (8-byte) bigint 
value\ncreate function fuse(one integer, two integer)\nreturns bigint external 
name udf.fuse;""udf"   true1   false   false   false   2000
+6506   "generate_series"   "-- The contents of this file are subject to 
the MonetDB Public License\n-- Version 1.1 (the ""License""); you may not use 
this file except in\n-- compliance with the License. You may obtain a copy of 
the License at\n-- http://www.monetdb.org/Legal/MonetDBLicense\n--\n-- Software 
distributed under the License is distributed on an ""AS IS""\n-- basis, WITHOUT 
WARRANTY OF ANY KIND, either express or implied. See the\n-- License for the 
specific language governing rights and limitations\n-- under the 
License.\n--\n-- The Original Code is the MonetDB Database System.\n--\n-- The 
Initial Developer of the Original Code is CWI.\n-- Portions created by CWI are 
Copyright (C) 1997-July 2008 CWI.\n-- Copyright August 2008-2014 MonetDB 
B.V.\n-- All Rights Reserved.\n\n-- (c) Author M.Kersten\n\ncreate function 
sys.generate_series(first tinyint, last tinyint)\nreturns table (value 
tinyint)\nexternal name generator.series;" "generator" 1   5   
false   false   false   2000
+6511   "generate_series"   "create function sys.generate_series(first 
tinyint, last tinyint, stepsize tinyint)\nreturns table (value 
tinyint)\nexternal name generator.series;""generator" 1   5   
false   false   false   2000
+6517   "generate_series"   "create function sys.generate_series(first int, 
last int)\nreturns table (value int)\nexternal name generator.series;"  
"generator" 1   5   false   false   false   2000
+6522   "generate_series"   "create function sys.generate_series(first int, 
last int, stepsize int)\nreturns table (value int)\nexternal name 
generator.series;""generator" 1   5   false   false   false   
2000
+6528   "generate_series"   "create function sys.generate_series(first 
bigint, last bigint)\nreturns table (value bigint)\nexternal name 
generator.series;" "generator" 1   5   false   false   false   2000
+6533   "generate_series"   "create function sys.generate_series(first 
bigint, last bigint, stepsize bigint)\nreturns table (value bigint)\nexternal 
name generator.series;""generator" 1   5   false   false   
false   2000
+6539   "generate_series"   "create function sys.generate_series(first 
real, last real, stepsize real)\nreturns table (value real)\nexternal name 
generator.series;""generator" 1   5   false   false   false 
  2000
+6545   "generate_series"   "create function sys.generate_series(first 
double, last double, stepsize double)\nreturns table (value double)\nexternal 
name generator.series;""generator" 1   5   false   false   
false   2000
+6551   "generate_series"   "create function sys.generate_series(first 
decimal(10,2), last decimal(10,2), stepsize decimal(10,2))\nreturns table 
(value decimal(10,2))\nexternal name generator.series;""generator" 1
   5   false   false   false   2000
+6557   "generate_series"   "create function sys.generate_series(first 
timestamp, last timestamp, stepsize interval second)\nreturns table (value 
timestamp)\nexternal name generator.series;"  "generator" 1   5 
  false   false   false   2000
 COM

MonetDB: default - Merged with Oct2014 branch.

2014-08-11 Thread Stefan Manegold
Changeset: e2f15802c4fb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2f15802c4fb
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures_gsl.stable.out
clients/Tests/MAL-signatures_nocfitsio.stable.out
clients/Tests/MAL-signatures_sphinxclient.stable.out
clients/Tests/SQL-dump.stable.out.64bit.oid32
Branch: default
Log Message:

Merged with Oct2014 branch.


diffs (29 lines):

diff --git a/clients/Tests/SQL-dump.stable.out.64bit.oid32 
b/clients/Tests/SQL-dump.stable.out.64bit.oid32
--- a/clients/Tests/SQL-dump.stable.out.64bit.oid32
+++ b/clients/Tests/SQL-dump.stable.out.64bit.oid32
@@ -5715,7 +5715,7 @@ CREATE TABLE "sys"."functions" (
"vararg"  BOOLEAN,
"schema_id"   INTEGER
 );
-COPY 1308 RECORDS INTO "sys"."functions" FROM stdin USING DELIMITERS 
'\t','\n','"';
+COPY 1318 RECORDS INTO "sys"."functions" FROM stdin USING DELIMITERS 
'\t','\n','"';
 28 "not_uniques"   "not_uniques"   "sql"   false   1   false   false   
false   0
 29 "not_uniques"   "not_uniques"   "sql"   false   1   false   false   
false   0
 30 "hash"  "hash"  "mkey"  false   1   false   false   false   0
@@ -7024,6 +7024,16 @@ 6487 "reverse"   "-- The contents of this 
 6491   "fuse"  "-- fuse two (1-byte) tinyint values into one (2-byte) smallint 
value\ncreate function fuse(one tinyint, two tinyint)\nreturns smallint 
external name udf.fuse;""udf"   true1   false   false   false   
2000
 6496   "fuse"  "-- fuse two (2-byte) smallint values into one (4-byte) integer 
value\ncreate function fuse(one smallint, two smallint)\nreturns integer 
external name udf.fuse;"   "udf"   true1   false   false   false   
2000
 6501   "fuse"  "-- fuse two (4-byte) integer values into one (8-byte) bigint 
value\ncreate function fuse(one integer, two integer)\nreturns bigint external 
name udf.fuse;""udf"   true1   false   false   false   2000
+6506   "generate_series"   "-- The contents of this file are subject to 
the MonetDB Public License\n-- Version 1.1 (the ""License""); you may not use 
this file except in\n-- compliance with the License. You may obtain a copy of 
the License at\n-- http://www.monetdb.org/Legal/MonetDBLicense\n--\n-- Software 
distributed under the License is distributed on an ""AS IS""\n-- basis, WITHOUT 
WARRANTY OF ANY KIND, either express or implied. See the\n-- License for the 
specific language governing rights and limitations\n-- under the 
License.\n--\n-- The Original Code is the MonetDB Database System.\n--\n-- The 
Initial Developer of the Original Code is CWI.\n-- Portions created by CWI are 
Copyright (C) 1997-July 2008 CWI.\n-- Copyright August 2008-2014 MonetDB 
B.V.\n-- All Rights Reserved.\n\n-- (c) Author M.Kersten\n\ncreate function 
sys.generate_series(first tinyint, last tinyint)\nreturns table (value 
tinyint)\nexternal name generator.series;" "generator" 1   5   
false   false   false   2000
+6511   "generate_series"   "create function sys.generate_series(first 
tinyint, last tinyint, stepsize tinyint)\nreturns table (value 
tinyint)\nexternal name generator.series;""generator" 1   5   
false   false   false   2000
+6517   "generate_series"   "create function sys.generate_series(first int, 
last int)\nreturns table (value int)\nexternal name generator.series;"  
"generator" 1   5   false   false   false   2000
+6522   "generate_series"   "create function sys.generate_series(first int, 
last int, stepsize int)\nreturns table (value int)\nexternal name 
generator.series;""generator" 1   5   false   false   false   
2000
+6528   "generate_series"   "create function sys.generate_series(first 
bigint, last bigint)\nreturns table (value bigint)\nexternal name 
generator.series;" "generator" 1   5   false   false   false   2000
+6533   "generate_series"   "create function sys.generate_series(first 
bigint, last bigint, stepsize bigint)\nreturns table (value bigint)\nexternal 
name generator.series;""generator" 1   5   false   false   
false   2000
+6539   "generate_series"   "create function sys.generate_series(first 
real, last real, stepsize real)\nreturns table (value real)\nexternal name 
generator.series;""generator" 1   5   false   false   false 
  2000
+6545   "generate_series"   "create function sys.generate_series(first 
double, last double, stepsize double)\nreturns table (value double)\nexternal 
name generator.series;""generator" 1   5   false   false   
false   2000
+6551   "generate_series"   "create function sys.generate_series(first 
decimal(10,2), last decimal(10,2), stepsize decimal(10,2))\nreturns table 
(value decimal(10,2))\nexternal name generator.series;""generator" 1
   5   false   false   false   2000
+6557   "generate_s