mihaibudiu commented on code in PR #3945:
URL: https://github.com/apache/calcite/pull/3945#discussion_r1742769643


##########
core/src/test/resources/sql/misc.iq:
##########
@@ -3182,4 +3182,41 @@ from (values 0) as t(x);
 EnumerableValues(tuples=[[{ true, false, true, false, true, false, true, false 
}]])
 !plan
 
+# [CALCITE-6560] Add supportsNegativeScale in RelDataTypeSystem
+
+!set outputformat csv
+
+# throw an exception when CAST target decimal type has illegal precision and 
scale parameter
+
+# precision is negative number
+values cast(15.3 as decimal(-1,4));
+Error while executing SQL "values cast(15.3 as decimal(-1,4))": parse failed: 
Encountered "-" at line 1, column 29.
+!error
+
+# precision is 0
+values cast(15.3 as decimal(0,4));
+DECIMAL precision 0 must be between 1 and max precision 19
+!error
+
+# scale is negative number
+values cast(15.3 as decimal(1,-1));
+Error while executing SQL "values cast(15.3 as decimal(1,-1))": parse failed: 
Encountered "-" at line 1, column 31.

Review Comment:
   it means that there is at least one more bug somewhere - this shouldn't 
happen



-- 
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]

Reply via email to