-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Firebird float support does not conform to Interbase spec [CORE2315] #2739
Comments
Modified by: @AlexPeshkoffassignee: Bill Oliver [ verbguy ] |
Commented by: @AlexPeshkoff Fincal patch is decided to be: #ifdef FLT_MAX Added not to forget after beta1. |
Commented by: Claudio Valderrama C. (robocop) Beware that the documentation says: Of these macros, only FLT_RADIX is guaranteed to be a constant expression. The other macros listed here cannot be reliably used in places that require constant expressions, such as `#if' preprocessing directives or in the dimensions of static arrays. |
Commented by: @AlexPeshkoff May be I'm dumb, but where do you see use of FLT_MAX with #if or as static array index? |
Commented by: Bill Oliver (verbguy) fixed for 2.5 RC 1 |
Modified by: Bill Oliver (verbguy)Fix Version: 2.5 RC1 [ 10362 ] |
Modified by: Bill Oliver (verbguy)status: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] |
Commented by: @pcisar QA test added. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: Bill Oliver (verbguy)
Assigned to: Bill Oliver (verbguy)
Is related to QA387
The Interbase documentation says that a float value should have a range from 1.175E-38 to 3.402E38. But, the largest value I can put in appears to be just under 3.4E38. 3.4E38 or higher results in overflow.
This came up when running the JDBCCTS tests against Firebird embedded. Thanks go to my co-worker Dave M.
This was fixed in SAS Vulcan (S0275993). The code in jrd/cvt.cpp is using hard-coded 3.4E38 instead of the proper FLT_MAX symbol which is 3.402823466e+38F. Fix provided to Alex for review.
Here is bad test case:
create table float_test (i integer, f float);
insert into float_test values (1, 3.0);
insert into float_test values (1, 3.402823466e+38);
produces this output:
insert into float_test values (1, 3.402823466e+38);
Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-numeric value is out of range
Here is correct results with my patch:
SQL> create table float_test (i integer, f float);
SQL> insert into float_test values (1, 3.0);
SQL> insert into float_test values (1, 3.402823466e+38);
SQL> select * from float_test;
============ ==============
1 3.0000000
1 3.4028235e+38
Commits: d80913a
The text was updated successfully, but these errors were encountered: