db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r289667 - in /db/derby/code/branches/10.1/java: engine/org/apache/derby/iapi/types/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functio...
Date Fri, 16 Sep 2005 22:25:53 GMT
Author: kmarsden
Date: Fri Sep 16 15:25:39 2005
New Revision: 289667

URL: http://svn.apache.org/viewcvs?rev=289667&view=rev
Log:
DERBY-518
Data type mismatch error for boolean to DECIMAL conversion in J2ME
merge from trunk

svn merge -r 264944:264945 https://svn.apache.org/repos/asf/db/derby/code/trunk
svn merge -r 265042:265043 https://svn.apache.org/repos/asf/db/derby/code/trunk
svn merge -r 279925:279926 https://svn.apache.org/repos/asf/db/derby/code/trunk
	Contributed by Deepa Remesh
	

Added:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/util/BigDecimalHandler.java
  (props changed)
      - copied unchanged from r265043, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BigDecimalHandler.java
Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset_app.properties

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
Fri Sep 16 15:25:39 2005
@@ -208,6 +208,15 @@
 	}
 	
 	/**
+	 * Set the value from a boolean
+	 */
+	public void setValue(boolean theValue)
+	{
+		int intValue = theValue ? 1 : 0;
+		setValue(intValue);
+	}
+	
+	/**
 	 * Convert from a double, normalize and then convert as a String.
 	 *
 	 * @exception StandardException		Thrown on error

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
Fri Sep 16 15:25:39 2005
@@ -288,9 +288,9 @@
 getColumnTypeName(16): BLOB
 isReadOnly(16): true
 isDefinitelyWritable(16): false
-getBigDecimal(1,1): 1.0
+getBigDecimal(1,1): 1
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(i,1): 1.0
+getBigDecimal(i,1): 1
 getBoolean(1): true
 getBoolean(i): true
 getByte(1): 1
@@ -325,9 +325,9 @@
 Data Conversion SQLException
 getTimestamp(i) got exception 
 Data Conversion SQLException
-getBigDecimal(2,1): 2.0
+getBigDecimal(2,1): 2
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(s,1): 2.0
+getBigDecimal(s,1): 2
 getBoolean(2): true
 getBoolean(s): true
 getByte(2): 2
@@ -683,9 +683,9 @@
 Data Conversion SQLException
 getTimestamp(v) got exception 
 Data Conversion SQLException
-getBigDecimal(10,1): 10.1
+getBigDecimal(10,1): 10.10
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(dc,1): 10.1
+getBigDecimal(dc,1): 10.10
 getBoolean(10): true
 getBoolean(dc): true
 getByte(10): 10
@@ -720,9 +720,9 @@
 Data Conversion SQLException
 getTimestamp(dc) got exception 
 Data Conversion SQLException
-getBigDecimal(11,1): 11.0
+getBigDecimal(11,1): 11
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(bi,1): 11.0
+getBigDecimal(bi,1): 11
 getBoolean(11): true
 getBoolean(bi): true
 getByte(11): 11

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
Fri Sep 16 15:25:39 2005
@@ -288,9 +288,9 @@
 getColumnTypeName(16): BLOB
 isReadOnly(16): true
 isDefinitelyWritable(16): false
-getBigDecimal(1,1): 1.0
+getBigDecimal(1,1): 1
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(i,1): 1.0
+getBigDecimal(i,1): 1
 getBoolean(1): true
 getBoolean(i): true
 getByte(1): 1
@@ -325,9 +325,9 @@
 Data Conversion SQLException
 getTimestamp(i) got exception 
 Data Conversion SQLException
-getBigDecimal(2,1): 2.0
+getBigDecimal(2,1): 2
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(s,1): 2.0
+getBigDecimal(s,1): 2
 getBoolean(2): true
 getBoolean(s): true
 getByte(2): 2
@@ -683,9 +683,9 @@
 Data Conversion SQLException
 getTimestamp(v) got exception 
 Data Conversion SQLException
-getBigDecimal(10,1): 10.1
+getBigDecimal(10,1): 10.10
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(dc,1): 10.1
+getBigDecimal(dc,1): 10.10
 getBoolean(10): true
 getBoolean(dc): true
 getByte(10): 10
@@ -720,9 +720,9 @@
 Data Conversion SQLException
 getTimestamp(dc) got exception 
 Data Conversion SQLException
-getBigDecimal(11,1): 11.0
+getBigDecimal(11,1): 11
 beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
-getBigDecimal(bi,1): 11.0
+getBigDecimal(bi,1): 11
 getBoolean(11): true
 getBoolean(bi): true
 getByte(11): 11

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
Fri Sep 16 15:25:39 2005
@@ -304,8 +304,8 @@
 isReadOnly(16): false
 isWritable(16): Expected isWritable value
 isDefinitelyWritable(16): false
-getBigDecimal(1,1): 1.0
-getBigDecimal(i,1): 1.0
+getBigDecimal(1,1): 1
+getBigDecimal(i,1): 1
 getBoolean(1): true
 getBoolean(i): true
 getByte(1): 1
@@ -340,8 +340,8 @@
 Data Conversion SQLException
 getTimestamp(i) got exception 
 Data Conversion SQLException
-getBigDecimal(2,1): 2.0
-getBigDecimal(s,1): 2.0
+getBigDecimal(2,1): 2
+getBigDecimal(s,1): 2
 getBoolean(2): true
 getBoolean(s): true
 getByte(2): 2
@@ -690,8 +690,8 @@
 Data Conversion SQLException
 getTimestamp(v) got exception 
 Data Conversion SQLException
-getBigDecimal(10,1): 10.1
-getBigDecimal(dc,1): 10.1
+getBigDecimal(10,1): 10.10
+getBigDecimal(dc,1): 10.10
 getBoolean(10): true
 getBoolean(dc): true
 getByte(10): 10
@@ -726,8 +726,8 @@
 Data Conversion SQLException
 getTimestamp(dc) got exception 
 Data Conversion SQLException
-getBigDecimal(11,1): 11.0
-getBigDecimal(bi,1): 11.0
+getBigDecimal(11,1): 11
+getBigDecimal(bi,1): 11
 getBoolean(11): true
 getBoolean(bi): true
 getByte(11): 11

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
Fri Sep 16 15:25:39 2005
@@ -35,6 +35,7 @@
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil;
 import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derbyTesting.functionTests.util.BigDecimalHandler;
 
 /**
  * Test of JDBC result set and result set meta-data.
@@ -145,7 +146,7 @@
 				for (int i=1;i<=colCount;i++) {
 					try {
 						System.out.println("getBigDecimal("+i+",1): "+
-													rs.getBigDecimal(i, 1));
+											BigDecimalHandler.getBigDecimalString(rs,i));
 					}
 					catch (Throwable e) {
 						System.out.println(
@@ -159,7 +160,7 @@
 							System.out.println("beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)");
 						System.out.println("getBigDecimal("+
 										columnNames[i-1]+ ",1): "+
-										rs.getBigDecimal(columnNames[i-1], 1));
+										BigDecimalHandler.getBigDecimalString(rs,columnNames[i-1],i));
 					}
 					catch (Throwable e) {
 						System.out.println(
@@ -363,12 +364,12 @@
 						// this does not test the values returned, just whether it gives an exception.
 						if (i>11)
 						{
-							rs.getObject(i);
+							BigDecimalHandler.getObjectString(rs,i);
 							System.out.println("getObject("+i+") is ok");
 						}
 						else
 							System.out.println("getObject("+i+"): "+
-													rs.getObject(i));
+												BigDecimalHandler.getObjectString(rs,i));
 					}
 					catch (SQLException e) {
 						System.out.println(
@@ -382,13 +383,13 @@
 						// this does not test the values returned, just whether it gives an exception.
 						if (i>11)
 						{
-							rs.getObject(columnNames[i-1]);
+							BigDecimalHandler.getObjectString(rs,columnNames[i-1],i);
 							System.out.println("getObject("+columnNames[i-1]+") is ok ");
 						}
 						else
 							System.out.println("getObject("+
 										columnNames[i-1]+ "): "+
-										rs.getObject(columnNames[i-1]));
+										BigDecimalHandler.getObjectString(rs,columnNames[i-1],i));
 					}
 					catch (SQLException e) {
 						System.out.println(

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset_app.properties?rev=289667&r1=289666&r2=289667&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset_app.properties
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset_app.properties
Fri Sep 16 15:25:39 2005
@@ -1,5 +1,2 @@
-#Exclude for J2ME/Foundation - test requires java.math.BigDecimal
-runwithfoundation=false
-
 usedefaults=true
 

Propchange: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/util/BigDecimalHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message