Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
snuyanzin committed Apr 8, 2024
1 parent 3fc1e11 commit 636dd99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
12 changes: 0 additions & 12 deletions core/src/main/java/org/apache/calcite/util/Bug.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,6 @@ public abstract class Bug {
* Fix to be available with Avatica 1.24.0 [CALCITE-6053] */
public static final boolean CALCITE_6092_FIXED = false;

/** Whether
* <a href="https://issues.apache.org/jira/browse/CALCITE-6053">[CALCITE-6053]
* Upgrade Calcite to Avatica 1.24.0</a> is fixed.
*/
public static final boolean CALCITE_6053_FIXED = false;

/** Whether
* <a href="https://issues.apache.org/jira/browse/CALCITE-6248">[CALCITE-6248]
* Illegal dates are accepted by casts</a> is fixed.
* Fix to be available with Avatica 1.25.0 */
public static final boolean CALCITE_6248_FIXED = false;

/**
* Use this to flag temporary code.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,14 +1307,12 @@ void testCastStringToDateTime(CastType castType, SqlOperatorFixture f) {
f.checkNull("cast('notdate' as DATE)");
}

if (Bug.CALCITE_6248_FIXED) {
if (castType == CastType.CAST) {
f.checkFails("cast('52534253' as DATE)", BAD_DATETIME_MESSAGE, true);
f.checkFails("cast('1945-30-24' as DATE)", BAD_DATETIME_MESSAGE, true);
} else {
f.checkNull("cast('52534253' as DATE)");
f.checkNull("cast('1945-30-24' as DATE)");
}
if (castType == CastType.CAST) {
f.checkFails("cast('52534253' as DATE)", BAD_DATETIME_MESSAGE, true);
f.checkFails("cast('1945-30-24' as DATE)", BAD_DATETIME_MESSAGE, true);
} else {
f.checkNull("cast('52534253' as DATE)");
f.checkNull("cast('1945-30-24' as DATE)");
}

// cast null
Expand Down

0 comments on commit 636dd99

Please sign in to comment.