Datatype declaration DECFLOAT without precision should use a default precision
------------------------------------------------------------------------------

                 Key: CORE-5710
                 URL: http://tracker.firebirdsql.org/browse/CORE-5710
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 4.0 Alpha 1
         Environment: Firebird-4.0.0.852-0_x64
            Reporter: Mark Rotteveel


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 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...
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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to