caicancai commented on code in PR #4845: URL: https://github.com/apache/calcite/pull/4845#discussion_r2988533466
########## core/src/test/resources/sql/scalar.iq: ########## @@ -18,6 +18,32 @@ !set outputformat mysql !use scott +# 5 test cases for [CALCITE-7443] Incorrect simplification for large interval +SELECT -(INTERVAL -2147483648 months); +java.lang.ArithmeticException: integer overflow + +!error + +SELECT INTERVAL 2147483647 years; +java.lang.ArithmeticException: integer overflow + +!error + +SELECT -(INTERVAL -9223372036854775.808 SECONDS); +java.lang.ArithmeticException: long overflow + +!error + +SELECT INTERVAL 3000000 months * 1000; +java.lang.ArithmeticException: integer overflow + +!error + +SELECT INTERVAL 3000000 months / .0001; +java.lang.ArithmeticException: Overflow Review Comment: After reviewing the code, it seems the error message wasn't thrown by Calcite, but rather by the Java API, which makes sense now. -- 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]
