python-monetdb: default - Fix calling the Connection.connect met...

2016-04-20 Thread Sjoerd Mullender
Changeset: c97916f7564d for python-monetdb
URL: http://dev.monetdb.org/hg/python-monetdb?cmd=changeset;node=c97916f7564d
Modified Files:
pymonetdb/mapi.py
Branch: default
Log Message:

Fix calling the Connection.connect method.

This is a port of changeset 6674c4ec995f of the MonetDB code.


diffs (25 lines):

diff --git a/pymonetdb/mapi.py b/pymonetdb/mapi.py
--- a/pymonetdb/mapi.py
+++ b/pymonetdb/mapi.py
@@ -45,7 +45,8 @@ STATE_READY = 1
 
 # MonetDB error codes
 errors = {
-'42S02!': OperationalError,  # no such table
+'0A000!': NotSupportedError,
+'42S02!': ProgrammingError,  # no such table
 'M0M29!': IntegrityError,# INSERT INTO: UNIQUE constraint violated
 '2D000!': IntegrityError,# COMMIT: failed
 '4!': IntegrityError,# DROP TABLE: FOREIGN KEY constraint violated
@@ -183,8 +184,9 @@ class Connection(object):
 logger.info("redirect to monetdb://%s:%s/%s" %
 (self.hostname, self.port, self.database))
 self.socket.close()
-self.connect(self.hostname, self.port, self.username,
- self.password, self.database, self.language)
+self.connect(hostname=self.hostname, port=self.port,
+ username=self.username, password=self.password,
+ database=self.database, language=self.language)
 
 else:
 raise ProgrammingError("unknown redirect: %s" % prompt)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2015 - Fix setting time zone for negative offsets.

2016-04-20 Thread Sjoerd Mullender
Changeset: 5247c923260e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5247c923260e
Modified Files:
clients/ruby/lib/MonetDBConnection.rb
Branch: Jul2015
Log Message:

Fix setting time zone for negative offsets.
This fixes bug 3985.


diffs (20 lines):

diff --git a/clients/ruby/lib/MonetDBConnection.rb 
b/clients/ruby/lib/MonetDBConnection.rb
--- a/clients/ruby/lib/MonetDBConnection.rb
+++ b/clients/ruby/lib/MonetDBConnection.rb
@@ -398,8 +398,14 @@ class MonetDBConnection
   def set_timezone()
 tz = Time.new
 tz_offset = tz.gmt_offset / @@HOUR
-  
-if tz_offset <= 9 # verify minute count!
+
+# verify minute count!
+if tz_offset <= -10
+  tz_offset = "'" + tz_offset.to_s + ":00'"
+elsif tz_offset < 0
+  tz_offset = -tz_offset
+  tz_offset = "'-0" + tz_offset.to_s + ":00'"
+if tz_offset <= 9
   tz_offset = "'+0" + tz_offset.to_s + ":00'"
 else
   tz_offset = "'+" + tz_offset.to_s + ":00'"
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - Merge with Jul2015 branch.

2016-04-20 Thread Sjoerd Mullender
Changeset: 2cf535c58c27 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2cf535c58c27
Modified Files:
MacOSX/post-install.sh
Branch: Jun2016
Log Message:

Merge with Jul2015 branch.


diffs (21 lines):

diff --git a/MacOSX/post-install.sh b/MacOSX/post-install.sh
--- a/MacOSX/post-install.sh
+++ b/MacOSX/post-install.sh
@@ -2,6 +2,14 @@
 
 monetdb_path=/usr/local/monetdb/bin
 
-if [[ ":$PATH:" != *":$monetdb_path:"* ]]; then
-printf '\n# Set MonetDB path\nexport PATH=$PATH:'$monetdb_path'\n' >> 
~/.profile
-fi
+case $PATH in
+*:$monetdb_path|*:$monetdb_path:*|$monetdb_path:*)
+;;
+*)
+cat >> ~/.profile 

MonetDB: Jul2015 - Fix previous changeset: need to get the elsif...

2016-04-20 Thread Sjoerd Mullender
Changeset: 084abef09d5d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=084abef09d5d
Modified Files:
clients/ruby/lib/MonetDBConnection.rb
Branch: Jul2015
Log Message:

Fix previous changeset: need to get the elsif chain correct.


diffs (12 lines):

diff --git a/clients/ruby/lib/MonetDBConnection.rb 
b/clients/ruby/lib/MonetDBConnection.rb
--- a/clients/ruby/lib/MonetDBConnection.rb
+++ b/clients/ruby/lib/MonetDBConnection.rb
@@ -405,7 +405,7 @@ class MonetDBConnection
 elsif tz_offset < 0
   tz_offset = -tz_offset
   tz_offset = "'-0" + tz_offset.to_s + ":00'"
-if tz_offset <= 9
+elsif tz_offset <= 9
   tz_offset = "'+0" + tz_offset.to_s + ":00'"
 else
   tz_offset = "'+" + tz_offset.to_s + ":00'"
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-ruby: default - Fix setting time zone for negative offsets.

2016-04-20 Thread Sjoerd Mullender
Changeset: b4cf00b05ef1 for monetdb-ruby
URL: http://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=b4cf00b05ef1
Modified Files:
lib/MonetDBConnection.rb
Branch: default
Log Message:

Fix setting time zone for negative offsets.

Port of changesets 5247c923260e and 084abef09d5d from MonetDB.
This fixes bug 3985.


diffs (20 lines):

diff --git a/lib/MonetDBConnection.rb b/lib/MonetDBConnection.rb
--- a/lib/MonetDBConnection.rb
+++ b/lib/MonetDBConnection.rb
@@ -398,8 +398,14 @@ class MonetDBConnection
   def set_timezone()
 tz = Time.new
 tz_offset = tz.gmt_offset / @@HOUR
-  
-if tz_offset <= 9 # verify minute count!
+
+# verify minute count!
+if tz_offset <= -10
+  tz_offset = "'" + tz_offset.to_s + ":00'"
+elsif tz_offset < 0
+  tz_offset = -tz_offset
+  tz_offset = "'-0" + tz_offset.to_s + ":00'"
+elsif tz_offset <= 9
   tz_offset = "'+0" + tz_offset.to_s + ":00'"
 else
   tz_offset = "'+" + tz_offset.to_s + ":00'"
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - merged with jul2015

2016-04-20 Thread Niels Nes
Changeset: d11e77362ab9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d11e77362ab9
Modified Files:
monetdb5/modules/atoms/mtime.c
sql/storage/bat/bat_storage.c
Branch: Jun2016
Log Message:

merged with jul2015


diffs (73 lines):

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
@@ -1739,16 +1739,18 @@ gtr_update_table(sql_trans *tr, sql_tabl
int ok = LOG_OK;
node *n;
 
+   if (t->base.wtime <= t->base.allocated)
+   return ok;
gtr_update_dbat(t->data, tchanges);
for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
int changes = 0;
sql_column *c = n->data;
 
-   if (!c->base.wtime) 
+   if (!c->base.wtime || c->base.wtime <= c->base.allocated) 
continue;
ok = gtr_update_delta(tr, c->data, );
if (changes)
-   c->base.wtime = tr->wstime;
+   c->base.allocated = c->base.wtime = tr->wstime;
(*tchanges) |= changes;
}
if (ok == LOG_OK && t->idxs.set) {
@@ -1757,17 +1759,17 @@ gtr_update_table(sql_trans *tr, sql_tabl
sql_idx *ci = n->data;
 
/* some indices have no bats */
-   if (!ci->base.wtime)
+   if (!ci->base.wtime || ci->base.wtime <= 
ci->base.allocated) 
continue;
 
ok = gtr_update_delta(tr, ci->data, );
if (changes)
-   ci->base.wtime = tr->wstime;
+   ci->base.allocated = ci->base.wtime = 
tr->wstime;
(*tchanges) |= changes;
}
}
if (*tchanges)
-   t->base.wtime = tr->wstime;
+   t->base.allocated = t->base.wtime = tr->wstime;
return ok;
 }
 
@@ -1783,6 +1785,11 @@ static int
int schanges = 0;
sql_schema *s = sn->data;

+   if (s->base.wtime <= s->base.allocated && 
+   gtr_update_table_f == gtr_update_table)
+   continue;
+   if (!s->base.wtime)
+   continue;
if (!isTempSchema(s) && s->tables.set) {
node *n;
for (n = s->tables.set->h; n && ok == LOG_OK; n = 
n->next) {
@@ -1794,12 +1801,12 @@ static int
schanges |= changes;
}
}
-   if (schanges){
-   s->base.wtime = tr->wstime;
+   if (schanges && gtr_update_table_f == gtr_update_table){
+   s->base.allocated = s->base.wtime = tr->wstime;
tchanges ++;
}
}
-   if (tchanges)
+   if (tchanges && gtr_update_table_f == gtr_update_table)
tr->wtime = tr->wstime;
return LOG_OK;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: data-vaults - Add the gadget optimizer

2016-04-20 Thread Panagiotis Koutsourakis
Changeset: d3635f1531d7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d3635f1531d7
Added Files:
monetdb5/optimizer/opt_gadget.c
monetdb5/optimizer/opt_gadget.h
Modified Files:
monetdb5/optimizer/Makefile.ag
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/opt_support.c
monetdb5/optimizer/opt_support.h
monetdb5/optimizer/opt_wrapper.c
monetdb5/optimizer/optimizer.mal
Branch: data-vaults
Log Message:

Add the gadget optimizer


diffs (truncated from 348 to 300 lines):

diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -28,6 +28,7 @@ lib_optimizer = {
opt_deadcode.c opt_deadcode.h \
opt_evaluate.c opt_evaluate.h \
opt_factorize.c opt_factorize.h \
+   opt_gadget.c opt_gadget.h \
opt_garbageCollector.c opt_garbageCollector.h \
opt_generator.c opt_generator.h \
opt_querylog.c opt_querylog.h \
diff --git a/monetdb5/optimizer/opt_gadget.c b/monetdb5/optimizer/opt_gadget.c
new file mode 100644
--- /dev/null
+++ b/monetdb5/optimizer/opt_gadget.c
@@ -0,0 +1,169 @@
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
+ */
+
+#include "monetdb_config.h"
+#include "opt_gadget.h"
+#include "mal_interpreter.h"   /* for showErrors() */
+#include "mal_builder.h"
+/*
+ * The instruction sent is produced with a variation of call2str
+ * from the debugger.
+ */
+
+#define DEFAULT_NUM_TABLES 512
+
+typedef enum {
+NOT_LOADED,
+SUBMITTED,
+LOADED
+} STATUS;
+
+typedef struct TABLE_ {
+str sname;
+str tname;
+int arg0;
+} TABLE;
+
+static str
+checkTable(int *res, int *action, MalBlkPtr mb, InstrPtr p, TABLE **tabs, int 
num_tabs, str sname, str tname) {
+int i = 0, j = 0;
+InstrPtr c, a, r;
+int upd = (getFunctionId(p)==bindRef) && (p->argc == 7 || p->argc == 9);
+(void) *action;
+
+if ( num_tabs && ((num_tabs % DEFAULT_NUM_TABLES) == 0)) {
+   *tabs = (TABLE*) GDKrealloc(tabs, sizeof(TABLE) * (num_tabs*2));
+if (!tabs) {
+throw(MAL, "optimizer.gadget", "Realloc failed");
+}
+}
+for(i = 0; i < num_tabs; i++) {
+if ( tabs[i]->sname && (strcmp(tabs[i]->sname, sname) == 0) && 
(strcmp(tabs[i]->tname, tname) == 0)) { 
+r = newInstruction(mb,ASSIGNsymbol);
+setModuleId(r, gadgetRef);
+setFunctionId(r, getFunctionId(p));
+getArg(r,0) = getArg(p,0);
+for (j = 1; j < p->retc; j++) {
+r = pushArgument(mb, r, getArg(p,j));
+}
+r= pushArgument(mb, r, tabs[i]->arg0);
+for (j = p->retc; j < p->argc; j++) {
+r = pushArgument(mb, r, getArg(p,j));
+}
+r->retc = p->retc;
+pushInstruction(mb,r);
+*res = num_tabs;
+*action = *action+1;
+return MAL_SUCCEED;
+}
+}
+
+c = newInstruction(mb,ASSIGNsymbol);
+setModuleId(c, gadgetRef);
+setFunctionId(c, checktableRef);
+getArg(c,0) = newTmpVariable(mb, TYPE_int);
+c = pushArgument(mb, c, getArg(p,1+upd));
+c = pushArgument(mb, c, getArg(p,3+upd));
+c->retc = 1;
+pushInstruction(mb,c);
+
+a = newInstruction(mb,ASSIGNsymbol);
+setModuleId(a, gadgetRef);
+setFunctionId(a, analyzetableRef);
+getArg(a,0) = newTmpVariable(mb, TYPE_int);
+a = pushArgument(mb, a, getArg(p,1+upd));
+a = pushArgument(mb, a, getArg(c,0));
+a = pushArgument(mb, a, getArg(p,3+upd));
+a->retc = 1;
+pushInstruction(mb,a);
+
+r = newInstruction(mb,ASSIGNsymbol);
+setModuleId(r, gadgetRef);
+setFunctionId(r, getFunctionId(p));
+getArg(r,0) = getArg(p,0);
+for (j = 1; j < p->retc; j++) {
+r = pushArgument(mb, r, getArg(p,j));
+}
+r= pushArgument(mb, r, getArg(a,0));
+for (j = p->retc; j < p->argc; j++) {
+r = pushArgument(mb, r, getArg(p,j));
+}
+//r->retc = p->retc;
+printf("R argc %d p argx %d \n", r->argc, p->argc);
+pushInstruction(mb,r);
+
+/*Add info about the table*/
+if (!tabs[num_tabs])
+tabs[num_tabs] = (TABLE*) GDKmalloc(sizeof(TABLE));
+tabs[num_tabs]->sname = GDKstrdup(sname);
+tabs[num_tabs]->tname = GDKstrdup(tname);
+tabs[num_tabs]->arg0 = getArg(a,0);
+
+*res = ++num_tabs;
+*action = *action+2;
+
+return MAL_SUCCEED;
+}
+
+int
+OPTgadgetImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci)
+{
+InstrPtr p, *old;
+int i, 

MonetDB: Jun2016 - merged with jul2015

2016-04-20 Thread Niels Nes
Changeset: 59d2534c9ce4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=59d2534c9ce4
Modified Files:
clients/python2/monetdb/mapi.py
clients/python3/monetdb/mapi.py
Branch: Jun2016
Log Message:

merged with jul2015


diffs (30 lines):

diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
--- a/clients/python2/monetdb/mapi.py
+++ b/clients/python2/monetdb/mapi.py
@@ -142,8 +142,9 @@ class Connection(object):
 logger.info("redirect to monetdb://%s:%s/%s" %
 (self.hostname, self.port, self.database))
 self.socket.close()
-self.connect(self.hostname, self.port, self.username,
- self.password, self.database, self.language)
+self.connect(hostname=self.hostname, port=self.port,
+ username=self.username, password=self.password,
+ database=self.database, language=self.language)
 
 else:
 raise ProgrammingError("unknown redirect: %s" % prompt)
diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py
--- a/clients/python3/monetdb/mapi.py
+++ b/clients/python3/monetdb/mapi.py
@@ -143,8 +143,9 @@ class Connection(object):
 logger.info("redirect to monetdb://%s:%s/%s" %
 (self.hostname, self.port, self.database))
 self.socket.close()
-self.connect(self.hostname, self.port, self.username,
- self.password, self.database, self.language)
+self.connect(hostname=self.hostname, port=self.port,
+ username=self.username, password=self.password,
+ database=self.database, language=self.language)
 
 else:
 raise ProgrammingError("unknown redirect: %s" % prompt)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: data-vaults - Add GADGET data vault code

2016-04-20 Thread Panagiotis Koutsourakis
Changeset: 70a801d2ab02 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=70a801d2ab02
Added Files:
sql/backends/monet5/vaults/gadget/82_gadget.mal
sql/backends/monet5/vaults/gadget/82_gadget.sql
sql/backends/monet5/vaults/gadget/Makefile.ag
sql/backends/monet5/vaults/gadget/gadget.c
sql/backends/monet5/vaults/gadget/gadget.h
sql/backends/monet5/vaults/gadget/gadget.mal
sql/backends/monet5/vaults/gadget/gadgetFile.c
sql/backends/monet5/vaults/gadget/gadgetFile.h
sql/backends/monet5/vaults/gadget/peano.c
sql/backends/monet5/vaults/gadget/peano.h
Branch: data-vaults
Log Message:

Add GADGET data vault code


diffs (truncated from 3569 to 300 lines):

diff --git a/sql/backends/monet5/vaults/gadget/82_gadget.mal 
b/sql/backends/monet5/vaults/gadget/82_gadget.mal
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/vaults/gadget/82_gadget.mal
@@ -0,0 +1,20 @@
+# 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-2015 MonetDB B.V.
+# All Rights Reserved.
+
+# This loads the MonetDB/SQL module
+library gadget;
+include gadget;
diff --git a/sql/backends/monet5/vaults/gadget/82_gadget.sql 
b/sql/backends/monet5/vaults/gadget/82_gadget.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/vaults/gadget/82_gadget.sql
@@ -0,0 +1,11 @@
+create procedure gadgetAttach(fname string) external name gadget.attach;
+create procedure gadgetLoad(tname string) external name gadget.load;
+create procedure gadgetLoadAll(tname string) external name gadget.loadall;
+create procedure gadgetListDir(dname string) external name gadget.listdir;
+create procedure gadgetListDirPat(dname string, pattern string) external name 
gadget.listdirpattern;
+create procedure gadgetListDirAll(dname string) external name 
gadget.listdirall;
+create procedure gadgetAttachAll(*) external name gadget.attachall;
+create procedure gadgetCheckTable(tname string) external name 
gadget.checktable;
+create function gadgetPHkeyConvert(x real, y real, z real, baseSize real, 
nbits int) returns bigint external name gadget.phkeyconvert;
+create function gadgetPHkeyInvert(phkey bigint, baseSize real, nbits int) 
returns table (x real, y real, z real, cSize real) external name 
gadget.phkeyinvert;
+
diff --git a/sql/backends/monet5/vaults/gadget/Makefile.ag 
b/sql/backends/monet5/vaults/gadget/Makefile.ag
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/vaults/gadget/Makefile.ag
@@ -0,0 +1,51 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
+
+INCLUDES = ../ \
+   ../../ \
+   ../../../../include \
+  ../../../../common \
+  ../../../../storage \
+  ../../../../server \
+  ../../../../../monetdb5/modules/atoms \
+  ../../../../../monetdb5/modules/kernel \
+  ../../../../../monetdb5/mal \
+  ../../../../../monetdb5/modules/mal \
+  ../../../../../monetdb5/optimizer \
+  ../../../../../monetdb5/scheduler \
+  ../../../../../clients/mapilib \
+  ../../../../../common/options \
+  ../../../../../common/stream \
+  ../../../../../common/utils \
+  ../../../../../gdk \
+  $(READLINE_INCS)
+
+lib__gadget = {
+   MODULE
+   DIR = libdir/monetdb5
+   SOURCES = gadgetFile.c peano.c gadget.c
+   LIBS = ../../../../../monetdb5/tools/libmonetdb5
+}
+
+headers_gadgetmal = {
+   HEADERS = mal
+   DIR = libdir/monetdb5
+   SOURCES = gadget.mal
+}
+
+headers_gadgetsql = {
+   HEADERS = sql
+   DIR = libdir/monetdb5/createdb
+   SOURCES = 82_gadget.sql
+}
+
+headers_gadgetautoload = {
+   HEADERS = mal
+   DIR = libdir/monetdb5/autoload
+   SOURCES = 82_gadget.mal
+}
+
+EXTRA_DIST = 82_gadget.mal  gadget.mal  82_gadget.sql gadgetFile.h peano.h 
gadget.h
diff --git a/sql/backends/monet5/vaults/gadget/gadget.c 
b/sql/backends/monet5/vaults/gadget/gadget.c
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/vaults/gadget/gadget.c
@@ -0,0 +1,2337 @@
+/*
+ * This Source Code Form is subject to the terms of the 

MonetDB: data-vaults - Add the necessary configuration settings ...

2016-04-20 Thread Panagiotis Koutsourakis
Changeset: 940ae4e407f4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=940ae4e407f4
Modified Files:
configure.ag
sql/backends/monet5/vaults/Makefile.ag
sql/backends/monet5/vaults/gadget/gadgetFile.c
Branch: data-vaults
Log Message:

Add the necessary configuration settings for gadget vault


diffs (76 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -170,6 +170,13 @@ AC_ARG_ENABLE(lidar,
have_lidar=$enableval,
have_lidar=$dft_lidar)
 
+dft_gadget=auto
+AC_ARG_ENABLE(gadget,
+  AS_HELP_STRING([--enable-gadget],
+[enable support for GADGET data (default=auto)]),
+  have_gadget=$enableval,
+  have_gadget=$dft_gadget)
+
 dft_sql=yes
 AC_ARG_ENABLE(sql,
AS_HELP_STRING([--enable-sql],
@@ -2688,6 +2695,14 @@ AM_CONDITIONAL(HAVE_LIDAR, test "x$have_
 
 AC_MSG_CHECKING(['enable lidar: $have_lidar'])
 
+# GADGET
+
+AC_MSG_CHECKING(['enable GADGET: $have_gadget'])
+
+AM_CONDITIONAL(HAVE_GADGET, test "x$have_gadget" = xyes -o "x$have_gadget" = 
xauto)
+
+AC_MSG_CHECKING(['enable GADGET: $have_gadget'])
+
 # gdal
 org_have_gdal="auto"
 have_gdal=$org_have_gdal
@@ -3593,6 +3608,7 @@ for comp in \
'bz2  ' \
'curl ' \
'fits ' \
+   'gadget   ' \
'getaddrinfo  ' \
'gdal ' \
'gsl  ' \
diff --git a/sql/backends/monet5/vaults/Makefile.ag 
b/sql/backends/monet5/vaults/Makefile.ag
--- a/sql/backends/monet5/vaults/Makefile.ag
+++ b/sql/backends/monet5/vaults/Makefile.ag
@@ -4,7 +4,7 @@
 #
 # Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
 
-SUBDIRS = HAVE_SAMTOOLS?bam HAVE_FITS?fits HAVE_LIDAR?lidar HAVE_NETCDF?netcdf 
HAVE_SHP?shp
+SUBDIRS = HAVE_SAMTOOLS?bam HAVE_FITS?fits HAVE_LIDAR?lidar HAVE_NETCDF?netcdf 
HAVE_SHP?shp HAVE_GADGET?gadget
 
 INCLUDES = ../../../include \
   ../../../common \
diff --git a/sql/backends/monet5/vaults/gadget/gadgetFile.c 
b/sql/backends/monet5/vaults/gadget/gadgetFile.c
--- a/sql/backends/monet5/vaults/gadget/gadgetFile.c
+++ b/sql/backends/monet5/vaults/gadget/gadgetFile.c
@@ -281,13 +281,17 @@ headerInit_(Header* h, char* bytes)
 h->headerOk = 1;
 }
 
+
+// The compiler complains if headerlength is defined as a variable
+#define HEADERLENGTH 264
+
 void
 headerInit(Header *h, FILE *blob)
 {
 long index = 0;
-int npart, headerlength = 264;
-char headerbytes[headerlength];
-long retval = fread(headerbytes, headerlength, 1, blob);
+int npart;
+char headerbytes[HEADERLENGTH];
+long retval = fread(headerbytes, HEADERLENGTH, 1, blob);
 int binbytes[2];
 (void) retval;
 assert(retval);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: iot - Added rst files for documentation of iot client a...

2016-04-20 Thread Pedro Ferreira
Changeset: cdc459ebce61 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cdc459ebce61
Added Files:
clients/iotclient/documentation/conf.py
clients/iotclient/documentation/future_work.rst
clients/iotclient/documentation/index.rst
clients/iotclient/documentation/introduction.rst
clients/iotclient/documentation/iot_server_arguments.rst
clients/iotclient/documentation/restful_resources.rst
clients/iotclient/documentation/streams_creation.rst
clients/iotclient/documentation/streams_data_types.rst
Modified Files:
clients/iotclient/requirements.txt
clients/iotclient/src/Flask/restresources.py
clients/iotclient/src/Settings/filesystem.py
clients/iotclient/src/Settings/iotlogger.py
clients/iotclient/src/Settings/mapiconnection.py
clients/iotclient/src/Streams/streams.py
clients/iotclient/src/Streams/streamscontext.py
clients/iotclient/src/Utilities/filecreator.py
clients/iotclient/src/main.py
Branch: iot
Log Message:

Added rst files for documentation of iot client and logging of errors


diffs (truncated from 918 to 300 lines):

diff --git a/clients/iotclient/documentation/conf.py 
b/clients/iotclient/documentation/conf.py
new file mode 100644
--- /dev/null
+++ b/clients/iotclient/documentation/conf.py
@@ -0,0 +1,370 @@
+# -*- coding: utf-8 -*-
+#
+# MonetDB IOT WebServer documentation build configuration file, created by
+# sphinx-quickstart on Wed Apr 20 09:44:47 2016.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration 
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+'sphinx.ext.autodoc',
+'sphinx.ext.doctest',
+'sphinx.ext.intersphinx',
+'sphinx.ext.todo',
+'sphinx.ext.coverage',
+'sphinx.ext.mathjax',
+'sphinx.ext.ifconfig',
+'sphinx.ext.viewcode',
+'sphinx.ext.githubpages',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'MonetDB IOT WebServer'
+copyright = u'2016, MonetDB Solutions'
+author = u'Pedro Ferreira'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u''
+# The full version, including alpha/beta/rc tags.
+release = u'1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as 

MonetDB: Jul2015 - only flush dirty tables to disk

2016-04-20 Thread Niels Nes
Changeset: ea03f4b79bed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea03f4b79bed
Modified Files:
monetdb5/modules/atoms/mtime.c
sql/storage/bat/bat_storage.c
Branch: Jul2015
Log Message:

only flush dirty tables to disk


diffs (85 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
@@ -2657,7 +2657,7 @@ MTIMEtimestamp(timestamp *ret, const int
lng l;
str e;
 
-   if (*sec == lng_nil) {
+   if (*sec == int_nil) {
*ret = *timestamp_nil;
return MAL_SUCCEED;
}
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
@@ -1735,16 +1735,18 @@ gtr_update_table(sql_trans *tr, sql_tabl
int ok = LOG_OK;
node *n;
 
+   if (t->base.wtime <= t->base.allocated)
+   return ok;
gtr_update_dbat(t->data, tchanges);
for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
int changes = 0;
sql_column *c = n->data;
 
-   if (!c->base.wtime) 
+   if (!c->base.wtime || c->base.wtime <= c->base.allocated) 
continue;
ok = gtr_update_delta(tr, c->data, );
if (changes)
-   c->base.wtime = tr->wstime;
+   c->base.allocated = c->base.wtime = tr->wstime;
(*tchanges) |= changes;
}
if (ok == LOG_OK && t->idxs.set) {
@@ -1753,17 +1755,17 @@ gtr_update_table(sql_trans *tr, sql_tabl
sql_idx *ci = n->data;
 
/* some indices have no bats */
-   if (!ci->base.wtime)
+   if (!ci->base.wtime || ci->base.wtime <= 
ci->base.allocated) 
continue;
 
ok = gtr_update_delta(tr, ci->data, );
if (changes)
-   ci->base.wtime = tr->wstime;
+   ci->base.allocated = ci->base.wtime = 
tr->wstime;
(*tchanges) |= changes;
}
}
if (*tchanges)
-   t->base.wtime = tr->wstime;
+   t->base.allocated = t->base.wtime = tr->wstime;
return ok;
 }
 
@@ -1779,6 +1781,11 @@ static int
int schanges = 0;
sql_schema *s = sn->data;

+   if (s->base.wtime <= s->base.allocated && 
+   gtr_update_table_f == gtr_update_table)
+   continue;
+   if (!s->base.wtime)
+   continue;
if (!isTempSchema(s) && s->tables.set) {
node *n;
for (n = s->tables.set->h; n && ok == LOG_OK; n = 
n->next) {
@@ -1790,12 +1797,12 @@ static int
schanges |= changes;
}
}
-   if (schanges){
-   s->base.wtime = tr->wstime;
+   if (schanges && gtr_update_table_f == gtr_update_table){
+   s->base.allocated = s->base.wtime = tr->wstime;
tchanges ++;
}
}
-   if (tchanges)
+   if (tchanges && gtr_update_table_f == gtr_update_table)
tr->wtime = tr->wstime;
return LOG_OK;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2015 - merged

2016-04-20 Thread Niels Nes
Changeset: c6164da1961d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c6164da1961d
Modified Files:
clients/python2/monetdb/mapi.py
clients/python3/monetdb/mapi.py
clients/ruby/lib/MonetDBConnection.rb
Branch: Jul2015
Log Message:

merged


diffs (50 lines):

diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
--- a/clients/python2/monetdb/mapi.py
+++ b/clients/python2/monetdb/mapi.py
@@ -142,8 +142,9 @@ class Connection(object):
 logger.info("redirect to monetdb://%s:%s/%s" %
 (self.hostname, self.port, self.database))
 self.socket.close()
-self.connect(self.hostname, self.port, self.username,
- self.password, self.database, self.language)
+self.connect(hostname=self.hostname, port=self.port,
+ username=self.username, password=self.password,
+ database=self.database, language=self.language)
 
 else:
 raise ProgrammingError("unknown redirect: %s" % prompt)
diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py
--- a/clients/python3/monetdb/mapi.py
+++ b/clients/python3/monetdb/mapi.py
@@ -143,8 +143,9 @@ class Connection(object):
 logger.info("redirect to monetdb://%s:%s/%s" %
 (self.hostname, self.port, self.database))
 self.socket.close()
-self.connect(self.hostname, self.port, self.username,
- self.password, self.database, self.language)
+self.connect(hostname=self.hostname, port=self.port,
+ username=self.username, password=self.password,
+ database=self.database, language=self.language)
 
 else:
 raise ProgrammingError("unknown redirect: %s" % prompt)
diff --git a/clients/ruby/lib/MonetDBConnection.rb 
b/clients/ruby/lib/MonetDBConnection.rb
--- a/clients/ruby/lib/MonetDBConnection.rb
+++ b/clients/ruby/lib/MonetDBConnection.rb
@@ -398,8 +398,14 @@ class MonetDBConnection
   def set_timezone()
 tz = Time.new
 tz_offset = tz.gmt_offset / @@HOUR
-  
-if tz_offset <= 9 # verify minute count!
+
+# verify minute count!
+if tz_offset <= -10
+  tz_offset = "'" + tz_offset.to_s + ":00'"
+elsif tz_offset < 0
+  tz_offset = -tz_offset
+  tz_offset = "'-0" + tz_offset.to_s + ":00'"
+elsif tz_offset <= 9
   tz_offset = "'+0" + tz_offset.to_s + ":00'"
 else
   tz_offset = "'+" + tz_offset.to_s + ":00'"
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: data-vaults - Merge with default

2016-04-20 Thread Panagiotis Koutsourakis
Changeset: fdb76306633a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fdb76306633a
Added Files:
buildtools/ChangeLog.Jun2016
clients/ChangeLog.Jun2016
clients/R/MonetDB.R/man/MonetDBLite.Rd
clients/R/MonetDB.R/man/sqlitecompat.Rd
clients/Tests/SQL-dump.SQL.py
clients/mapilib/ChangeLog.Jun2016
clients/python2/ChangeLog.Jun2016
clients/python3/ChangeLog.Jun2016
common/stream/ChangeLog.Jun2016
debian/libmonetdb5-server-lidar.install
gdk/ChangeLog.Jun2016
gdk/gdk_orderidx.c
geom/ChangeLog.Jun2016
geom/documentation/functions.pdf
geom/documentation/functions.tex
geom/monetdb5/geom.h
geom/monetdb5/geomBulk.c
geom/monetdb5/geom_upgrade.c
geom/sql/Tests/area.sql
geom/sql/Tests/asBinary.sql
geom/sql/Tests/asBinary.stable.err
geom/sql/Tests/asBinary.stable.out
geom/sql/Tests/centroid.sql
geom/sql/Tests/distance.sql
geom/sql/Tests/intersection.sql
geom/sql/Tests/length.sql
geom/sql/Tests/makeLine.sql
geom/sql/Tests/makeLine.stable.err
geom/sql/Tests/makeLine.stable.out
geom/sql/Tests/mbr.sql
geom/sql/Tests/mbr.stable.err
geom/sql/Tests/mbr.stable.out
geom/sql/Tests/mbr_left.sql
geom/sql/Tests/mbr_left.stable.err
geom/sql/Tests/mbr_left.stable.out
geom/sql/Tests/mbr_right.sql
geom/sql/Tests/mbr_right.stable.err
geom/sql/Tests/mbr_right.stable.out
geom/sql/Tests/pointOnSurface.sql
geom/sql/Tests/pointOnSurface.stable.err
geom/sql/Tests/pointOnSurface.stable.out
geom/sql/Tests/union.sql
geom/sql/Tests/union.stable.err
geom/sql/Tests/union.stable.out
geom/sql/conformance/Tests/All
geom/sql/conformance/Tests/T1.modules
geom/sql/conformance/Tests/T1.reqtests
geom/sql/conformance/Tests/T1.sql
geom/sql/conformance/Tests/T1.stable.err
geom/sql/conformance/Tests/T1.stable.out
geom/sql/conformance/Tests/T10.modules
geom/sql/conformance/Tests/T10.reqtests
geom/sql/conformance/Tests/T10.sql
geom/sql/conformance/Tests/T10.stable.err
geom/sql/conformance/Tests/T10.stable.out
geom/sql/conformance/Tests/T11.modules
geom/sql/conformance/Tests/T11.reqtests
geom/sql/conformance/Tests/T11.sql
geom/sql/conformance/Tests/T11.stable.err
geom/sql/conformance/Tests/T11.stable.out
geom/sql/conformance/Tests/T12.modules
geom/sql/conformance/Tests/T12.reqtests
geom/sql/conformance/Tests/T12.sql
geom/sql/conformance/Tests/T12.stable.err
geom/sql/conformance/Tests/T12.stable.out
geom/sql/conformance/Tests/T13.modules
geom/sql/conformance/Tests/T13.reqtests
geom/sql/conformance/Tests/T13.sql
geom/sql/conformance/Tests/T13.stable.err
geom/sql/conformance/Tests/T13.stable.out
geom/sql/conformance/Tests/T14.modules
geom/sql/conformance/Tests/T14.reqtests
geom/sql/conformance/Tests/T14.sql
geom/sql/conformance/Tests/T14.stable.err
geom/sql/conformance/Tests/T14.stable.out
geom/sql/conformance/Tests/T15.modules
geom/sql/conformance/Tests/T15.reqtests
geom/sql/conformance/Tests/T15.sql
geom/sql/conformance/Tests/T15.stable.err
geom/sql/conformance/Tests/T15.stable.out
geom/sql/conformance/Tests/T16.modules
geom/sql/conformance/Tests/T16.reqtests
geom/sql/conformance/Tests/T16.sql
geom/sql/conformance/Tests/T16.stable.err
geom/sql/conformance/Tests/T16.stable.out
geom/sql/conformance/Tests/T17.modules
geom/sql/conformance/Tests/T17.reqtests
geom/sql/conformance/Tests/T17.sql
geom/sql/conformance/Tests/T17.stable.err
geom/sql/conformance/Tests/T17.stable.out
geom/sql/conformance/Tests/T18.modules
geom/sql/conformance/Tests/T18.reqtests
geom/sql/conformance/Tests/T18.sql
geom/sql/conformance/Tests/T18.stable.err
geom/sql/conformance/Tests/T18.stable.out
geom/sql/conformance/Tests/T19.modules
geom/sql/conformance/Tests/T19.reqtests
geom/sql/conformance/Tests/T19.sql
geom/sql/conformance/Tests/T2.modules
geom/sql/conformance/Tests/T2.reqtests
geom/sql/conformance/Tests/T2.sql
geom/sql/conformance/Tests/T2.stable.err
geom/sql/conformance/Tests/T2.stable.out
geom/sql/conformance/Tests/T20.modules
geom/sql/conformance/Tests/T20.reqtests
geom/sql/conformance/Tests/T20.sql
geom/sql/conformance/Tests/T21.modules
geom/sql/conformance/Tests/T21.reqtests
geom/sql/conformance/Tests/T21.sql
geom/sql/conformance/Tests/T21.stable.err
geom/sql/conformance/Tests/T21.stable.out
  

MonetDB: iot - Merged with Martin code

2016-04-20 Thread Pedro Ferreira
Changeset: cac2e7880416 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cac2e7880416
Modified Files:
clients/iotclient/documentation/conf.py
sql/backends/monet5/iot/Tests/iot05.sql
sql/backends/monet5/iot/Tests/iot10.sql
sql/backends/monet5/iot/petrinet.c
sql/backends/monet5/iot/petrinet.h
Branch: iot
Log Message:

Merged with Martin code


diffs (204 lines):

diff --git a/clients/iotclient/documentation/conf.py 
b/clients/iotclient/documentation/conf.py
--- a/clients/iotclient/documentation/conf.py
+++ b/clients/iotclient/documentation/conf.py
@@ -276,7 +276,7 @@ man_pages = [
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
-#  dir menu entry, description, c  ategory)
+#  dir menu entry, description, category)
 texinfo_documents = [
 (master_doc, 'MonetDBIOTWebServer', u'MonetDB IOT WebServer Documentation',
  author, 'MonetDBIOTWebServer', 'One line description of project.',
diff --git a/sql/backends/monet5/iot/Tests/iot05.sql 
b/sql/backends/monet5/iot/Tests/iot05.sql
--- a/sql/backends/monet5/iot/Tests/iot05.sql
+++ b/sql/backends/monet5/iot/Tests/iot05.sql
@@ -13,6 +13,8 @@ set cnt = 0;
 -- this way their naming becomes easier, and mult-statement
 -- actions are better supported.
 
+--However, these queries won't run because the SQL context
+--holding the variables is not generally known
 create procedure clk1()
 begin
set hbclk1 = hbclk1+1;
@@ -21,14 +23,19 @@ end;
 create procedure clk3()
 begin
set hbclk1 = hbclk1+1;
-   set hbclk1 = hbclk1+1;
+   set hbclk2 = hbclk2+2;
--set cnt =(select count(*) from stmp);
 end;
 
 -- alternative is a simple query
 call iot.query('iot','clk1');
 call iot.query('iot','clk3');
-call iot.query('select 1;');
 
 select * from  iot.baskets();
 select * from  iot.queries();
+
+select hbclk1, hbclk2;
+call iot.activate();
+select hbclk1, hbclk2;
+
+
diff --git a/sql/backends/monet5/iot/Tests/iot10.sql 
b/sql/backends/monet5/iot/Tests/iot10.sql
--- a/sql/backends/monet5/iot/Tests/iot10.sql
+++ b/sql/backends/monet5/iot/Tests/iot10.sql
@@ -1,19 +1,24 @@
--- introduce a heartbeat query
+-- use accumulated aggregation
 set schema iot;
-set optimizer='iot_pipe';
 
 create table tmp_aggregate(tmp_total decimal(8,2), tmp_count decimal(8,2));
 insert into tmp_aggregate values(0.0,0.0);
 
-
 create procedure collector()
 begin
update tmp_aggregate
-   set tmp_total = tmp_total + (select sum(val) from 
iot.stream_tmp),
-   tmp_count = tmp_total + (select count(*) from 
iot.stream_tmp);
+   set tmp_total = tmp_total + (select sum(val) from iot.stmp),
+   tmp_count = tmp_total + (select count(*) from iot.stmp);
+   delete from iot.stmp;
 end;
 
-iot.query('iot','collector');
+insert into stmp values('2005-09-23 12:34:26.736',1,12.34);
+select * from stmp;
+
+call iot.query('iot','collector');
 
 select * from iot.baskets();
 select * from iot.queries();
+
+call iot.activate();
+select * from tmp_aggregate;
diff --git a/sql/backends/monet5/iot/petrinet.c 
b/sql/backends/monet5/iot/petrinet.c
--- a/sql/backends/monet5/iot/petrinet.c
+++ b/sql/backends/monet5/iot/petrinet.c
@@ -150,7 +150,7 @@ PNregisterInternal(Client cntxt, MalBlkP
pnet[pnettop].modname = GDKstrdup(getModuleId(sig));
pnet[pnettop].fcnname = GDKstrdup(getFunctionId(sig));
snprintf(buf,IDLENGTH,"petri_%d",pnettop);
-   s = newFunction("iot", buf, FUNCTIONsymbol);
+   s = newFunction(iotRef, putName(buf,strlen(buf)), FUNCTIONsymbol);
nmb = s->def;
setArgType(nmb, nmb->stmt[0],0, TYPE_void);
 (void) newStmt(nmb, sqlRef, transactionRef);
@@ -304,6 +304,7 @@ PNexecute( void *n)
 {
PNnode *node= (PNnode *) n;
int i,j, idx;
+   str msg=  MAL_SUCCEED;
_DEBUG_PETRINET_ mnstr_printf(PNout, "#petrinet.execute 
%s.%s\n",node->modname, node->fcnname);
// first grab exclusive access to all streams.
MT_lock_set();
@@ -315,10 +316,10 @@ PNexecute( void *n)
 
_DEBUG_PETRINET_ mnstr_printf(PNout, "#petrinet.execute %s.%s all 
locked\n",node->modname, node->fcnname);
 
-   runMALsequence(mal_clients, node->mb, 1, 0, node->stk, 0, 0);
+   msg = runMALsequence(mal_clients, node->mb, 1, 0, node->stk, 0, 0);
node->status = PNPAUSED;
 
-   _DEBUG_PETRINET_ mnstr_printf(PNout, "#petrinet.execute %s.%s 
transition done\n",node->modname, node->fcnname);
+   _DEBUG_PETRINET_ mnstr_printf(PNout, "#petrinet.execute %s.%s 
transition done:%s\n",node->modname, node->fcnname, (msg != 
MAL_SUCCEED?msg:""));
 
MT_lock_set();
for ( i=0; i< j &&  node->enabled && node->places[i]; i++) {
@@ -330,7 +331,7 @@ PNexecute( void *n)
 }
 
 static void
-PNcontroller(void *dummy)
+PNscheduler(void *dummy)
 {
int idx = -1, i, j;
int k = -1;
@@ -339,6 +340,7 

MonetDB: default - merged with Jun2016

2016-04-20 Thread Niels Nes
Changeset: 7be3e67f0299 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7be3e67f0299
Modified Files:
MacOSX/post-install.sh
clients/python2/monetdb/mapi.py
clients/python3/monetdb/mapi.py
monetdb5/modules/atoms/mtime.c
sql/storage/bat/bat_storage.c
sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql
sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out
sql/test/pg_regress/Tests/box.stable.err
sql/test/pg_regress/Tests/path.stable.err
sql/test/pg_regress/Tests/point.stable.err
sql/test/pg_regress/Tests/polygon.stable.err
Branch: default
Log Message:

merged with Jun2016


diffs (truncated from 460 to 300 lines):

diff --git a/MacOSX/post-install.sh b/MacOSX/post-install.sh
--- a/MacOSX/post-install.sh
+++ b/MacOSX/post-install.sh
@@ -2,6 +2,14 @@
 
 monetdb_path=/usr/local/monetdb/bin
 
-if [[ ":$PATH:" != *":$monetdb_path:"* ]]; then
-printf '\n# Set MonetDB path\nexport PATH=$PATH:'$monetdb_path'\n' >> 
~/.profile
-fi
+case $PATH in
+*:$monetdb_path|*:$monetdb_path:*|$monetdb_path:*)
+;;
+*)
+cat >> ~/.profile  BUNfirst(ins)) {
+   (*changes)++;
assert(cur->T->heap.storage != STORE_PRIV);
BATappend(cur,ins,TRUE);
cbat->cnt = cbat->ibase = BATcount(cur);
@@ -1690,6 +1691,7 @@ gtr_update_delta( sql_trans *tr, sql_del
BAT *uv = temp_descriptor(cbat->uvbid);
/* any updates */
if (BUNlast(ui) > BUNfirst(ui)) {
+   (*changes)++;
void_replace_bat(cur, ui, uv, TRUE);
temp_destroy(cbat->uibid);
temp_destroy(cbat->uvbid);
@@ -1709,7 +1711,7 @@ gtr_update_delta( sql_trans *tr, sql_del
 }
 
 static int
-gtr_update_dbat(sql_dbat *d)
+gtr_update_dbat(sql_dbat *d, int *changes)
 {
int ok = LOG_OK;
BAT *idb;
@@ -1722,6 +1724,7 @@ gtr_update_dbat(sql_dbat *d)
if (BUNlast(idb) > idb->batInserted) {
BAT *cdb = temp_descriptor(dbid);
 
+   (*changes)++;
append_inserted(cdb, idb);
bat_destroy(cdb);
}
@@ -1731,63 +1734,80 @@ gtr_update_dbat(sql_dbat *d)
 
 
 static int
-gtr_update_table(sql_trans *tr, sql_table *t)
+gtr_update_table(sql_trans *tr, sql_table *t, int *tchanges)
 {
int ok = LOG_OK;
node *n;
 
-   if (!t->base.wtime)
+   if (t->base.wtime <= t->base.allocated)
return ok;
-   gtr_update_dbat(t->data);
+   gtr_update_dbat(t->data, tchanges);
for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
+   int changes = 0;
sql_column *c = n->data;
 
-   if (!c->base.wtime) 
+   if (!c->base.wtime || c->base.wtime <= c->base.allocated) 
continue;
-   ok = gtr_update_delta(tr, c->data);
-   c->base.wtime = 0;
+   ok = gtr_update_delta(tr, c->data, );
+   if (changes)
+   c->base.allocated = c->base.wtime = tr->wstime;
+   (*tchanges) |= changes;
}
if (ok == LOG_OK && t->idxs.set) {
for (n = t->idxs.set->h; ok == LOG_OK && n; n = n->next) {
+   int changes = 0;
sql_idx *ci = n->data;
 
/* some indices have no bats */
-   if (!ci->base.wtime)
+   if (!ci->base.wtime || ci->base.wtime <= 
ci->base.allocated) 
continue;
 
-   ok = gtr_update_delta(tr, ci->data);
-   ci->base.wtime = 0;
+   ok = gtr_update_delta(tr, ci->data, );
+   if (changes)
+   ci->base.allocated = ci->base.wtime = 
tr->wstime;
+   (*tchanges) |= changes;
}
}
-   t->base.wtime = 0;
+   if (*tchanges)
+   t->base.allocated = t->base.wtime = tr->wstime;
return ok;
 }
 
-typedef int (*gtr_update_table_fptr)( sql_trans *tr, sql_table *t);
+typedef int (*gtr_update_table_fptr)( sql_trans *tr, sql_table *t, int 
*changes);
 
 static int
 _gtr_update( sql_trans *tr, gtr_update_table_fptr gtr_update_table_f)
 {
-   int ok = LOG_OK;
+   int ok = LOG_OK, tchanges = 0;
node *sn;
 
for(sn = tr->schemas.set->h; sn && ok == LOG_OK; sn = sn->next) {
+   int schanges = 0;
sql_schema *s = sn->data;

-   if (!isTempSchema(s) && s->tables.set && s->base.wtime) {
+   if (s->base.wtime <= s->base.allocated && 
+   gtr_update_table_f == gtr_update_table)
+   continue;
+   if (!s->base.wtime)
+

MonetDB: default - approve output after orderidx merge

2016-04-20 Thread Niels Nes
Changeset: 11a51a9287ed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=11a51a9287ed
Modified Files:
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
sql/test/Users/Tests/dropManyUsers.Bug-3764.stable.out
sql/test/leaks/Tests/check0.stable.out
sql/test/leaks/Tests/check0.stable.out.int128
sql/test/leaks/Tests/check1.stable.out
sql/test/leaks/Tests/check1.stable.out.int128
sql/test/leaks/Tests/check2.stable.out
sql/test/leaks/Tests/check2.stable.out.int128
sql/test/leaks/Tests/check3.stable.out
sql/test/leaks/Tests/check3.stable.out.int128
sql/test/leaks/Tests/check4.stable.out
sql/test/leaks/Tests/check4.stable.out.int128
sql/test/leaks/Tests/check5.stable.out
sql/test/leaks/Tests/check5.stable.out.int128
sql/test/leaks/Tests/drop3.stable.out
sql/test/leaks/Tests/drop3.stable.out.int128
sql/test/leaks/Tests/select1.stable.out.int128
sql/test/leaks/Tests/select2.stable.out.int128
sql/test/leaks/Tests/temp1.stable.out
sql/test/leaks/Tests/temp1.stable.out.int128
sql/test/leaks/Tests/temp2.stable.out
sql/test/leaks/Tests/temp2.stable.out.int128
sql/test/leaks/Tests/temp3.stable.out
sql/test/leaks/Tests/temp3.stable.out.int128
Branch: default
Log Message:

approve output after orderidx merge


diffs (truncated from 1079 to 300 lines):

diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out.int128 
b/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out.int128
@@ -38,67 +38,72 @@ Ready.
 [ 6@0, "delete",   "command",  "bat",  "(b:bat[:any_1]):bat[:any_1] ", 
"BKCdelete_all;"]
 [ 7@0, "delete",   "command",  "bat",  
"(b:bat[:any_1],d:bat[:oid]):bat[:any_1] ", "BKCdelete_multi;"  ]
 [ 8@0, "densebat", "command",  "bat",  
"(b:bat[:any_1],h:oid):bat[:any_1] ",   "BKCdelete;"]
-[ 9@0, "getAccess","command",  "bat",  "(b:bat[:any_1]):str ", 
"BKCgetBBPname;"]
-[ 10@0,"getCapacity",  "command",  "bat",  "(b:bat[:any_1]):oid ", 
"BKCgetSequenceBase;"   ]
-[ 11@0,"getColumnType","command",  "bat",  
"(b:bat[:any_1]):str ", "BKCgetAccess;" ]
-[ 12@0,"getName",  "command",  "bat",  "(bid:bat[:any_1]):str 
",   "BKCgetRole;"   ]
-[ 13@0,"getRole",  "command",  "bat",  "(b:bat[:any_1]):str ", 
"BKCgetColumnType;" ]
-[ 14@0,"getSequenceBase",  "command",  "bat",  
"(b:bat[:any_1]):lng ", "BKCgetCapacity;"   ]
-[ 15@0,"getSize",  "command",  "bat",  "(b:bat[:any_1]):lng ", 
"BKCgetSize;"   ]
-[ 16@0,"imprints", "command",  "bat",  "(b:bat[:hge]):lng ",   
"CMDBATimprintsize;"]
-[ 17@0,"imprints", "command",  "bat",  "(b:bat[:hge]):void ",  
"CMDBATimprints;"   ]
-[ 18@0,"imprints", "command",  "bat",  "(b:bat[:dbl]):lng ",   
"CMDBATimprintsize;"]
-[ 19@0,"imprints", "command",  "bat",  "(b:bat[:flt]):lng ",   
"CMDBATimprintsize;"]
-[ 20@0,"imprints", "command",  "bat",  "(b:bat[:lng]):lng ",   
"CMDBATimprintsize;"]
-[ 21@0,"imprints", "command",  "bat",  "(b:bat[:int]):lng ",   
"CMDBATimprintsize;"]
-[ 22@0,"imprints", "command",  "bat",  "(b:bat[:sht]):lng ",   
"CMDBATimprintsize;"]
-[ 23@0,"imprintsize",  "command",  "bat",  "(b:bat[:bte]):lng ",   
"CMDBATimprintsize;"]
-[ 24@0,"imprintsize",  "command",  "bat",  "(b:bat[:dbl]):void ",  
"CMDBATimprints;"   ]
-[ 25@0,"imprintsize",  "command",  "bat",  "(b:bat[:flt]):void ",  
"CMDBATimprints;"   ]
-[ 26@0,"imprintsize",  "command",  "bat",  "(b:bat[:lng]):void ",  
"CMDBATimprints;"   ]
-[ 27@0,"imprintsize",  "command",  "bat",  "(b:bat[:int]):void ",  
"CMDBATimprints;"   ]
-[ 28@0,"imprintsize",  "command",  "bat",  "(b:bat[:sht]):void ",  
"CMDBATimprints;"   ]
-[ 29@0,"imprintsize",  "command",  "bat",  "(b:bat[:bte]):void ",  
"CMDBATimprints;"   ]
-[ 30@0,"info", "command",  "bat",  
"(a:bat[:oid],b:bat[:oid]):bat[:oid] ", "BKCintersectcand;" ]
-[ 31@0,"intersectcand","command",  "bat",  
"(b1:bat[:any_1],b2:bat[:any_2]):bit ", "BKCisSynced;"  ]
-[ 32@0,"isPersistent", "command",  "bat",  "(b:bat[:any_1]):bit ", 
"BKCisPersistent;"  ]
-[ 33@0,"isSorted", "command",  "bat",  "(b:bat[:any_1]):bit ", 
"BKCisTransient;"   ]
-[ 34@0,

python-monetdb: default - Make spec file compatible with EPEL, a...

2016-04-20 Thread Sjoerd Mullender
Changeset: 9a674c575a94 for python-monetdb
URL: http://dev.monetdb.org/hg/python-monetdb?cmd=changeset;node=9a674c575a94
Modified Files:
python-monetdb.spec
Branch: default
Log Message:

Make spec file compatible with EPEL, and add missing build dependencies.


diffs (36 lines):

diff --git a/python-monetdb.spec b/python-monetdb.spec
--- a/python-monetdb.spec
+++ b/python-monetdb.spec
@@ -7,6 +7,21 @@
 %bcond_with python3
 %endif
 
+%if %{?rhel:1}%{!?rhel:0}
+# On RedHat Enterprise Linux, there is no python3, and the py2_build
+# and py2_install macros are also not available.  We define them here.
+%define py_setup setup.py
+%define py_shbang_opts -s
+%define py2_build %{expand:\
+CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build 
--executable="%{__python2} %{py2_shbang_opts}" %{?1}\
+}
+%define py2_install %{expand:\
+CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 
--skip-build --root %{buildroot} %{?1}\
+}
+# We need an extra dependecy
+BuildRequires: python-setuptools
+%endif
+
 Name:  python-monetdb
 Epoch: 1
 Version:   1.0
@@ -19,8 +34,10 @@ Source0: http://dev.monetdb.org/download
 
 BuildArch: noarch
 BuildRequires: python2-devel
+BuildRequires: python-six
 %if %{with python3}
 BuildRequires: python3-devel
+BuildRequires: python3-six
 %endif # with python3
 
 Requires:  python-six
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: HTM - Prettify the result a bit

2016-04-20 Thread Jennie Zhang
Changeset: 590d74103c20 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=590d74103c20
Modified Files:
sql/storage/store.c
Branch: HTM
Log Message:

Prettify the result a bit


diffs (15 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3642,7 +3642,10 @@ sql_trans_htm_garbagecollect(int ts)
 int
 sql_trans_get_htm_garbagecollect(int *ts)
 {
-   *ts = keep_persisted_log_files;
+   if (keep_persisted_log_files < 0)
+   *ts = -keep_persisted_log_files;
+   else
+   *ts = 0;
return SQL_OK;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list