Cast dies with numeric value is out of range error (5.0.1 snapshot)
omachtandras opened this issue · 6 comments
omachtandras commented
Hi,
5.0.1.1398 snapshot
select cast('27' as numeric(4,2))
from rdb$database
causes
arithmetic exception, numeric overflow, or string truncation.
numeric value is out of range.
error.
It works fine with 5.0.0.1306 and 4.0., 3.0.
asfernandes commented
Looks like it appeared in v4 in commit c909897
For me, results are different:
SQL> select cast('27' as numeric(4,2)) from rdb$database;
CAST
=======
0.27
omachtandras commented
Confirmed, 5.0.1.1408 and 4.0.5.3103 are working fine.
@hvlad, @asfernandes thanks for the fix.
pavel-zotov commented
pavel-zotov commented
PS. Although can be reproduced on 4.0.5.3077 (14-mar-2024) :-)
hvlad commented
pavel-zotov commented
i did not pay attention on arithmetic correctness of result :-)
just see that no error raised on snapshot 5.0.1.1398