MonetDB: Jun2016 - Fixed resource leak in ResultSetMetaData. It ...

2016-04-21 Thread Martin van Dinther
Changeset: 95cf74c7f51c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=95cf74c7f51c
Modified Files:
java/ChangeLog.Jun2016
java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
java/tests/Test_Rmetadata.java
sql/jdbc/tests/Tests/Test_Rmetadata.stable.out
Branch: Jun2016
Log Message:

Fixed resource leak in ResultSetMetaData. It created and cached a ResultSet
object for each column but never closed the ResultSet objects.


diffs (truncated from 496 to 300 lines):

diff --git a/java/ChangeLog.Jun2016 b/java/ChangeLog.Jun2016
--- a/java/ChangeLog.Jun2016
+++ b/java/ChangeLog.Jun2016
@@ -1,6 +1,10 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Thu Apr 21 2016 Martin van Dinther 
+- Fixed resource leak in ResultSetMetaData. It created and cached a ResultSet
+  object for each column but never closed the ResultSet objects.
+
 * Thu Mar 31 2016 Martin van Dinther 
 - Corrected DatabaseMetaData methods which accept a catalog filter argument.
   Those methods will now filter the results on the specified catalog name,
diff --git a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java 
b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
--- a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
+++ b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
@@ -21,6 +21,7 @@ import java.net.URL;
 import java.sql.Array;
 import java.sql.Blob;
 import java.sql.Clob;
+import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.NClob;
 import java.sql.Ref;
@@ -683,7 +684,7 @@ public class MonetResultSet extends Mone
 * @throws SQLException if there is no such column
 */
@Override
-   public boolean getBoolean(int columnIndex) throws SQLException{
+   public boolean getBoolean(int columnIndex) throws SQLException {
switch (getJavaType(types[columnIndex - 1])) {
case Types.TINYINT:
case Types.SMALLINT:
@@ -1081,11 +1082,63 @@ public class MonetResultSet extends Mone
public ResultSetMetaData getMetaData() {
// return inner class which implements the ResultSetMetaData 
interface
return new rsmdw() {
-   // for the more expensive methods, we provide a simple 
cache
-   // for the most expensive part; getting the ResultSet 
which
-   // contains the data
+   // for the more expensive methods (getPrecision(), 
getScale(), isNullable()), we provide a simple cache
+   // caches to store precision, scale and isNullable 
values from getColumns()
+   private boolean[] _is_fetched   = new 
boolean[columns.length +1];
+   private int[] _precision= new 
int[columns.length +1];
+   private int[] _scale= new 
int[columns.length +1];
+   private int[] _isNullable   = new 
int[columns.length +1];
+   private Connection conn = null;
private DatabaseMetaData dbmd = null;
-   private ResultSet[] colrs = new 
ResultSet[columns.length];
+
+   /**
+* A private method to fetch the precision, scale and 
isNuallble value for a fully qualified column.
+* As md.getColumns() is an expensive method we call it 
only once per column
+* and cache the precision, scale and isNullable values 
in the above array chaches.
+* Also we only call md.getColumns() when we have a non 
empty schema name and table name and column name.
+*/
+   private void fetchColumnInfo(int column) throws 
SQLException
+   {
+   if (column <= 0 || column > columns.length)
+   throw new SQLException("No such column 
" + column, "M1M05");
+
+   _is_fetched[column] = true;
+   _precision[column] = 0;
+   _scale[column] = 0;
+   _isNullable[column] = columnNullableUnknown;
+
+   // we can only call dbmd.getColumns() when we 
have a specific schema name and table name and column name
+   String schName = getSchemaName(column);
+   if (schName != null && !"".equals(schName)) {
+   String tblName = getTableName(column);
+   if (tblName != null && 
!"".equals(tblName)) {
+   String colName = 
getColumnName(column);
+  

MonetDB: iot - Added more data types for validation and cleaned ...

2016-04-21 Thread Pedro Ferreira
Changeset: 2b93ec7dc119 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b93ec7dc119
Modified Files:
clients/iotclient/documentation/index.rst
clients/iotclient/documentation/streams_data_types.rst
clients/iotclient/src/Streams/datatypes.py
clients/iotclient/src/Streams/jsonschemas.py
clients/iotclient/src/Streams/streamscreator.py
Branch: iot
Log Message:

Added more data types for validation and cleaned code


diffs (truncated from 803 to 300 lines):

diff --git a/clients/iotclient/documentation/index.rst 
b/clients/iotclient/documentation/index.rst
--- a/clients/iotclient/documentation/index.rst
+++ b/clients/iotclient/documentation/index.rst
@@ -17,4 +17,5 @@ Contents:
iot_server_arguments.rst
restful_resources.rst
streams_data_types.rst
-  conclusion.rst
+   conclusion.rst
+
diff --git a/clients/iotclient/documentation/streams_data_types.rst 
b/clients/iotclient/documentation/streams_data_types.rst
--- a/clients/iotclient/documentation/streams_data_types.rst
+++ b/clients/iotclient/documentation/streams_data_types.rst
@@ -15,8 +15,8 @@ By default a column is not nullable, but
 Text Types
 ==
 
-Text, String, Character Large Object
-
+Text, String, CLOB, Character Large Object
+--
 
 MonetDB's string types with unbounded length. The insertion must be provided 
as a JSON string.
 
@@ -30,15 +30,37 @@ UUID
 
 An *Universally Unique Identifier* according to `RFC 4122 
`_. The insertion as a JSON string is 
validated against the regular expression 
:code:`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`.
 
+MAC
+---
+
+A *Media Access Control Address* identifier. The insertion as a JSON string is 
validated against the regular expression 
:code:`^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$`. As MonetDB doesn't have a 
MAC equivalent data type yet, the data is stored as :code:`char(17)`.
+
+URL
+---
+
+An *Uniform Resource Locator* as a specific type of an URI is validated 
according to `RFC 3987 `_. The insertion 
must also be a JSON String.
+
 Inet
 
 
 An *IPv4* address. The insertion as a JSON string is validated against the 
regular expression :code:`^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$` with further 
semantic validation.
 
-URL

+InetSix
+---
 
-An *Uniform Resource Locator* as a specific type of an URI is validated 
according to `RFC 3987 `_. The insertion 
must also be a JSON String.
+An *IPv6* address. The value must be a JSON String. As MonetDB doesn't have an 
Ipv6 equivalent data type yet, the data is stored as :code:`char(45)`.
+
+.. warning:: Currently this validation is made with Python 
*socket.inet_pton()* function that is currently available only in some UNIX 
systems. `Check the documentation for further details 
`_.
+
+Regex
+-
+
+A string allways validated with a provided regular expression. The JSON must 
contain a :code:`regex` key with the regular expression. As MonetDB doesn't 
have a Regex equivalent data type yet, the data is stored as :code:`string`.
+
+Enum
+
+
+A SQL :code:`CHAR` type validated against a pre-defined array. During 
creation, the :code:`values` key must be present with a JSON array of Strings 
containing the values of the enum (ex: :code:`"values": ["red", "blue", 
"green"]`). The default value if provided must be one of the values.
 
 Number Types
 
@@ -90,22 +112,14 @@ As in numbers, a minimum and maximum val
 Date
 
 
-A regular date in the Gregorian Calendar, expressed in format "-MM-DD".
+A regular date in the Gregorian Calendar, expressed in format 
:code:`-MM-DD`.
 
 Time
 
 
-The time of day expressed in format "HH:MM:SS.sss".
+The time of day expressed in format :code:`HH:MM:SS.sss`. If the pair 
:code:`"timezone": false` is provided, the timezone will be truncated.
 
 Timestamp
 -
 
-A timestamp according to `RFC 3339 `_ 
with timezone. The regular expression is the standard `ISO 8601 with timezone 
format `_.
-
-Enum Type
-=
-
-Enum
-
-
-A SQL :code:`CHAR` type validated against a pre-defined array. During 
creation, the :code:`values` key must be present with a JSON array of Strings 
containing the values of the enum (ex: :code:`"values": ["red", "blue", 
"green"]`). The default value if provided must be one of the values.
+A timestamp according to `RFC 3339 `_ 
with timezone. The regular expression is the standard `ISO 8601 with timezone 
format `_. If the pair 
:code:`"timezone": false` is provided, the timezone will be truncated.
diff --git 

MonetDB: Jun2016 - Add manpage entry for listenaddr option

2016-04-21 Thread Panagiotis Koutsourakis
Changeset: 1ff132081af7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1ff132081af7
Modified Files:
tools/merovingian/daemon/monetdbd.1.in
Branch: Jun2016
Log Message:

Add manpage entry for listenaddr option

The listenaddr option was added in changeset 0299a992. This change adds a
small description of the functionality in the monetdbd man page.


diffs (15 lines):

diff --git a/tools/merovingian/daemon/monetdbd.1.in 
b/tools/merovingian/daemon/monetdbd.1.in
--- a/tools/merovingian/daemon/monetdbd.1.in
+++ b/tools/merovingian/daemon/monetdbd.1.in
@@ -169,6 +169,11 @@ This property specifies which TCP port
 .I monetdbd
 should listen to for connection requests.  Defaults to 5.
 .TP
+.B listenaddr
+This property specifies an address that is allowed to connect to the server.
+The user can specify one IP(v6) address, or use the 0.0.0.0 notation to allow
+connections from everywhere. Defaults to localhost (127.0.0.1).
+.TP
 .B control
 For remote management of
 .IR monetdbd ,
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - Optimise ResultSet.getBoolean(). Use switch i...

2016-04-21 Thread Martin van Dinther
Changeset: 4c699de69016 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4c699de69016
Modified Files:
java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
Branch: Jun2016
Log Message:

Optimise ResultSet.getBoolean(). Use switch instead of if then elseif ..
Eliminate the creation of new BigDecimal(0.0) object. Instead use static 
BigDecimal.ZERO object.


diffs (80 lines):

diff --git a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java 
b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
--- a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
+++ b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
@@ -684,43 +684,42 @@ public class MonetResultSet extends Mone
 */
@Override
public boolean getBoolean(int columnIndex) throws SQLException{
-   int dataType = getJavaType(types[columnIndex - 1]);
-   if (dataType == Types.TINYINT ||
-   dataType == Types.SMALLINT ||
-   dataType == Types.INTEGER ||
-   dataType == Types.BIGINT)
-   {
-   if (getLong(columnIndex) == 0L) {
-   return false;
-   } else {
+   switch (getJavaType(types[columnIndex - 1])) {
+   case Types.TINYINT:
+   case Types.SMALLINT:
+   case Types.INTEGER:
+   if (getInt(columnIndex) == 0) {
+   return false;
+   }
return true;
-   }
-   } else if (dataType == Types.REAL ||
-   dataType == Types.FLOAT ||
-   dataType == Types.DOUBLE)
-   {
-   if (getDouble(columnIndex) == 0.0) {
-   return false;
-   } else {
+   case Types.BIGINT:
+   if (getLong(columnIndex) == 0L) {
+   return false;
+   }
return true;
-   }
-   } else if (dataType == Types.DECIMAL ||
-   dataType == Types.NUMERIC)
-   {
-   if (getBigDecimal(columnIndex).compareTo(new 
BigDecimal(0.0)) == 0) {
-   return false;
-   } else {
+   case Types.DOUBLE:
+   case Types.FLOAT:
+   case Types.REAL:
+   if (getDouble(columnIndex) == 0.0) {
+   return false;
+   }
return true;
-   }
-   } else if (dataType == Types.BIT ||
-   dataType == Types.BOOLEAN ||
-   dataType == Types.CHAR ||
-   dataType == Types.VARCHAR ||
-   dataType == Types.LONGVARCHAR)
-   {
-   return 
(Boolean.valueOf(getString(columnIndex))).booleanValue();
-   } else {
-   throw new SQLException("Conversion from " + 
types[columnIndex - 1] + " to boolean type not supported", "M1M05");
+   case Types.DECIMAL:
+   case Types.NUMERIC:
+   if 
(getBigDecimal(columnIndex).compareTo(BigDecimal.ZERO) == 0) {
+   return false;
+   }
+   return true;
+   case Types.BOOLEAN:
+   case Types.BIT: // MonetDB doesn't use type BIT, it's 
here for completeness
+   case Types.CHAR:
+   case Types.VARCHAR:
+   case Types.LONGVARCHAR: // MonetDB doesn't use type 
LONGVARCHAR, it's here for completeness
+   case Types.CLOB:
+   // check if string value equals "true" (case 
insensitive) or not
+   return 
(Boolean.valueOf(getString(columnIndex))).booleanValue();
+   default:
+   throw new SQLException("Conversion from " + 
types[columnIndex - 1] + " to boolean type not supported", "M1M05");
}
}
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2015 - Added test for bug 3987.

2016-04-21 Thread Sjoerd Mullender
Changeset: df58cfe6f8b9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df58cfe6f8b9
Added Files:
sql/test/BugTracker-2016/Tests/data3987.csv
sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.sql.in
sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.err
sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.out
Branch: Jul2015
Log Message:

Added test for bug 3987.


diffs (143 lines):

diff --git a/sql/test/BugTracker-2016/Tests/data3987.csv 
b/sql/test/BugTracker-2016/Tests/data3987.csv
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/data3987.csv
@@ -0,0 +1,3 @@
+"a
+"b""c
+d"
diff --git a/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.sql.in 
b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.sql.in
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.sql.in
@@ -0,0 +1,6 @@
+START TRANSACTION;
+
+CREATE TABLE test3987 (a TEXT, b BIGINT);
+COPY INTO test3987 FROM '$QTSTSRCDIR/data3987.csv' DELIMITERS '\t','\n','\"' 
NULL AS '';
+
+ROLLBACK;
diff --git 
a/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.err 
b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.err
@@ -0,0 +1,40 @@
+stderr of test 'malformed-copy-int.Bug-3987` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 14:56:59 >  
+# 14:56:59 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32759" "--set" 
"mapi_usock=/var/tmp/mtest-25832/.s.monetdb.32759" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016" 
"--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 14:56:59 >  
+
+# builtin opt  gdk_dbpath = /ufs/sjoerd/Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 32759
+# cmdline opt  mapi_usock = /var/tmp/mtest-25832/.s.monetdb.32759
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016
+# cmdline opt  mal_listing = 0
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 14:57:00 >  
+# 14:57:00 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-25832" "--port=32759"
+# 14:57:00 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-25832/.s.monetdb.32759
+QUERY = COPY INTO test3987 FROM 
'/net/madrid/export/scratch1/sjoerd/src/MonetDB/stable/sql/test/BugTracker-2016/Tests/data3987.csv'
 DELIMITERS '\t','\n','\"' NULL AS '';
+ERROR = !Failed to import table incomplete record at end of file:
+
+# 14:57:00 >  
+# 14:57:00 >  "Done."
+# 14:57:00 >  
+
diff --git 
a/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.out 
b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/malformed-copy-int.Bug-3987.stable.out
@@ -0,0 +1,74 @@
+stdout of test 'malformed-copy-int.Bug-3987` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 14:56:59 >  
+# 14:56:59 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32759" "--set" 
"mapi_usock=/var/tmp/mtest-25832/.s.monetdb.32759" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016" 
"--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 14:56:59 >  
+
+# MonetDB 5 server v11.21.20 (hg id: c6164da1961d+)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2016', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
+# Found 15.589 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://madrid.da.cwi.nl:32759/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-25832/.s.monetdb.32759
+# MonetDB/GIS module loaded
+# Start processing logs sql/sql_logs version 52200
+# Finished processing logs sql/sql_logs
+# MonetDB/SQL module loaded
+# MonetDB/R   module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 

MonetDB: Jul2015 - Add NULL pointer check.

2016-04-21 Thread Sjoerd Mullender
Changeset: aedcd743f056 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aedcd743f056
Modified Files:
monetdb5/modules/mal/tablet.c
Branch: Jul2015
Log Message:

Add NULL pointer check.
This fixes bug 3987.


diffs (21 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -1103,7 +1103,7 @@ SQLload_parse_line(READERtask *task, int
}
 endofline:
/* check for too many values as well*/
-   if (*line && i == as->nr_attrs) {
+   if (line && *line && i == as->nr_attrs) {
errline = SQLload_error(task, idx, task->as->nr_attrs);
snprintf(errmsg, BUFSIZ, "Leftover data '%s'",line);
tablet_error(task, idx, (int) i, errmsg, errline);
@@ -1112,7 +1112,7 @@ endofline:
}
 #ifdef _DEBUG_TABLET_
if (error)
-   mnstr_printf(GDKout, "#line break failed %d:%s\n", idx, line);
+   mnstr_printf(GDKout, "#line break failed %d:%s\n", idx, line ? 
line : "EOF");
 #endif
return error ? -1 : 0;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: iot - Finished documentation and corrected regular expr...

2016-04-21 Thread Pedro Ferreira
Changeset: 5052d18264ac for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5052d18264ac
Added Files:
clients/iotclient/documentation/conclusion.rst
Removed Files:
clients/iotclient/documentation/future_work.rst
clients/iotclient/documentation/streams_creation.rst
Modified Files:
clients/iotclient/documentation/index.rst
clients/iotclient/documentation/iot_server_arguments.rst
clients/iotclient/documentation/restful_resources.rst
clients/iotclient/documentation/streams_data_types.rst
clients/iotclient/src/Streams/datatypes.py
clients/iotclient/src/Streams/jsonschemas.py
Branch: iot
Log Message:

Finished documentation and corrected regular expressions


diffs (truncated from 432 to 300 lines):

diff --git a/clients/iotclient/documentation/conclusion.rst 
b/clients/iotclient/documentation/conclusion.rst
new file mode 100644
--- /dev/null
+++ b/clients/iotclient/documentation/conclusion.rst
@@ -0,0 +1,25 @@
+.. _future_work:
+
+**
+Final Acknowledgements
+**
+
+Future Work
+===
+
+Currently the project is on a testing phase. More data types will also be 
added.
+
+Soon another web server will be built to implement an API for the baskets 
outputs from DataCell.
+
+.. _about-the-project:
+
+About the Project
+=
+
+.. _Send questions and suggestions to e-mail.: p.e.ferre...@cwi.nl
+
+Project maintained by Pedro Ferreira at CWI. `Send questions and suggestions 
to e-mail.`_
+
+MonetDB source repository: https://dev.monetdb.org/hg/MonetDB
+
+MonetDB solutions: https://monetdbsolutions.com/
diff --git a/clients/iotclient/documentation/future_work.rst 
b/clients/iotclient/documentation/future_work.rst
deleted file mode 100644
--- a/clients/iotclient/documentation/future_work.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-.. _future_work:
-
-
-**
-Other information
-**
-
-.. _future-work:
-
-Future Work
-===
-
-Talk about it
-
-.. _about-the-project:
-
-About the Project
-=
-
-IOT stuff
diff --git a/clients/iotclient/documentation/index.rst 
b/clients/iotclient/documentation/index.rst
--- a/clients/iotclient/documentation/index.rst
+++ b/clients/iotclient/documentation/index.rst
@@ -16,7 +16,5 @@ Contents:
introduction.rst
iot_server_arguments.rst
restful_resources.rst
-   streams_creation.rst
streams_data_types.rst
-   future_work.rst
-
+  conclusion.rst
diff --git a/clients/iotclient/documentation/iot_server_arguments.rst 
b/clients/iotclient/documentation/iot_server_arguments.rst
--- a/clients/iotclient/documentation/iot_server_arguments.rst
+++ b/clients/iotclient/documentation/iot_server_arguments.rst
@@ -53,7 +53,7 @@ Custom name of the host. By default is t
 Web Server Listening
 
 
-For security purposes, two web servers are created by the application. On the 
administration server are present operations to create and delete streams, 
while on application server the insert operations are present instead. The 
administration server should be listening on the host only, while the 
application server should be listening to the outside.
+For security purposes, two web servers are created by the application. On the 
administration server are present operations to create and delete streams, 
while on application server the insert operations are present instead. The 
administration server should be listening on the host only, while the 
application server should be listening to all interfaces.
 
 **-ih  - -ihost=**
 
@@ -94,5 +94,3 @@ Name of the user to authenticate. By def
 **-dd  - -ddatabase=**
 
 Name of database to use. By default is :code:`iotdb` database.
-
-
diff --git a/clients/iotclient/documentation/restful_resources.rst 
b/clients/iotclient/documentation/restful_resources.rst
--- a/clients/iotclient/documentation/restful_resources.rst
+++ b/clients/iotclient/documentation/restful_resources.rst
@@ -5,11 +5,125 @@
 RESTful Resources
 *
 
-Introduction
+Bellow is lested the available RESTful resource for both servers on IOT 
application. In case of error, the server will return the error message with 
the respective HTTP response code. 
+
+.. important:: All the keywords provided on JSON must be lower case, as well 
the column data types.
+
+Administration Server
+=
+
+The administration server provides resources to create and delete streams. 
Should be listening on the host only.
 
 .. _streams:
 
 /streams
-=
+
 
-Talk about this and the others
+**GET**
+
+Returns a JSON file with details about all the streams currently created on 
the webserver. For each stream besides its schema and name, it provides the 
currently number of tuples inserted on the baskets per column, description of 
columns (`See data types `__), the flushing 
method (`See streams creation for 

MonetDB: default - Add manpage entry for listenaddr option

2016-04-21 Thread Panagiotis Koutsourakis
Changeset: f39159d1153a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f39159d1153a
Modified Files:
tools/merovingian/daemon/monetdbd.1.in
Branch: default
Log Message:

Add manpage entry for listenaddr option

The listenaddr option was added in changeset 0299a992. This change adds a
small description of the functionality in the monetdbd man page.


diffs (15 lines):

diff --git a/tools/merovingian/daemon/monetdbd.1.in 
b/tools/merovingian/daemon/monetdbd.1.in
--- a/tools/merovingian/daemon/monetdbd.1.in
+++ b/tools/merovingian/daemon/monetdbd.1.in
@@ -169,6 +169,11 @@ This property specifies which TCP port
 .I monetdbd
 should listen to for connection requests.  Defaults to 5.
 .TP
+.B listenaddr
+This property specifies an address that is allowed to connect to the server.
+The user can specify one IP(v6) address, or use the 0.0.0.0 notation to allow
+connections from everywhere. Defaults to localhost (127.0.0.1).
+.TP
 .B control
 For remote management of
 .IR monetdbd ,
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - merge

2016-04-21 Thread Hannes Muehleisen
Changeset: 5797874334a3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5797874334a3
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
Branch: Jun2016
Log Message:

merge


diffs (124 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 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: Jun2016 - configure.win updated on CRAN request

2016-04-21 Thread Hannes Muehleisen
Changeset: 87e3010e32ff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=87e3010e32ff
Modified Files:
tools/embedded/rpackage/configure.win
tools/embedded/windows/sedscript.tpl
Branch: Jun2016
Log Message:

configure.win updated on CRAN request


diffs (49 lines):

diff --git a/tools/embedded/rpackage/configure.win 
b/tools/embedded/rpackage/configure.win
--- a/tools/embedded/rpackage/configure.win
+++ b/tools/embedded/rpackage/configure.win
@@ -2,15 +2,16 @@
 SRC=`pwd | sed -e 's|/cygdrive/||' -e 's|/|:/|'`"/src"
 
 # figure out bitness
+BITS=64
 if [ "$R_ARCH" = "/i386" ] 
 then
BITS=32
-else
-   BITS=64
 fi
 
+CC=`$R_CMD config CC`
+
 # patch sedscript for build/install/library paths
-sed -e "s|%BITS%|$BITS|" -e "s|%PREFIX%|${R_PACKAGE_DIR}/libs|" -e 
"s|%SRCDIR%|$SRC|" -e "s|%RINCLUDE%|${R_HOME}/include|" 
src/tools/embedded/windows/sedscript.tpl > src/tools/embedded/windows/sedscript
+sed -e "s|%CC%|$CC|" -e "s|%PREFIX%|${R_PACKAGE_DIR}/libs|" -e 
"s|%SRCDIR%|$SRC|" -e "s|%RINCLUDE%|${R_HOME}/include|" 
src/tools/embedded/windows/sedscript.tpl > src/tools/embedded/windows/sedscript
 
 # this is copied from NT/monetdb_config.h.in in the packaging script
 cp src/tools/embedded/windows/monetdb_config.h.in src/
@@ -26,7 +27,7 @@ cd src
 make -j
 OFILES=`find common clients/mapilib/ gdk monetdb5/mal monetdb5/modules 
monetdb5/optimizer sql tools/embedded -name "*.lo" | tr "\n" " "`
 
-gcc -shared -m$BITS -o libmonetdb5.dll $OFILES -lws2_32 -lpthread -lpsapi 
-Ltools/embedded/windows/pcre-8.37/libs/$R_ARCH/ -lpcre `R CMD config --ldflags`
+$CC -shared -o libmonetdb5.dll $OFILES -lws2_32 -lpthread -lpsapi 
-Ltools/embedded/windows/pcre-8.37/libs/$R_ARCH/ -lpcre `$R_CMD config 
--ldflags`
 
 cd ../
 mkdir -p $R_PACKAGE_DIR/libs/$R_ARCH/
diff --git a/tools/embedded/windows/sedscript.tpl 
b/tools/embedded/windows/sedscript.tpl
--- a/tools/embedded/windows/sedscript.tpl
+++ b/tools/embedded/windows/sedscript.tpl
@@ -39,11 +39,11 @@ s|@build_vendor@||
 s|@builtby@||
 s|@BZ_CFLAGS@||
 s|@BZ_LIBS@||
-s|@CC@|gcc|
+s|@CC@|%CC%|
 s|@CCDEPMODE@||
 s|@cfitsio_CFLAGS@||
 s|@cfitsio_LIBS@||
-s|@CFLAGS@|-m%BITS% -O3 -I"%RINCLUDE%" -DHAVE_EMBEDDED=1 -DHAVE_EMBEDDED_R=1|
+s|@CFLAGS@|-O3 -I"%RINCLUDE%" -DHAVE_EMBEDDED=1 -DHAVE_EMBEDDED_R=1|
 s|@CLASSPATH@||
 s|@compilercall@||
 s|@configure_input@||
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - Applied patch from Niels w.r.t BAT storage flush

2016-04-21 Thread Hannes Muehleisen
Changeset: c8e4f24b17ef for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8e4f24b17ef
Modified Files:
sql/storage/bat/bat_storage.c
Branch: Jun2016
Log Message:

Applied patch from Niels w.r.t BAT storage flush


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: Jun2016 - backout 59400:c8e4f24b17ef

2016-04-21 Thread Hannes Muehleisen
Changeset: e8e4c8a30b2e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e8e4c8a30b2e
Modified Files:
sql/storage/bat/bat_storage.c
Branch: Jun2016
Log Message:

backout 59400:c8e4f24b17ef


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,18 +1739,16 @@ 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 || c->base.wtime <= c->base.allocated) 
+   if (!c->base.wtime) 
continue;
ok = gtr_update_delta(tr, c->data, );
if (changes)
-   c->base.allocated = c->base.wtime = tr->wstime;
+   c->base.wtime = tr->wstime;
(*tchanges) |= changes;
}
if (ok == LOG_OK && t->idxs.set) {
@@ -1759,17 +1757,17 @@ gtr_update_table(sql_trans *tr, sql_tabl
sql_idx *ci = n->data;
 
/* some indices have no bats */
-   if (!ci->base.wtime || ci->base.wtime <= 
ci->base.allocated) 
+   if (!ci->base.wtime)
continue;
 
ok = gtr_update_delta(tr, ci->data, );
if (changes)
-   ci->base.allocated = ci->base.wtime = 
tr->wstime;
+   ci->base.wtime = tr->wstime;
(*tchanges) |= changes;
}
}
if (*tchanges)
-   t->base.allocated = t->base.wtime = tr->wstime;
+   t->base.wtime = tr->wstime;
return ok;
 }
 
@@ -1785,11 +1783,6 @@ 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) {
@@ -1801,12 +1794,12 @@ static int
schanges |= changes;
}
}
-   if (schanges && gtr_update_table_f == gtr_update_table){
-   s->base.allocated = s->base.wtime = tr->wstime;
+   if (schanges){
+   s->base.wtime = tr->wstime;
tchanges ++;
}
}
-   if (tchanges && gtr_update_table_f == gtr_update_table)
+   if (tchanges)
tr->wtime = tr->wstime;
return LOG_OK;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - Fix for copy into with single backslash file ...

2016-04-21 Thread Hannes Muehleisen
Changeset: 7e569fb87150 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7e569fb87150
Modified Files:
sql/backends/monet5/sql.c
Branch: Jun2016
Log Message:

Fix for copy into with single backslash file separator in monetdblite for 
windows


diffs (17 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
@@ -3437,8 +3437,12 @@ mvc_import_table_wrap(Client cntxt, MalB
GDKfree(ssep);
throw(MAL, "sql.copy_from", MAL_MALLOC_FAIL);
}
+#if defined(HAVE_EMBEDDED) && defined(WIN32)
+   // fix single backslash file separator on windows
+   strcpy(fn, *fname);
+#else
GDKstrFromStr(fn, (unsigned char*)*fname, len);
-
+#endif
ss = open_rastream((const char *) fn);
if (!ss || mnstr_errnr(ss)) {
int errnr = mnstr_errnr(ss);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2016 - Only use byte swapping intrinsics when compil...

2016-04-21 Thread Hannes Muehleisen
Changeset: db77a12fc5e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db77a12fc5e9
Modified Files:
common/stream/stream.c
tools/embedded/build-on-windows.bat
Branch: Jun2016
Log Message:

Only use byte swapping intrinsics when compiling with Visual Studio and not 
when using MinGW to avoid compilation warnings on 32 bit R


diffs (22 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -128,7 +128,7 @@
 #define UTF8BOM"\xEF\xBB\xBF" /* UTF-8 encoding of Unicode BOM 
*/
 #define UTF8BOMLENGTH  3  /* length of above */
 
-#ifdef WIN32
+#ifdef _MSC_VER
 /* use intrinsic functions on Windows */
 #define short_int_SWAP(s)  ((short) _byteswap_ushort((unsigned short) (s)))
 /* on Windows, long is the same size as int */
diff --git a/tools/embedded/build-on-windows.bat 
b/tools/embedded/build-on-windows.bat
--- a/tools/embedded/build-on-windows.bat
+++ b/tools/embedded/build-on-windows.bat
@@ -1,5 +1,5 @@
 rm MonetDBLite_0.2.2.zip
 "c:\Program Files (x86)\GnuWin32\bin\wget.exe" 
http://dev.monetdb.org/Assets/R/MonetDBLite_0.2.2.tar.gz
-"c:\Program Files\R\R-3.2.4revised\bin\R" CMD INSTALL --build 
--merge-multiarch MonetDBLite_0.2.2.tar.gz 
+"c:\Program Files\R\R-3.2.5\bin\R" CMD INSTALL --build --merge-multiarch 
MonetDBLite_0.2.2.tar.gz 
 rm MonetDBLite_0.2.2.tar.gz 
 pause
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list