mihaibudiu commented on code in PR #3919:
URL: https://github.com/apache/calcite/pull/3919#discussion_r1721026422
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -2661,6 +2663,19 @@ void checkModOperatorDivByZero(SqlOperatorFixture f) {
f.checkNull("1e1 / cast(null as float)");
f.checkScalarExact("100.1 / 0.00000000000000001", "DECIMAL(19, 6) NOT
NULL",
"1.001E+19");
+ SqlOperatorFixture f0 = f.withFactory(tf ->
+ tf.withTypeSystem(typeSystem ->
+ new DelegatingTypeSystem(typeSystem) {
+ @Override public int getMaxNumericPrecision() {
+ return 28;
+ }
+
+ @Override public int getMaxNumericScale() {
+ return 10;
+ }
+ }));
+ f0.checkScalarExact("95.0 / 100", "DECIMAL(12, 10) NOT NULL", "0.95");
+ f0.checkScalarExact("95 / 100.0", "DECIMAL(17, 6) NOT NULL", "0.95");
Review Comment:
We are only fixing a bug for decimals, not for integers.
--
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]