Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast dies with numeric value is out of range error (5.0.1 snapshot) #8120

Closed
omachtandras opened this issue May 15, 2024 · 6 comments · Fixed by #8129
Closed

Cast dies with numeric value is out of range error (5.0.1 snapshot) #8120

omachtandras opened this issue May 15, 2024 · 6 comments · Fixed by #8129

Comments

@omachtandras
Copy link

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
Copy link
Member

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 

hvlad added a commit that referenced this issue May 24, 2024
@hvlad hvlad self-assigned this May 24, 2024
hvlad added a commit that referenced this issue May 24, 2024
Simplest fix for bug #8120 : Cast dies with numeric value is out of range error (5.0.1 snapshot)
hvlad added a commit that referenced this issue May 24, 2024
hvlad added a commit that referenced this issue May 24, 2024
@omachtandras
Copy link
Author

Confirmed, 5.0.1.1408 and 4.0.5.3103 are working fine.
@hvlad, @asfernandes thanks for the fix.

@pavel-zotov
Copy link

QA note: could not reproduce on 5.0.1.1398-f339eb4
image

@pavel-zotov
Copy link

PS. Although can be reproduced on 4.0.5.3077 (14-mar-2024) :-)

@hvlad
Copy link
Member

hvlad commented May 27, 2024

QA note: could not reproduce on 5.0.1.1398-f339eb4 image

Do you consider 0.27 as correct result here ?

@pavel-zotov
Copy link

i did not pay attention on arithmetic correctness of result :-)
just see that no error raised on snapshot 5.0.1.1398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment