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
Datatype declaration DECFLOAT without precision should use a default precision [CORE5710] #5976
Comments
Commented by: @aafemt I would rather choose max precision (34). |
Modified by: @mrotteveeldescription: SQL:2016 specifies the following for datatype declaration of DECFLOAT: """ In other words, specifying the precision is optional, as explicitly defined in the Syntax rules: """ I propose we default to precision 16 when no precision has been specified, choosing the lower precision, similar to what we currently do with FLOAT (where FLOAT without precision or precision less than 8 maps to REAL, and precision >= 8 to DOUBLE PRECISION). Currently trying to create a column with just DECFLOAT yields: Executing statement... SQL Message : -607 Engine Code : 335544351 => SQL:2016 specifies the following for datatype declaration of DECFLOAT: """ In other words, specifying the precision is optional, as explicitly defined in the Syntax rules: """ I propose we default to precision 34 when no precision has been specified, choosing the higher precision. Currently trying to create a column with just DECFLOAT yields: Executing statement... SQL Message : -607 Engine Code : 335544351 |
Commented by: @mrotteveel Good point, changed it to 34 |
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @mrotteveel I'm preparing a pull request that fixes this. |
Commented by: @mrotteveel Pull request: #150 |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Beta 1 [ 10750 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @mrotteveel
SQL:2016 specifies the following for datatype declaration of DECFLOAT:
"""
<decimal floating-point type> ::=
DECFLOAT [ <left paren> <precision> <right paren> ]
"""
In other words, specifying the precision is optional, as explicitly defined in the Syntax rules:
"""
20) If a <precision> is omitted, then an implementation-defined <precision> is implicit.
"""
I propose we default to precision 34 when no precision has been specified, choosing the higher precision.
Currently trying to create a column with just DECFLOAT yields:
Executing statement...
Error: *** IBPP::SQLException ***
Context: Statement::Execute( CREATE TABLE decfloat_no_precision
(
decfloat_np decfloat
) )
Message: isc_dsql_execute2 failed
SQL Message : -607
This operation is not defined for system tables.
Engine Code : 335544351
Engine Message :
unsuccessful metadata update
CREATE TABLE DECFLOAT_NO_PRECISION failed
SQL error code = -607
Invalid command
Specified domain or source column DECFLOAT does not exist
Commits: 4566623
The text was updated successfully, but these errors were encountered: