zstan commented on code in PR #4501:
URL: https://github.com/apache/ignite-3/pull/4501#discussion_r1793561556
##########
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java:
##########
@@ -482,6 +484,70 @@ public void testPrepareTimeout() {
});
}
+ @ParameterizedTest(name = "{0}")
+ @MethodSource("decimalOverflows")
+ @SuppressWarnings("ThrowableNotThrown")
+ public void testDecimalOpOverflow(String expr, Object param) {
+ assertThrowsSqlException(RUNTIME_ERR, "Numeric field overflow", () ->
sql(expr, param));
+ }
+
+ private static Stream<Arguments> decimalOverflows() {
+ return Stream.of(
+ arguments("SELECT (? + 1)::DECIMAL(2, 0)", 99),
+ arguments("SELECT (? - 1)::DECIMAL(2, 0)", -99),
+ arguments("SELECT (? * 2)::DECIMAL(2, 0)", 50),
+ arguments("SELECT (? / 0.1)::DECIMAL(2, 0)", 10),
+
+ arguments("SELECT (9 + ?)::DECIMAL(2, 1)", 1),
+ arguments("SELECT (9 - ?)::DECIMAL(2, 1)", 19),
+ arguments("SELECT (9 * ?)::DECIMAL(2, 1)", 2),
+ arguments("SELECT (9 / ?)::DECIMAL(2, 1)", 0.5)
+ );
+ }
Review Comment:
I remove it
--
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]