Changeset: 592cda20e24e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=592cda20e24e
Modified Files:
        clients/Tests/exports.stable.out
Branch: sciql
Log Message:

Merge with default branch.


diffs (truncated from 780 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -624,24 +624,24 @@ str ALGprod_wrd_wrd(wrd *res, int *bid, 
 str ALGprojectCst(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt);
 str ALGprojectNIL(int *ret, int *bid);
-str ALGprojecthead_bit(int *ret, ptr *val, int *bid);
-str ALGprojecthead_bte(int *ret, ptr *val, int *bid);
-str ALGprojecthead_dbl(int *ret, ptr *val, int *bid);
-str ALGprojecthead_flt(int *ret, ptr *val, int *bid);
-str ALGprojecthead_int(int *ret, ptr *val, int *bid);
-str ALGprojecthead_lng(int *ret, ptr *val, int *bid);
-str ALGprojecthead_oid(int *ret, ptr *val, int *bid);
-str ALGprojecthead_sht(int *ret, ptr *val, int *bid);
-str ALGprojecthead_str(int *ret, ptr *val, int *bid);
-str ALGprojecttail_bit(int *ret, int *bid, ptr *val);
-str ALGprojecttail_bte(int *ret, int *bid, ptr *val);
-str ALGprojecttail_dbl(int *ret, int *bid, ptr *val);
-str ALGprojecttail_flt(int *ret, int *bid, ptr *val);
-str ALGprojecttail_int(int *ret, int *bid, ptr *val);
-str ALGprojecttail_lng(int *ret, int *bid, ptr *val);
-str ALGprojecttail_oid(int *ret, int *bid, ptr *val);
-str ALGprojecttail_sht(int *ret, int *bid, ptr *val);
-str ALGprojecttail_str(int *ret, int *bid, ptr *val);
+str ALGprojecthead_bit(int *ret, bit *val, int *bid);
+str ALGprojecthead_bte(int *ret, bte *val, int *bid);
+str ALGprojecthead_dbl(int *ret, dbl *val, int *bid);
+str ALGprojecthead_flt(int *ret, flt *val, int *bid);
+str ALGprojecthead_int(int *ret, int *val, int *bid);
+str ALGprojecthead_lng(int *ret, lng *val, int *bid);
+str ALGprojecthead_oid(int *ret, oid *val, int *bid);
+str ALGprojecthead_sht(int *ret, sht *val, int *bid);
+str ALGprojecthead_str(int *ret, str *val, int *bid);
+str ALGprojecttail_bit(int *ret, int *bid, bit *val);
+str ALGprojecttail_bte(int *ret, int *bid, bte *val);
+str ALGprojecttail_dbl(int *ret, int *bid, dbl *val);
+str ALGprojecttail_flt(int *ret, int *bid, flt *val);
+str ALGprojecttail_int(int *ret, int *bid, int *val);
+str ALGprojecttail_lng(int *ret, int *bid, lng *val);
+str ALGprojecttail_oid(int *ret, int *bid, oid *val);
+str ALGprojecttail_sht(int *ret, int *bid, sht *val);
+str ALGprojecttail_str(int *ret, int *bid, str *val);
 str ALGrangejoin(int *result, int *lid, int *rlid, int *rhid, bit *li, bit 
*hi);
 str ALGrangesplit(int *result, int *bid, int *nfrag);
 str ALGreuse(int *ret, int *bid);
diff --git a/gdk/gdk_bbp.mx b/gdk/gdk_bbp.mx
--- a/gdk/gdk_bbp.mx
+++ b/gdk/gdk_bbp.mx
@@ -2491,6 +2491,10 @@ BBPkeepref(bat i)
                i = -i;
        if (BBPcheck(i, "BBPkeepref")) {
                int lock = locked_by ? BBP_getpid() != locked_by : 1;
+               BAT *b;
+
+               if ((b = BBPdescriptor(i)) != NULL)
+                       BATsettrivprop(b);
 
                incref(i, TRUE, lock);
                assert(BBP_refs(i));
diff --git a/java/ChangeLog.Dec2011 b/java/ChangeLog.Dec2011
--- a/java/ChangeLog.Dec2011
+++ b/java/ChangeLog.Dec2011
@@ -1,3 +1,7 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Tue Feb 28 2012 Fabian Groffen <[email protected]>
+- Implemented missing Number types support in
+  PreparedStatement.setObject()
+
diff --git a/java/Makefile.ag b/java/Makefile.ag
--- a/java/Makefile.ag
+++ b/java/Makefile.ag
@@ -27,7 +27,7 @@ JAVA_HOME = @JAVA_HOME@
 ant_distjdbc = {
        COND = HAVE_JAVAJDBC
        DIR = datadir/monetdb/lib
-       FILES = monetdb-mcl-1.7.jar monetdb-jdbc-2.1.jar jdbcclient.jar
+       FILES = monetdb-mcl-1.7.jar monetdb-jdbc-2.2.jar jdbcclient.jar
 }
 
 ant_distmerocontrol = {
diff --git a/java/build.properties b/java/build.properties
--- a/java/build.properties
+++ b/java/build.properties
@@ -19,7 +19,7 @@ MCL_MINOR=7
 # major release number
 JDBC_MAJOR=2
 # minor release number
-JDBC_MINOR=1
+JDBC_MINOR=2
 # an additional identifying string
 JDBC_VER_SUFFIX=Liberica
 # the default port to connect on, if no port given when using SQL
diff --git a/java/pom.xml b/java/pom.xml
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -6,7 +6,7 @@
        <modelVersion>4.0.0</modelVersion>
        <groupId>monetdb</groupId>
        <artifactId>monetdb-jdbc</artifactId>
-       <version>2.1</version>
+       <version>2.2</version>
        <name>monetdb-jdbc</name>
        <description>MonetDB JDBC driver</description>
        <repositories>
diff --git a/java/release.txt b/java/release.txt
--- a/java/release.txt
+++ b/java/release.txt
@@ -1,8 +1,8 @@
 RELEASE NOTES
-MonetDB JDBC driver version 2.1 (Liberica/MCL-1.7)
+MonetDB JDBC driver version 2.2 (Liberica/MCL-1.7)
 Fabian Groffen <[email protected]>
 
-Release date: 2012-02-24
+Release date: 2012-02-28
 
 
 This JDBC driver is designed for use with MonetDB, a main-memory
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -1702,8 +1702,15 @@ public class MonetPreparedStatement
                                default:
                                        throw new SQLException("Conversion not 
allowed", "M1M05");
                        }
-               } else if (x instanceof BigDecimal) {
-                       BigDecimal num = (BigDecimal)x;
+               } else if (x instanceof BigDecimal ||
+                               x instanceof Byte ||
+                               x instanceof Short ||
+                               x instanceof Integer ||
+                               x instanceof Long ||
+                               x instanceof Float ||
+                               x instanceof Double)
+               {
+                       Number num = (Number)x;
                        switch (targetSqlType) {
                                case Types.TINYINT:
                                        setByte(parameterIndex, 
num.byteValue());
@@ -1715,7 +1722,12 @@ public class MonetPreparedStatement
                                        setInt(parameterIndex, num.intValue());
                                break;
                                case Types.BIGINT:
-                                       setLong(parameterIndex, 
num.setScale(scale, BigDecimal.ROUND_HALF_UP).longValue());
+                                       if (x instanceof BigDecimal) {
+                                               BigDecimal bd = (BigDecimal)x;
+                                               setLong(parameterIndex, 
bd.setScale(scale, BigDecimal.ROUND_HALF_UP).longValue());
+                                       } else {
+                                               setLong(parameterIndex, 
num.longValue());
+                                       }
                                break;
                                case Types.REAL:
                                        setFloat(parameterIndex, 
num.floatValue());
@@ -1726,7 +1738,12 @@ public class MonetPreparedStatement
                                break;
                                case Types.DECIMAL:
                                case Types.NUMERIC:
-                                       setBigDecimal(parameterIndex, num);
+                                       if (x instanceof BigDecimal) {
+                                               setBigDecimal(parameterIndex, 
(BigDecimal)x);
+                                       } else {
+                                               setBigDecimal(parameterIndex,
+                                                       new 
BigDecimal(num.doubleValue()));
+                                       }
                                break;
                                case Types.BIT:
                                case Types.BOOLEAN:
@@ -1744,20 +1761,6 @@ public class MonetPreparedStatement
                                default:
                                        throw new SQLException("Conversion not 
allowed", "M1M05");
                        }
-               } else if (x instanceof BigInteger) {
-                       BigInteger num = (BigInteger)x;
-                       switch (targetSqlType) {
-                               case Types.BIGINT:
-                                       setLong(parameterIndex, 
num.longValue());
-                               break;
-                               case Types.CHAR:
-                               case Types.VARCHAR:
-                               case Types.LONGVARCHAR:
-                                       setString(parameterIndex, x.toString());
-                               break;
-                               default:
-                                       throw new SQLException("Conversion not 
allowed", "M1M05");
-                       }
                } else if (x instanceof Boolean) {
                        boolean val = ((Boolean)x).booleanValue();
                        switch (targetSqlType) {
@@ -1803,6 +1806,20 @@ public class MonetPreparedStatement
                                default:
                                        throw new SQLException("Conversion not 
allowed", "M1M05");
                        }
+               } else if (x instanceof BigInteger) {
+                       BigInteger num = (BigInteger)x;
+                       switch (targetSqlType) {
+                               case Types.BIGINT:
+                                       setLong(parameterIndex, 
num.longValue());
+                               break;
+                               case Types.CHAR:
+                               case Types.VARCHAR:
+                               case Types.LONGVARCHAR:
+                                       setString(parameterIndex, x.toString());
+                               break;
+                               default:
+                                       throw new SQLException("Conversion not 
allowed", "M1M05");
+                       }
                } else if (x instanceof byte[]) {
                        switch (targetSqlType) {
                                case Types.BINARY:
@@ -1879,24 +1896,24 @@ public class MonetPreparedStatement
                        setBlob(parameterIndex, (Blob)x);
                } else if (x instanceof Clob) {
                        setClob(parameterIndex, (Clob)x);
-               } else if (x instanceof NClob) {
-                       throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type NClob currently not supported!", "0A000");
                } else if (x instanceof Struct) {
                        // I have no idea how to do this...
                        throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type Struct currently not supported!", "0A000");
                } else if (x instanceof Ref) {
                        setRef(parameterIndex, (Ref)x);
+               } else if (x instanceof java.net.URL) {
+                       setURL(parameterIndex, (java.net.URL)x);
                } else if (x instanceof RowId) {
                        setRowId(parameterIndex, (RowId)x);
-               } else if (x instanceof java.net.URL) {
-                       setURL(parameterIndex, (java.net.URL)x);
-               } else if (x instanceof SQLData) {
+               } else if (x instanceof NClob) {
+                       throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type NClob currently not supported!", "0A000");
+               } else if (x instanceof SQLXML) {
+                       throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type SQLXML currently not supported!", "0A000");
+               } else if (x instanceof SQLData) { // not in JDBC4.1???
                        // do something with:
                        // ((SQLData)x).writeSQL( [java.sql.SQLOutput] );
                        // needs an SQLOutput stream... bit too far away from 
reality
                        throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type SQLData currently not supported!", "0A000");
-               } else if (x instanceof SQLXML) {
-                       throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type SQLXML currently not supported!", "0A000");
                } else {        // java Class
                        throw new SQLFeatureNotSupportedException("Operation 
setObject() with object of type Class currently not supported!", "0A000");
                }
diff --git a/monetdb5/modules/kernel/algebra.mx 
b/monetdb5/modules/kernel/algebra.mx
--- a/monetdb5/modules/kernel/algebra.mx
+++ b/monetdb5/modules/kernel/algebra.mx
@@ -1081,8 +1081,8 @@ algebra_export str ALGselectNotNil(int *
 algebra_export str ALGuhashsplit(int *result, int *bid, int *nfrag);
 
 @= project_export
-algebra_export str ALGprojecthead_@1(int *ret,ptr *val, int *bid);
-algebra_export str ALGprojecttail_@1(int *ret,int *bid, ptr *val);
+algebra_export str ALGprojecthead_@1(int *ret, @1 *val, int *bid);
+algebra_export str ALGprojecttail_@1(int *ret, int *bid, @1 *val);
 @
 @h
 @:project_export(int)@
@@ -1526,12 +1526,6 @@ CMDfragment(BAT **result, BAT *b, ptr hl
 }
 
 static int
-CMDthetajoin(BAT **result, BAT *left, BAT *right, int *mode, lng *estimate)
-{
-       return (*result = BATthetajoin(left, right, *mode, *estimate == lng_nil 
|| *estimate < 0 ? BUN_NONE : (*estimate >= (lng) BUN_MAX ? BUN_MAX : (BUN) 
*estimate))) ? GDK_SUCCEED : GDK_FAIL;
-}
-
-static int
 CMDbandjoin(BAT **result, BAT *left, BAT *right, ptr minus, ptr plus, bit *li, 
bit *hi)
 {
        return (*result = BATbandjoin(left, right, minus, plus, *li, *hi)) ? 
GDK_SUCCEED : GDK_FAIL;
@@ -2606,8 +2600,8 @@ ALGthetajoinEstimate(int *result, int *l
                BBPreleaseref(left->batCacheid);
                BBPreleaseref(right->batCacheid);
                throw(MAL, "algebra.thetajoin", ILLEGAL_ARGUMENT " Theta 
comparison <> not yet supported");
-       } 
-       CMDthetajoin(&bn, left, right, opc, estimate);
+       }
+       bn = BATthetajoin(left, right, *opc, *estimate == lng_nil || *estimate 
< 0 ? BUN_NONE : (*estimate >= (lng) BUN_MAX ? BUN_MAX : (BUN) *estimate));
        if (bn) {
                if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
                *result = bn->batCacheid;
@@ -3692,51 +3686,37 @@ ALGprojectNIL(int *ret, int *bid)
  * The constant versions are typed by the parser
  */
 @= projectImpl
-str ALGprojecthead_@1(int *ret,ptr *val, int *bid){
+str
+ALGprojecthead_@1(int *ret, @1 *val, int *bid)
+{
        BAT *b, *bn;
-       BUN p,q;
-       BATiter bi;
 
        @:getBATdescriptor(bid,b,"batcalc.project")@
 
-       bn= BATnew(TYPE_@1,BATttype(b),BATcount(b));
+       b = BATmirror(b);
+       bn = BATconst(b, TYPE_@1, val);
+       bn = BATmirror(bn);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to