db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r639428 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java
Date Thu, 20 Mar 2008 19:53:21 GMT
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 );
     }
     
     



Mime
View raw message