Changeset: 27a1b439ac98 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=27a1b439ac98
Added Files:
        debian/monetdb-r.install
Modified Files:
        debian/control
        debian/fix-deb.sh
        debian/monetdb5-server.install
        java/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
        sql/backends/monet5/vaults/shp/shp.h
Branch: default
Log Message:

Merge with Jun2016 branch.


diffs (truncated from 1041 to 300 lines):

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 5), autotoo
  libbam-dev, libbz2-dev, libcurl4-gnutls-dev, libgeos-dev (>= 3.4.0),
  libgsl0-dev, libpcre3-dev, libreadline-dev,
  libssl-dev, libxml2-dev, perl, pkg-config, python, python3,
- unixodbc-dev, uuid-dev, zlib1g-dev, liblas-c-dev (>= 1.8.0)
+ unixodbc-dev, uuid-dev, zlib1g-dev, liblas-c-dev (>= 1.8.0), r-base
 Standards-Version: 3.8.0
 X-Python-Version: >= 2.6
 X-Python3-Version: >= 3.0
@@ -283,6 +283,22 @@ Description: MonetDB5 128 bit integer (h
  This package provides HUGEINT (128-bit integer) support for the SQL
  frontend of MonetDB.
 
+Package: monetdb-r
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, monetdb5-sql (= ${source:Version})
+Description: MonetDB5 128 bit integer (hugeint) support for SQL
+ MonetDB is a database management system that is developed from a
+ main-memory perspective with use of a fully decomposed storage model,
+ automatic index management, extensibility of data types and search
+ accelerators.  It also has an SQL frontend.
+ .
+ This package contains the interface to use the R language from within
+ SQL queries.
+ .
+ NOTE: INSTALLING THIS PACKAGE OPENS UP SECURITY ISSUES.  If you don't
+ know how this package affects the security of your system, do not
+ install it.
+
 Package: monetdb-testing
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
diff --git a/debian/fix-deb.sh b/debian/fix-deb.sh
--- a/debian/fix-deb.sh
+++ b/debian/fix-deb.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 if [ -f /etc/lsb-release ]; then
     source /etc/lsb-release
     ID=${DISTRIB_ID,,}
diff --git a/debian/monetdb-r.install b/debian/monetdb-r.install
new file mode 100644
--- /dev/null
+++ b/debian/monetdb-r.install
@@ -0,0 +1,3 @@
+debian/tmp/usr/lib/monetdb5/rapi.mal usr/lib/monetdb5
+debian/tmp/usr/lib/monetdb5/autoload/??_rapi.mal usr/lib/monetdb5/autoload
+debian/tmp/usr/lib/monetdb5/lib_rapi.so usr/lib/monetdb5
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,25 +1,26 @@
 debian/tmp/usr/bin/mserver5 usr/bin
 debian/tmp/usr/lib/libmonetdb5.so.* usr/lib
 
-# usr/lib/monetdb5/lib_*.so EXCEPT: lib_{bam,geom,gsl,lidar,sql}.so
+# usr/lib/monetdb5/lib_*.so EXCEPT: lib_{bam,geom,gsl,lidar,rapi,sql}.so
 debian/tmp/usr/lib/monetdb5/lib_generator.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_lsst.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_opt_sql_append.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_udf.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_vault.so usr/lib/monetdb5
 
-# usr/lib/monetdb5/*.mal EXCEPT: {bam,geom,gsl,lidar,sql*,*_hge}.mal
-debian/tmp/usr/lib/monetdb5/[!bglsu]*.mal usr/lib/monetdb5
+# usr/lib/monetdb5/*.mal EXCEPT: {bam,geom,gsl,lidar,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/monetdb5/[!bglrsu]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/ba[!m]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/b[!a]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/generator.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/g[!es]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/l[!i]*.mal usr/lib/monetdb5
+debian/tmp/usr/lib/monetdb5/r[!a]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/s[!q]*.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/udf.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/u[!d]*.mal usr/lib/monetdb5
 
-# usr/lib/monetdb5/autoload/*.mal EXCEPT: *_{bam,geom,gsl,hge,lidar,sql}.mal
+# usr/lib/monetdb5/autoload/*.mal EXCEPT: 
*_{bam,geom,gsl,hge,lidar,rapi,sql}.mal
 debian/tmp/usr/lib/monetdb5/autoload/??_batcalc.mal usr/lib/monetdb5/autoload
 debian/tmp/usr/lib/monetdb5/autoload/??_calc.mal usr/lib/monetdb5/autoload
 debian/tmp/usr/lib/monetdb5/autoload/??_generator.mal usr/lib/monetdb5/autoload
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
@@ -137,7 +137,7 @@ public class MonetResultSet extends Mone
        }
 
        /**
-        * Constructor used by MonetFillableResultSet.
+        * Constructor used by MonetVirtualResultSet.
         * DO NOT USE THIS CONSTRUCTOR IF YOU ARE NOT EXTENDING THIS OBJECT!
         *
         * @param columns the column names
@@ -300,14 +300,14 @@ public class MonetResultSet extends Mone
         */
        @Override
        public int findColumn(String columnName) throws SQLException {
-               if (columnName != null) {
+               if (columnName != null && columns != null) {
                        for (int i = 0; i < columns.length; i++) {
-                               if (columns[i].equals(columnName))
+                               if (columnName.equals(columns[i]))
                                        return i + 1;
                        }
                        /* if an exact match did not succeed try a case 
insensitive match */
                        for (int i = 0; i < columns.length; i++) {
-                               if (columns[i].equalsIgnoreCase(columnName))
+                               if (columnName.equalsIgnoreCase(columns[i]))
                                        return i + 1;
                        }
                }
@@ -328,30 +328,30 @@ public class MonetResultSet extends Mone
        }
 
        @Override
-       public Array getArray(int i) throws SQLException {
-               throw new SQLFeatureNotSupportedException("Method getArray not 
implemented yet, sorry!", "0A000");
+       public Array getArray(int columnIndex) throws SQLException {
+               throw newSQLFeatureNotSupportedException("getArray");
        }
        @Override
        public Array getArray(String colName) throws SQLException {
-               throw new SQLFeatureNotSupportedException("Method getArray not 
implemented yet, sorry!", "0A000");
+               throw newSQLFeatureNotSupportedException("getArray");
        }
 
        /* Mapi doesn't allow something for streams at the moment, thus all not 
implemented for now */
        @Override
        public InputStream getAsciiStream(int columnIndex) throws SQLException {
-               throw new SQLFeatureNotSupportedException("Method 
getAsciiStream not implemented yet, sorry!", "0A000");
+               throw newSQLFeatureNotSupportedException("getAsciiStream");
        }
        @Override
        public InputStream getAsciiStream(String columnName) throws 
SQLException {
-               throw new SQLFeatureNotSupportedException("Method 
getAsciiStream not implemented yet, sorry!", "0A000");
+               throw newSQLFeatureNotSupportedException("getAsciiStream");
        }
        @Override
        public InputStream getUnicodeStream(int columnIndex) throws 
SQLException {
-               throw new SQLFeatureNotSupportedException("Method 
getUnicodeStream not implemented yet, sorry!", "0A000");
+               throw newSQLFeatureNotSupportedException("getUnicodeStream");
        }
        @Override
        public InputStream getUnicodeStream(String columnName) throws 
SQLException {
-               throw new SQLFeatureNotSupportedException("Method 
getUnicodeStream not implemented yet, sorry!", "0A000");
+               throw newSQLFeatureNotSupportedException("getUnicodeStream");
        }
 
        /**
@@ -470,7 +470,7 @@ public class MonetResultSet extends Mone
         */
        @Override
        public Reader getNCharacterStream(int columnIndex) throws SQLException {
-               throw new 
SQLFeatureNotSupportedException("getNCharacterStream() not supported", "0A000");
+               throw newSQLFeatureNotSupportedException("getNCharacterStream");
        }
 
        /**
@@ -489,7 +489,7 @@ public class MonetResultSet extends Mone
         */
        @Override
        public Reader getNCharacterStream(String columnName) throws 
SQLException {
-               return getNCharacterStream(findColumn(columnName));
+               throw newSQLFeatureNotSupportedException("getNCharacterStream");
        }
 
        /**
@@ -578,7 +578,7 @@ public class MonetResultSet extends Mone
         */
        @Override
        public NClob getNClob(int i) throws SQLException {
-               throw new SQLFeatureNotSupportedException("getNClob() not 
supported", "0A000");
+               throw newSQLFeatureNotSupportedException("getNClob");
        }
 
        /**
@@ -596,7 +596,7 @@ public class MonetResultSet extends Mone
         */
        @Override
        public NClob getNClob(String colName) throws SQLException {
-               return getNClob(findColumn(colName));
+               throw newSQLFeatureNotSupportedException("getNClob");
        }
 
        /**
@@ -928,7 +928,11 @@ public class MonetResultSet extends Mone
         */
        @Override
        public int getHoldability() throws SQLException {
-               return getStatement().getConnection().getHoldability();
+               // prevent NullPointerException when statement is null (i.c. 
MonetVirtualResultSet)
+               if (this.getStatement() != null) {
+                       return getStatement().getConnection().getHoldability();
+               }
+               return ResultSet.HOLD_CURSORS_OVER_COMMIT;
        }
 
        /**
@@ -939,7 +943,30 @@ public class MonetResultSet extends Mone
         */
        @Override
        public int getFetchDirection() {
-               return FETCH_FORWARD;
+               return ResultSet.FETCH_FORWARD;
+       }
+
+       /**
+        * Gives a hint as to the direction in which the rows in this ResultSet
+        * object will be processed. The initial value is determined by the
+        * Statement object that produced this ResultSet object.
+        * The fetch direction may be changed at any time.
+        * <b>currently not implemented</b>
+        *
+        * @param direction - an int specifying the suggested fetch direction;
+        * one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or 
ResultSet.FETCH_UNKNOWN
+        */
+       @Override
+       public void setFetchDirection(int direction) throws SQLException {
+               switch (direction) {
+               case ResultSet.FETCH_FORWARD:
+                       break;
+               case ResultSet.FETCH_REVERSE:
+               case ResultSet.FETCH_UNKNOWN:
+                       throw new SQLException("Not supported direction " + 
direction, "0A000");
+               default:
+                       throw new SQLException("Illegal direction: " + 
direction, "M1M05");
+               }
        }
 
        /**
@@ -1146,8 +1173,11 @@ public class MonetResultSet extends Mone
                                                String colName = 
getColumnName(column);
                                                if (colName != null && 
!"".equals(colName)) {
                                                        if (conn == null) {
-                                                               // first time, 
get a Connection object and cache it for all next columns
-                                                               conn = 
getStatement().getConnection();
+                                                               // prevent 
NullPointerException when statement is null (i.c. MonetVirtualResultSet)
+                                                               if 
(getStatement() != null) {
+                                                                       // 
first time, get a Connection object and cache it for all next columns
+                                                                       conn = 
getStatement().getConnection();
+                                                               }
                                                        }
                                                        if (conn != null && 
dbmd == null) {
                                                                // first time, 
get a MetaData object and cache it for all next columns
@@ -1543,8 +1573,11 @@ public class MonetResultSet extends Mone
                        public String getColumnClassName(int column) throws 
SQLException {
                                try {
                                        if (conn == null) {
-                                               // first time, get a Connection 
object and cache it for all next columns
-                                               conn = 
getStatement().getConnection();
+                                               // prevent NullPointerException 
when statement is null (i.c. MonetVirtualResultSet)
+                                               if (getStatement() != null) {
+                                                       // first time, get a 
Connection object and cache it for all next columns
+                                                       conn = 
getStatement().getConnection();
+                                               }
                                        }
                                        if (conn != null) {
                                                Class type = null;
@@ -1652,10 +1685,10 @@ public class MonetResultSet extends Mone
         */
        @Override
        public Object getObject(int columnIndex) throws SQLException {
-         /* statement is null for virtual result sets such as the ones that 
hold generated keys */
-         if (this.getStatement() == null) {
-          return getObject(columnIndex, new HashMap<String, Class<?>>());
-         }
+               /* statement is null for MonetVirtualResultSet such as the ones 
that hold generated keys */
+               if (this.getStatement() == null) {
+                       return getObject(columnIndex, new HashMap<String, 
Class<?>>());
+               }
                return getObject(columnIndex, 
this.getStatement().getConnection().getTypeMap());
        }
 
@@ -1669,11 +1702,26 @@ public class MonetResultSet extends Mone
        }
 
        /**
-        * Retrieves the value of the designated column in the current row of 
this
-        * ResultSet object as an Object in the Java programming language. If 
the
-        * value is an SQL NULL, the driver returns a Java null. This method 
uses
-        * the given Map object for the custom mapping of the SQL structured or
-        * distinct type that is being retrieved.
+        * Gets the value of the designated column in the current row of this
+        * ResultSet object as an Object in the Java programming language.
+        *
+        * This method will return the value of the given column as a Java 
object.
+        * The type of the Java object will be the default Java object type 
corresponding
+        * to the column's SQL type, following the mapping for built-in types 
specified
+        * in the JDBC specification.
+        * If the value is an SQL NULL, the driver returns a Java null.
+        *
+        * This method may also be used to read database-specific abstract data 
types.
+        * In the JDBC 2.0 API, the behavior of method getObject is extended to
+        * materialize data of SQL user-defined types.
+        *
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to