mihaibudiu commented on code in PR #3522:
URL: https://github.com/apache/calcite/pull/3522#discussion_r1458056660
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -643,11 +647,12 @@ void testCastExactNumericLimits(CastType castType,
SqlOperatorFixture f) {
f.checkCastToScalarOkay("'" + numeric.minNumericString + "'",
type, numeric.minNumericString, castType);
- if (Bug.CALCITE_2539_FIXED) {
+ if (numeric != Numeric.DECIMAL5_2) {
+ // The above condition is for bug CALCITE-6078
f.checkCastFails("'" + numeric.maxOverflowNumericString + "'",
- type, OUT_OF_RANGE_MESSAGE, true, castType);
+ type, WRONG_FORMAT_MESSAGE, true, castType);
Review Comment:
Actually this variant of the test invokes something like
`Integer.parseInt(string)`. So this is in fact a cast from a string to integer
-- notice the single quotes added around the literal -- which gives a different
error than a cast from a larger integer to an integer. The former produces a
WRONG_FORMAT, the latter gives OUT_OF_RANGE. We could in principle trap the
exception and rewrite the message, but it *is* a different exception in Java in
the simplification code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]