/[Apache-SVN]
ViewVC logotype

Revision 1755133


Jump to revision: Previous Next
Author: bpendleton
Date: Thu Aug 4 01:29:02 2016 UTC (7 years, 7 months ago)
Changed paths: 2
Log Message:
DERBY-853: ResultSetMetaData.getScale returns inconsistent values

This patch was contributed by Danoja Dias (danojadias at gmail dot com)

When a SQL statement contains arithmetic expressions, the result of the
expression may be of a different type than the operands to the expression,
due to type precedence rules which may require promoting the operand
values during evaluation of the expression.

For example, subtracting a DOUBLE from a DECIMAL results in a DOUBLE.

In some of these cases, Derby was reporting that the result column
had a non-zero scale, although the result column was not of DECIMAL type.

This change modifies the NumericTypeCompiler so that it only computes
a non-zero scale for the result column when it is of DECIMAL type.


Changed paths

Path Details
Directorydb/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java modified , text changed
Directorydb/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26