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

Enforce maximum precision on float [CORE5734] #5998

Closed
firebird-automations opened this issue Feb 1, 2018 · 5 comments
Closed

Enforce maximum precision on float [CORE5734] #5998

firebird-automations opened this issue Feb 1, 2018 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @mrotteveel

Is replaced by CORE6109

Firebird currently allows creation of float columns with a precision that exceeds the actual implementation precision. A double precision has about 16 decimal digits precision, and this is the maximum supported by Firebird. However it is possible to create a float(100) (which still results in a double precision).

The SQL Standard (6.1 <data type>) says:
"""
29) FLOAT specifies the data type approximate numeric, with binary precision equal to or greater than the value of the specified <precision>. The maximum value of <precision> is implementation-defined. <precision> shall not be greater than this value.
"""

Given we do not provide a precision larger than 16, the precision should be capped at 16, attempts to create a float(p) with p > 16 should yield an error.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Note that given the specification of "binary precision", the precision should actually specify the number significand bits, so we should actually map precision 1-24 on REAL, and 25-53 on DOUBLE PRECISION, but changing that would severely break backwards compatibility.

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Link: This issue is replaced by CORE6109 [ CORE6109 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

This was addressed by the changes in CORE6109

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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

No branches or pull requests

1 participant