asolimando commented on code in PR #3522:
URL: https://github.com/apache/calcite/pull/3522#discussion_r1453189554
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -643,11 +646,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 conditoin is for bug CALCITE-6078
f.checkCastFails("'" + numeric.maxOverflowNumericString + "'",
- type, OUT_OF_RANGE_MESSAGE, true, castType);
+ type, "Number has wrong format.*", true, castType);
Review Comment:
Nit: maybe we can introduce a variable `WRONG_FORMAT_MESSAGE` in the same
spirit of `OUT_OF_RANGE_MESSAGE` and others?
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -643,11 +646,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 conditoin is for bug CALCITE-6078
Review Comment:
```suggestion
// This condition is for bug [CALCITE-6078], not yet fixed
```
fixing a typo, reusing the same comment as above
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -643,11 +646,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 conditoin is for bug CALCITE-6078
f.checkCastFails("'" + numeric.maxOverflowNumericString + "'",
- type, OUT_OF_RANGE_MESSAGE, true, castType);
+ type, "Number has wrong format.*", true, castType);
f.checkCastFails("'" + numeric.minOverflowNumericString + "'",
- type, OUT_OF_RANGE_MESSAGE, true, castType);
+ type, "Number has wrong format.*", true, castType);
Review Comment:
fix here too if the proposal above is retained
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -657,10 +661,8 @@ void testCastExactNumericLimits(CastType castType,
SqlOperatorFixture f) {
f.checkCastToString(numeric.minNumericString, null, null, castType);
f.checkCastToString(numeric.minNumericString, type, null, castType);
- if (Bug.CALCITE_2539_FIXED) {
- f.checkCastFails("'notnumeric'", type, INVALID_CHAR_MESSAGE, true,
- castType);
- }
+ f.checkCastFails("'notnumeric'", type, INVALID_CHAR_MESSAGE, true,
Review Comment:
Question: `CALCITE-2539` isn't currently fixed, I guess you just verified
that the test passes and so confirmed it was safe to remove the "guard", right?
--
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]