We should. The evaluate method currently does not throw SQLException. I am thinking of making it throw an SQLException, but that would touch more files and I would want to leave it to another CL.


On 3/11/13 6:16 PM, "James Taylor" <notifications@github.com> wrote:

In src/test/java/com/salesforce/phoenix/arithmatic/ArithmeticOperationTest.java:
> +            // good with precision 8 and scale 2.
> +            query = "SELECT col2 + col3 FROM testDecimalArithmatic WHERE pk='testValueOne'";
> +            stmt = conn.prepareStatement(query);
> +            rs = stmt.executeQuery();
> +            assertTrue(rs.next());
> +            result = rs.getBigDecimal(1);
> +            assertEquals(new BigDecimal("12468.45"), result);
> +            // bad due to exceeding scale.
> +            query = "SELECT col1 + col3 FROM testDecimalArithmatic WHERE pk='testValueOne'";
> +            stmt = conn.prepareStatement(query);
> +            rs = stmt.executeQuery();
> +            assertTrue(rs.next());
> +            result = rs.getBigDecimal(1);
> +            assertNull(result);
> +            // bad due to exceeding precision.
> +            query = "SELECT col1 + col2 FROM testDecimalArithmatic WHERE pk='testValueThree'";
Do/should these throw if precision/scale is exceeded?

-
Reply to this email directly or view it on GitHub <https://github.com/forcedotcom/phoenix/pull/90/files#r3328382> .