You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2008/03/20 20:53:21 UTC
svn commit: r639428 -
/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java
Author: rhillegas
Date: Thu Mar 20 12:53:20 2008
New Revision: 639428
URL: http://svn.apache.org/viewvc?rev=639428&view=rev
Log:
DERBY-3536: Fix casting of DECIMALs in TableFunctions on J2ME platforms.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java?rev=639428&r1=639427&r2=639428&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java Thu Mar 20 12:53:20 2008
@@ -718,6 +718,7 @@
{
if ( typeID.isLongVarcharTypeId() ) { castLongvarchar( dtd, dvd ); }
else if ( typeID.isLongVarbinaryTypeId() ) { castLongvarbinary( dtd, dvd ); }
+ else if ( typeID.isDecimalTypeId() ) { castDecimal( dtd, dvd ); }
else
{
Object o = dvd.getObject();
@@ -770,6 +771,19 @@
dvd.setValue( result );
}
+ }
+
+ /**
+ * <p>
+ * Set the correct precision and scale for a decimal value.
+ * </p>
+ */
+ private void castDecimal( DataTypeDescriptor dtd, DataValueDescriptor dvd )
+ throws StandardException
+ {
+ VariableSizeDataValue vsdv = (VariableSizeDataValue) dvd;
+
+ vsdv.setWidth( dtd.getPrecision(), dtd.getScale(), false );
}