Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.35.0
Description
Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline:
select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130
The empno is INT type. The result is wrong:
-126, -126
I think it should throw exception when overflow, instead of returning wrong result to user.
At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921.
Attachments
Issue Links
- Blocked
-
CALCITE-5921 SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure
- Closed
- is related to
-
CALCITE-5843 Constant expression with nested casts causes a compiler crash
- Closed
- links to